Arduino Mega to ESP8266 WiFi shield serial connection

Hi Folks,

I have had great success connecting the Arduino Uno to my wifi network using the ESP8266 WiFi shield and the software serial library. I have an app now where I need the larger memory capability of the Arduino Mega. I have tried using the software serial library and I have tried using hardware serial with each of the different hardware ports available on the Mega. I can not get the Mega to talk to this wifi shield. I originally started with the ESP8266 Wifi shield demo which was so successful with the Uno. All I get when I run this code is ‘error talking to esp8266’ and then ‘error: 0’ and then ‘looping forever’. I have tried everything I can think of to make this code work, but to no avail. Do you have example code to make this connection?

thanks,

Steve

FYI - I have the following line in SparkfunESP8266Wifi.h. I did this because I understand that pins 10 and 11 can be used for TX and RX on the Uno and Mega. This config works fine on the Uno, but doesn’t seem to work on the Mega.

#define ESP8266_SW_RX 11 // ESP8266 UART0 RXI goes to Arduino pin 9

#define ESP8266_SW_TX 10 // ESP8266 UART0 TXO goes to Arduino pin 8

I’ve been using the Sparkfun ESP8266 Shield Demo just to get communication going, to try to get Mega to talk to ESP8266, but it is not working.

I do have the hardware/software switch on the ESP8266 board set to software.

Thank you for any help that you can give, much appreciated,

Steve

Never mind, this works now, a dodgy connection on one of the plug in pins on one of the serial lines