I am having issues connecting my Arduino Mega 2560 to my ESP8266 Wifi Shield. The shield demo project has a connection error. When running the serial passthrough project I am able to send data but I receive nothing in response. I have confirmed data is transmitted to the wifi shield because I can change the network name or password and the status light will turn solid if I enter the correct information and will blink if I enter the incorrect information.
I have the UART switch set to SW and have tested for a short between the switch and the pins on the Arduino board to confirm connectivity through the headers. I have the USB connection on the Arduino covered with tape to prevent short circuit between the programming through-holes.
Any other thoughts?
This post is very old, but I’m having a very similar problem, so will add it to this discussion.
I’m using the ESP8266 wifi project, running the example code from the Sparkfun library. I’ve been very successful running this with the Arduino Uno, and being able to access it from Putty, on an Ubuntu laptop.
However, when I try to run the same code on the Arduino Mega 2560, it does the thing where it tells me it’s looping forever when accessing it from Putty. I run it from the Uno, runs fine, run from Mega 2560, get the loop forever.
Any thoughts on what might be going wrong?
Incidentally, I’m trying the Mega because I had an issue with the Uno. I was using the Uno/ESP8266 as a web server, but when the amount of lines of HTML code that I was using in the Uno code got past a certain point, the server would start dropping lines when I accessed it from the client (browser on a separate laptop). For instance, it was OK, if I added one button to the HTML code, but when I added a second button, it would just not appear. If I right clicked on my browser to look at the HTML source code from the server, the line would be missing that defined the second button. One curious thing was that it was not a line from the end of the code that was missing, but more typically a line from the middle of the code.
I was hoping that it was an error due to limited memory resources in the Uno, so I am trying the Mega.
Please let me know if you can help me with either problem.
thanks,
Steve
I found a web page that goes into the details of using the Arduino Mega and the Sparkfun ESP8266 Wi-Fi shield.
It mentions that because the Mega uses different pins to talk to the Wi-Fi shield, that you have to add a line to your Arduino code to talk to the correct pins.
I traced the lines on the Mega schematic. It looks like pins D8 and D9 go to the ESP8266 SW control. On the Mega, these go back to pins 17 ad 18 on the CPU, so I added the following line near the beginning of my Arduino code.
SoftwareSerial esp8266(17,18);
The Mega still won’t talk to the ES8266.
I’ve checked the voltage levels coming on to the board. The levels are at 5V, and they get dropped down to 3.3V in the circuitry on the Wi-Fi shield.
Anybody else have any ideas?
thanks,
Steve