0

Is it possible to connect arduino uno to call a php script using ONLY an arduino uno board, and an esp8266-01 wifi module.? That is, I lack wifi shield such as node MCU. I just need the setup to call a php script on my localhost server. I'm using arduino IDE 1.8.13. Gracias

  • You may want to see my blog where I use an ESP-01 as a wifi-shield of an Arduino. You can either communicate with ESP-01 via AT Command or have both Arduino and ESP-01 running its own Arduino code with a pre-defined communication states management between the two. – hcheung Jul 31 at 8:31
  • This seems like just what I want. Let me run thru the tutorial and see. Thank you – Ngugi Kariuki Jul 31 at 8:51
0

You can program the ESP-01 module using the arduino IDE. There are instructions in the README here: https://github.com/esp8266/Arduino

You can program the ESP-01 to connect to WiFi and communicate with your arduino sketch using the serial port. Don't forget the ESP-01 runs at 3.3V while the arduino runs at 5V. You'll need to shift the voltages somehow, otherwise you'll burn the arduino uno.

Here's an example of code you can run on the ESP-01 to connect to WiFi and start a TCP connection: https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino

All that's missing is making an HTTP request instead of a "raw" TCP connection. You can probably find that in the examples. Then, add code for serial communication back to your arduino uno.

Good luck!

| improve this answer | |
  • Much appreciated. I'm working on this. I'll get you feedback. Thanks again – Ngugi Kariuki Jul 31 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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