Best way to send data from Arduino Mega 2560 to ESP8266?
Posted: Fri Aug 02, 2019 11:02 am
Hello everyone.
I'm making a game with motion sensors on Arduino Mega 2560. When motion is detected on one of the sensors, the user gets a point and so on. What I want to do is send these points to my Android app, which will then display them and play a soundeffect when the user gains a point.
My question is, what would be the simplest way to achieve this? I've looked into the ESP8266 a lot and tried some things but with no success so far. I have an ESP8266-ESP01 and an ESP8266-ESP12.
The following link is what I initally tried but did not succeed.
Basically I wanted to send my data to a Firebase server but from what I understood the ESP8266Wifi library works only if you connect the ESP8266 directly into a USB port with one of these which I bought also. If I connected the ESP to the Arduino Mega and then tried uploading the code but got an error because the esptool.py did not detect the ESP via the selected COM port (connection timed out - not my screenshot, but the same error).
Im guessing a way to do it would be send sensor data via the serial port to the ESP which then uploads the data to the server (need a GET and POST request). A tutorial I found was this but I'm not sure if this is exactly what I'm looking for.
I see this forum is pretty active so I'm hoping to get some answers to educate me in achieving my goal. Thanks in advance.
I'm making a game with motion sensors on Arduino Mega 2560. When motion is detected on one of the sensors, the user gets a point and so on. What I want to do is send these points to my Android app, which will then display them and play a soundeffect when the user gains a point.
My question is, what would be the simplest way to achieve this? I've looked into the ESP8266 a lot and tried some things but with no success so far. I have an ESP8266-ESP01 and an ESP8266-ESP12.
The following link is what I initally tried but did not succeed.
Basically I wanted to send my data to a Firebase server but from what I understood the ESP8266Wifi library works only if you connect the ESP8266 directly into a USB port with one of these which I bought also. If I connected the ESP to the Arduino Mega and then tried uploading the code but got an error because the esptool.py did not detect the ESP via the selected COM port (connection timed out - not my screenshot, but the same error).
Im guessing a way to do it would be send sensor data via the serial port to the ESP which then uploads the data to the server (need a GET and POST request). A tutorial I found was this but I'm not sure if this is exactly what I'm looking for.
I see this forum is pretty active so I'm hoping to get some answers to educate me in achieving my goal. Thanks in advance.