Connecting and working with Mega +WiFi R3 ATmega2560+ESP8266 (32Mb memory)

Hi Juraj,

I'm wondering if there's any code example to reconnect to the wifi network after the mega board got disconnected due to any reason?

Thanks!

attila_r:
Hi Juraj,

I'm wondering if there's any code example to reconnect to the wifi network after the mega board got disconnected due to any reason?

Thanks!

the TemporaryWiFiConnect example

Maybe someone will like my video
Arduino robotdyn mega wifi or wemos mega wifi
Serial3 rxtx json to webpage
Did not use phonemodem like AT commands
See my 2 videos
Program mega

Program esp

luberth:
Maybe someone will like my video
Arduino robotdyn mega wifi or wemos mega wifi
Serial3 rxtx json to webpage
Did not use phonemodem like AT commands
See my 2 videos
Program mega
https://youtu.be/-6pCNxrkMBQ
Program esp
https://youtu.be/ovknn3jKp1Y

Hey man, thank for sharing these videos, but can you please share also the code ?

Hello guys,
I hope one gentle soul will help me to go out of this mess, because i'm going crazy;

I correctly Flash ESP8266_NONOS_SDK-2.2.1 firmware on my Mega+WIFI r3 Board following some tutorial.

With DIP switches 5 and 6 ON
AT command correctly respond
OK
All seems to be ok untill these point.

Now I turn DIPs 1, 2 ,3 ,4 ON others off

with the library WiFiEsp Examples
WifiScanner works properly,
Wifi connection give me the message
[WiFiEsp] Failed connecting to SSID_NET

Did you see something strange in my passages ?
Can you help me to debug the situation please?

Muplex:
Hello guys,
I hope one gentle soul will help me to go out of this mess, because i'm going crazy;

I correctly Flash ESP8266_NONOS_SDK-2.2.1 firmware on my Mega+WIFI r3 Board following some tutorial.

With DIP switches 5 and 6 ON
AT command correctly respond
OK
All seems to be ok untill these point.

Now I turn DIPs 1, 2 ,3 ,4 ON others off

with the library WiFiEsp Examples
WifiScanner works properly,
Wifi connection give me the message
[WiFiEsp] Failed connecting to SSID_NET

Did you see something strange in my passages ?
Can you help me to debug the situation please?

check SSID and password

nonos SDK is not a firmware. you flashed AT firmware 1.6? why? there is AT 1.7 with nonos SDK 3. with that you could use my new WiFiEspAT library. GitHub - JAndrassy/WiFiEspAT: Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.

Juraj:
check SSID and password

nonos SDK is not a firmware. you flashed AT firmware 1.6? why? there is AT 1.7 with nonos SDK 3. with that you could use my new WiFiEspAT library. GitHub - JAndrassy/WiFiEspAT: Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.

Hello
SSID and password are correct for sure!!! I copy paste it and check it several times

I try also newer AT but gives me problem and to be 100% coherent with the online tutorial I flash it the same "older" version, because the tutorial was "old".

I will try to upload the lastest and let you know.....

....second chance try to use WiFiespAT but i have to read a lot to be able to manage it...

Thank for your reply, I will let you nkow

Hei Juraj, Thank you,
WiFiespAT incredibly solve the situation =)
Now the board is connected to my WiFi network =)

The library is yours, isnt' it ?

Last step is send/recive MQTT messages,

the old library need the lines

//WiFiEspClient espClient;
//PubSubClient client(espClient);

to initialize MQTT client, what is the same for your code ????

many thanks Juraj for your help, God bless you!!!!

Muplex:
Hei Juraj, Thank you,
WiFiespAT incredibly solve the situation =)
Now the board is connected to my WiFi network =)

The library is yours, isnt' it ?

Last step is send/recive MQTT messages,

the old library need the lines

//WiFiEspClient espClient;

//PubSubClient client(espClient);




to initialize MQTT client, what is the same for your code ????


many thanks Juraj for your help, God bless you!!!!

yes I mentioned in the previous comment that it is my library.

the PubSubClient library works over the Client base class. so any Client implementation is good. EthernetClient, WiFiClient, TinyGsmClient... all are good

Oh my god.... Another fruatrating problem.
.all seems to work properly but After a while (minute or hours randomly) the board disconnect from the network.

Any idea?
I wil let you know serial debug message.... Now not possible

Serial monitor get

Attempting MQTT connection...failed, rc=-2 try again in 5 seconds
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds

but after a while, minutes or hours, randomly

I think pubsub-client linked problem