Arduino Email Sending

like this

// PIR4Blynker.ino on Arduino
/* Comment this out to disable prints and save space */
//#define BLYNK_PRINT SwSerial

#include <SoftwareSerial.h>
SoftwareSerial SwSerial(6, 11); // RX, TX

#include <BlynkSimpleStream.h>

// You should get Auth Token in the Blynk App.

No. Use my last sketch as everything is edited in there.

Just add new token and email address.

.ok

You can test it now, it sass its offline still

Is USB connection still OK?

i am not sure i will unplug it and plug it back now its seems to show that USB connection is fine, but i think the terminal is now reconnecting

I can now see the physical led light up and on terminal it says its reconnecting

I am trying to recoonect the arduino and re upload the sketch but its saying again error opening serial port

Stop the USB connection in terminal and also hard reset the Arduino.

Don’t forget to reconnect the USB in terminal after flash and keep Serial Monitor closed.

How do i exactly hard reset an arduino? i press the reset button?

Correct.

You mean close the terminal? how do i exactly reconnect the USB you mean into computer?

CTRL C to stop the script that is running in terminal and then after flash run the script again.

so i can stop the script instead of typing it again?

Now it is online and i can see when the LED blinks i saw it on the phone

The value is also counting and i can now see the LED blink before i couldnt

Now i get the email

You are a genius, but i have a problem i want a buzzer working when the PIR sensor also gets activated if that is possible to make. In school when i will present sometimes i may want to not use the buzzer so do i just pull it out?? Or can i control the sound through the code?

I am very happy that you have helped me and achieved what i wanted! so is there any way to connect the buzzer and sometimes if needed remove it. I am completely fine using the it like this but if you can connect the buzzer and if i find a way to add it during the presentation or remove it it would be great

Glad it’s working.

What you learnt:

How to install socat and edit the script for any future port changes etc.

Always start with Blynk’s basic sketch for your chosen connection method and then add in your required code.

Use BlynkTimer to call functions at timed intervals. In this case every 473ms, which is what we use in our ESP8266 PIR system.

Only sends email at 15s intervals as that is a Blynk limitation so we choose 15123ms. Note maximum of 100 emails per day.

No you use Blynk buttons to disable buzzers and PIR etc.

That’s for another time, I have some stuff to do.

Would suggest you buy a USB2TTL adaptor for use with USB connection and then you can use Serial Monitor debugging, cost < $1.