1

This question already has an answer here:

I'm working on a IOT project where three or more IOT device communicates with a web server. The IoT device will have Arduino UNO which is connected to a ESP8266 so internet access is available. Arduino UNO reads current sensor data and post it to a website that I built and I also want to control a single relay switch from the same website. I am a beginner and most project I find is only single directional communication or making ESP8266 as web server. Please point me to right Direction.

I was able to post sensor data to thingspeak.com. I was also able to control The relay switch from a website but only separately. I was not able to make it work when I combined the two.

Directions:

  1. How to build web APIS to send and receive data to Arduino UNO via esp8266?
  2. How to send data and check the received data in Arduino UNO VIA esp8266?
  3. Can I send and receive data in JSON format Arduino UNO?
  4. How can the Arduino UNO filter required data from the received json?
  5. Is this project possible without Arduino and just by programming the ESP8266 module?

I know basic HTML, Basic CSS, Basic JavaScript, Basic Nodejs, json and a tiny bit of JQuery.

marked as duplicate by sempaiscuba, Greenonline, VE7JRO, MatsK, Dmitry Grigoryev Oct 4 '18 at 13:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • @MichaelT, it is not a duplicate of that question. in this question he wants 3 esp8266 communicate with a web server, not to run a web server on esp8266 with AT commands – Juraj Sep 30 '18 at 13:19
  • Thank you @Juraj... that is exactly what I want. How can it be done? – tony mathew Oct 1 '18 at 5:55
  • @tonymathew, I wrote an Answer yesterday as I could to your broad question. read it and ask in comments – Juraj Oct 1 '18 at 6:50
2

Is this project possible without Arduino and just by programming the ESP8266 module?

Yes if you use ESP-12 or an esp8266 dev board like Wemos or NodeMCU. The problem could be the current sensor. I would recommend to read it with I2C ADC module, because the esp8266 A0 can read only to 1 V and is shared with WiFi functions. Wemos boards use a circuit to read analog until 3.3 V, but it doesn't help much.

How to build web APIS to send and receive data to Arduino UNO via esp8266?

Run your Web server in Internet and let the esp8266 and clients communicate over it. But think about security.

For accessing a Web server from Arduino or esp8266 see the WebClient example of networking libraries.

How to send data and check the received data in Arduino UNO VIA esp8266?

For Arduino with esp8266 as network adapter connected to Serial you can use AT firmware in esp8266 and WiFiEsp library in Arduino. Or you can have a sketch for the esp8266 with Arduino esp8266 core package and your own protocol over Serial to communicate between esp8266 and Uno. And there are firmwares for esp8266 written as esp8266 sketch, which you can use with corresponding Arduino library (WiFiLink, WiFiSpi).

Can I send and receive data in JSON format Arduino UNO? How can the Arduino UNO filter required data from the received json?

ArduinoJson library helps with processing the JSON format. Amount of RAM could be a problem on Uno.

  • I not only want to post data to a web server and using this data the web server will automatically send an instruction to Arduino UNO to turn off the switch, also I should be able to manually turn the light on and off from the website – tony mathew Oct 1 '18 at 7:41
  • I am using ESP-01 ESP8266 and Current Sensor ACS712 – tony mathew Oct 1 '18 at 7:54
  • the IoT device must check the server for commands (with GET requests). try Blynk service. it is good for remote controlling of iot device – Juraj Oct 1 '18 at 8:10
  • I finall could HTTP GET and POST data to node_express server.. thanks for help.. heres link to my entire project github.com/tonyclx/Nodewifiesp/tree/master – tony mathew Oct 16 '18 at 13:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.