How to Send and Receive WhatsApp Messages From ESP8266 - Arduino IDE
by mati181818 in Circuits > Arduino
12113 Views, 17 Favorites, 0 Comments
How to Send and Receive WhatsApp Messages From ESP8266 - Arduino IDE
![Screenshot_68.png](/proxy/?url=https://content.instructables.com/F44/0C6K/L7AHIKF1/F440C6KL7AHIKF1.png&filename=Screenshot_68.png)
I'll explain how can you send yourself WhatsApp messages in a very easy way from your IoT devices. In this case from ESP8266 - Wemos D1 Mini - Using the Arduino IDE
Supplies
. Wemos D1 mini
. whatabot.io opened
. Arduino IDE
. Wifi access
Add ESP8266 Boards in Your IDE
![Screenshot_73.png](/proxy/?url=https://content.instructables.com/FB8/ZW9A/L7AHIL2L/FB8ZW9AL7AHIL2L.png&filename=Screenshot_73.png)
Add this: http://arduino.esp8266.com/stable/package_esp8266com_index.json in your additional boards manager URL list in your Arduino IDE.
Steps:
1- Go to File
2- Click on Preferences
3- Add the URL in Aditional Boards Manager URLs field
Download ESP8266 Boards
![Screenshot_75.png](/proxy/?url=https://content.instructables.com/F2E/C19F/L7AHILP8/F2EC19FL7AHILP8.png&filename=Screenshot_75.png)
![Screenshot_74.png](/proxy/?url=https://content.instructables.com/FSD/D66A/L7AHILQ9/FSDD66AL7AHILQ9.png&filename=Screenshot_74.png)
Then go to:
Tools/Board/Boards Manager
Search for esp8266 and click "Install"
Select the Board You Have
![Screenshot_76.png](/proxy/?url=https://content.instructables.com/F0T/79MF/L7AHIM3F/F0T79MFL7AHIM3F.png&filename=Screenshot_76.png)
In this case, we will select "LOLIN(WEMOS) D1 R2 & mini"
Enter to Whatabot.io and Follow It's Steps
![Screenshot_78.png](/proxy/?url=https://content.instructables.com/FQ0/MXHY/L7AHIOI7/FQ0MXHYL7AHIOI7.png&filename=Screenshot_78.png)
You have to:
Go to https://whatabot.io/get-started
Add the number posted there in your contacts
Send the following whatsapp to this number: I allow whatabot to send me messages
Copy and save the apikeywhatabot sent you
Install the Library From the GitHub Repository
Download the soruce code.zip from https://github.com/WhatabotAPI/WhatabotAPIClient/releases/tag/1.0
Add the .ZIP library like this:
reference: https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries/#importing-a-zip-library
Install the WiFi Manager Library
![Screenshot_9.png](/proxy/?url=https://content.instructables.com/FHG/D0JU/LTPTA3ME/FHGD0JULTPTA3ME.png&filename=Screenshot_9.png)
Go to: Tools/Manage Libraries
Search for the library named WiFiManager (by tzapu)
Install it
Install ArduinoJson Library
![FHGD0JULTPTA3ME.png](/proxy/?url=https://content.instructables.com/F1M/JPRH/LVI432BL/F1MJPRHLVI432BL.png&filename=FHGD0JULTPTA3ME.png)
Go to: Tools/Manage Libraries
Search for the library named ArduinoJson (by Benoit)
Install it
Select the Example Called WhatabotWebsocketClient
![Screenshot_8.png](/proxy/?url=https://content.instructables.com/FYI/0TMF/LTPTA3LJ/FYI0TMFLTPTA3LJ.png&filename=Screenshot_8.png)
Go to File/Examples/Whatabot API Client Library/WhatabotWebsocketClient
Replace the Variables With Your Data
Variables needed:
1 - WHATABOT_CHAT_ID = "YOUR_PHONE_NUMBER"; //Without +
2 - WHATABOT_API_KEY = "YOUR_WHATABOT_API_KEY";
Example:
1 - YOUR_PHONE = "5490000000000";
2 - YOUR_APIKEY = "38rhjd-123d-432d"
Upload Your Code and Start Receiving and Sending Whatsapp Messages
![Screenshot_79.png](/proxy/?url=https://content.instructables.com/FXP/Z887/L7AHIQKD/FXPZ887L7AHIQKD.png&filename=Screenshot_79.png)
Note that the first time you execute this, the library WiFiManager will generate a wifi network called "WhatabotAPI"
. You have to connect to it with your mobile or pc (Password: whatabotapi)
. With the web browser, enter to 192.168.4.1
. Press the button "Configure WiFi"
. Follow the steps to connect the arduino to your router
That's all folks!
Your Board Is Not Recognized?
If you have a CH340G based board, follow the instructions posted here:
https://www.instructables.com/Instalar-driver-para-CH340G/