ESP8266Wifi Gateway won't connect
-
I'm trying to add a 2.4 GHz gateway using an 8266 nodemcu and nrf24l01 module. I wired the system according to the "Connecting the Radio" section for ESP8266 devices. I've double checked the wiring.
The system programs and runs as expected with no errors. Nothing is sent to the serial port except the initial bootloader stuff. No connection info, no nada. My SSID and password are correct. I have the My_Debug def uncommented. The system is not connecting to the network...and I'm not sure why. The 8266 is known good. I'm using the app directly from the MySensors Examples with my network credentials added. Wired up a WEMOS mini and another radio exactly the same way with the same results. I've even tried another radio on the setup...same
Does the code try to connect to the network first or does set up the radio first. I'm not seeing any debug info whatsoever? I'm using Domoticz running on a raspberry pi system. Any ideas?? Have I got the wiring wrong?Thanks,
Dan -
I'm trying to add a 2.4 GHz gateway using an 8266 nodemcu and nrf24l01 module. I wired the system according to the "Connecting the Radio" section for ESP8266 devices. I've double checked the wiring.
The system programs and runs as expected with no errors. Nothing is sent to the serial port except the initial bootloader stuff. No connection info, no nada. My SSID and password are correct. I have the My_Debug def uncommented. The system is not connecting to the network...and I'm not sure why. The 8266 is known good. I'm using the app directly from the MySensors Examples with my network credentials added. Wired up a WEMOS mini and another radio exactly the same way with the same results. I've even tried another radio on the setup...same
Does the code try to connect to the network first or does set up the radio first. I'm not seeing any debug info whatsoever? I'm using Domoticz running on a raspberry pi system. Any ideas?? Have I got the wiring wrong?Thanks,
Dan -
@dpcons have you enabled debug output? https://forum.mysensors.org/topic/666/read-this-first-it-could-save-you-a-lot-of-time describes how
@mfalkvidd yes
Yes, it's defined. I also ran the advanced webserver sample and it runs fine. It connects nicely and sends status to the serial port. -
@mfalkvidd yes
Yes, it's defined. I also ran the advanced webserver sample and it runs fine. It connects nicely and sends status to the serial port. -

I tested the Advanced Web Server Sample with this setup. Works fine. I tried the GatewayESP8266 on this setup and another setup with a WEMOS Pro mini. Same results, nothing out the serial port. I also tried the gateway app on an esp8266 with no radio attached and got no serial at 115200 at all. Is this normal? Shouldn't I get some kind of error message.
I'll try setting up an app to talk to the RF24 directly and see how that goes.
Is the GatewayESP32 working for the RF24 radios? If so, maybe I'll try that. I'm quite puzzled.
This assembly worked at one time a couple of years ago on another system. -
Tried on windows 11 machine Arduino 1.8.19 with latest MySensors Library. Tried on Windows 10 machine with Arduino 1.8.13 and latest MySensors library. Just an FYI. Thanks for staying with me.
@dpcons As you are seeing no serial debug data. Have you checked that your serial data monitor is set for the same baud rate as set in the sketch (9600 on MySensors GatewayESP8266 sketch) as other sketches use default 115200
-
No comm at any baud rate except trash I/O at boot time. The gateway code specifies 9600 but I've tried them all. The problem is the system is not connecting with the network.
In addition, built up a new system using an ESP32 module and an nRF24L01 module.
Tried the "GatewayESP32" example app on the known good ESP32 module. After uploading, this module spits good data out the serial port at 115200 KHz (See below:)...but never tries to connect to the network. I'm using the "GatewayESP32" example with my network credentials added.
The ESP32 appears to be getting data from my 2.4GHz sensors, but never gets to my network.16:57:05.271 -> 10009772 TSF:MSG:BC
16:57:05.271 -> 10009774 TSF:MSG:FPAR REQ,ID=12
16:57:05.271 -> 10009776 TSF:PNG:SEND,TO=0
16:57:05.271 -> 10009779 TSF:CKU:OK
16:57:05.271 -> 10009781 TSF:MSG:GWL OK
16:57:05.505 -> 10010001 !TSF:MSG:SEND,0-0-12-12,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
16:57:05.505 -> 10010008 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:57:21.018 -> 10025533 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
16:57:21.018 -> 10025539 TSF:MSG:BC
16:57:21.018 -> 10025540 TSF:MSG:FPAR REQ,ID=7
16:57:21.018 -> 10025543 TSF:PNG:SEND,TO=0
16:57:21.018 -> 10025545 TSF:CKU:OK
16:57:21.018 -> 10025547 TSF:MSG:GWL OK
16:57:21.674 -> 10026174 !TSF:MSG:SEND,0-0-7-7,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
16:57:29.313 -> 10033832 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:57:31.843 -> 10036367 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:-0.3
16:57:31.937 -> 10036433 TSF:MSG:READ,5-5-0,s=1,c=1,t=0,pt=7,l=5,sg=0:-19.5
16:57:43.934 -> 10048467 TSF:MSG:READ,7-7-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
16:57:43.981 -> 10048472 TSF:MSG:PINGED,ID=7,HP=1
16:57:43.981 -> 10048516 !TSF:MSG:SEND,0-0-7-7,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
16:57:56.119 -> 10060615 TSF:MSG:READ,2-2-0,s=0,c=1,t=1,pt=7,l=5,sg=0:43.3
16:57:56.119 -> 10060635 TSF:MSG:READ,2-2-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:04.393 -> 10068900 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:58:05.190 -> 10069700 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:06.736 -> 10071270 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:-0.1
16:58:06.830 -> 10071334 TSF:MSG:READ,5-5-0,s=1,c=1,t=0,pt=7,l=5,sg=0:-19.4
16:58:35.125 -> 10099641 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:39.437 -> 10103962 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:58:41.640 -> 10106168 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:0.0
16:58:59.372 -> 10123897 TSF:MSG:READ,2-2-0,s=0,c=1,t=1,pt=7,l=5,sg=0:43.3
16:58:59.419 -> 10123914 TSF:MSG:READ,2-2-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.0
16:59:05.091 -> 10129603 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:59:14.527 -> 10139033 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:59:16.571 -> 10141065 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:0.1
Again, as with the ESP8266 gateway the "Advanced Web Server" for the ESP32 chip uploads nicely, connects to my network and runs as expected. I'm stopped anyway I try to go. -
No comm at any baud rate except trash I/O at boot time. The gateway code specifies 9600 but I've tried them all. The problem is the system is not connecting with the network.
In addition, built up a new system using an ESP32 module and an nRF24L01 module.
Tried the "GatewayESP32" example app on the known good ESP32 module. After uploading, this module spits good data out the serial port at 115200 KHz (See below:)...but never tries to connect to the network. I'm using the "GatewayESP32" example with my network credentials added.
The ESP32 appears to be getting data from my 2.4GHz sensors, but never gets to my network.16:57:05.271 -> 10009772 TSF:MSG:BC
16:57:05.271 -> 10009774 TSF:MSG:FPAR REQ,ID=12
16:57:05.271 -> 10009776 TSF:PNG:SEND,TO=0
16:57:05.271 -> 10009779 TSF:CKU:OK
16:57:05.271 -> 10009781 TSF:MSG:GWL OK
16:57:05.505 -> 10010001 !TSF:MSG:SEND,0-0-12-12,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
16:57:05.505 -> 10010008 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:57:21.018 -> 10025533 TSF:MSG:READ,7-7-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
16:57:21.018 -> 10025539 TSF:MSG:BC
16:57:21.018 -> 10025540 TSF:MSG:FPAR REQ,ID=7
16:57:21.018 -> 10025543 TSF:PNG:SEND,TO=0
16:57:21.018 -> 10025545 TSF:CKU:OK
16:57:21.018 -> 10025547 TSF:MSG:GWL OK
16:57:21.674 -> 10026174 !TSF:MSG:SEND,0-0-7-7,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0
16:57:29.313 -> 10033832 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:57:31.843 -> 10036367 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:-0.3
16:57:31.937 -> 10036433 TSF:MSG:READ,5-5-0,s=1,c=1,t=0,pt=7,l=5,sg=0:-19.5
16:57:43.934 -> 10048467 TSF:MSG:READ,7-7-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1
16:57:43.981 -> 10048472 TSF:MSG:PINGED,ID=7,HP=1
16:57:43.981 -> 10048516 !TSF:MSG:SEND,0-0-7-7,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=NACK:1
16:57:56.119 -> 10060615 TSF:MSG:READ,2-2-0,s=0,c=1,t=1,pt=7,l=5,sg=0:43.3
16:57:56.119 -> 10060635 TSF:MSG:READ,2-2-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:04.393 -> 10068900 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:58:05.190 -> 10069700 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:06.736 -> 10071270 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:-0.1
16:58:06.830 -> 10071334 TSF:MSG:READ,5-5-0,s=1,c=1,t=0,pt=7,l=5,sg=0:-19.4
16:58:35.125 -> 10099641 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:58:39.437 -> 10103962 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:58:41.640 -> 10106168 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:0.0
16:58:59.372 -> 10123897 TSF:MSG:READ,2-2-0,s=0,c=1,t=1,pt=7,l=5,sg=0:43.3
16:58:59.419 -> 10123914 TSF:MSG:READ,2-2-0,s=1,c=1,t=0,pt=7,l=5,sg=0:26.0
16:59:05.091 -> 10129603 TSF:MSG:READ,9-9-0,s=0,c=1,t=0,pt=7,l=5,sg=0:26.0
16:59:14.527 -> 10139033 TSF:MSG:READ,3-3-0,s=0,c=1,t=37,pt=2,l=2,sg=0:1380
16:59:16.571 -> 10141065 TSF:MSG:READ,5-5-0,s=0,c=1,t=0,pt=7,l=5,sg=0:0.1
Again, as with the ESP8266 gateway the "Advanced Web Server" for the ESP32 chip uploads nicely, connects to my network and runs as expected. I'm stopped anyway I try to go.@dpcons I assembled a board copied from yours for testing.

I could replicate the problem. It is with the ESP core version and the MySensor Version
MySensors version 2.3.2 and ESP8266 core 3.0.2 does not work,MySensors version 2.3.2 and ESP8266 core 2.7.4 works
Mysensors development version 2.4.0-Alpha and newest ESP8266 core 3.0.2 also works
So you can either update the esp core to older version 2.7.4, or install the development version of MySensors 2.4.0-Alpha
-
@dpcons I assembled a board copied from yours for testing.

I could replicate the problem. It is with the ESP core version and the MySensor Version
MySensors version 2.3.2 and ESP8266 core 3.0.2 does not work,MySensors version 2.3.2 and ESP8266 core 2.7.4 works
Mysensors development version 2.4.0-Alpha and newest ESP8266 core 3.0.2 also works
So you can either update the esp core to older version 2.7.4, or install the development version of MySensors 2.4.0-Alpha
@hard-shovel said in ESP8266Wifi Gateway won't connect:
MySensors version 2.3.2 and ESP8266 core 2.7.4 works
-
@dpcons I assembled a board copied from yours for testing.

I could replicate the problem. It is with the ESP core version and the MySensor Version
MySensors version 2.3.2 and ESP8266 core 3.0.2 does not work,MySensors version 2.3.2 and ESP8266 core 2.7.4 works
Mysensors development version 2.4.0-Alpha and newest ESP8266 core 3.0.2 also works
So you can either update the esp core to older version 2.7.4, or install the development version of MySensors 2.4.0-Alpha
@hard-shovel I had same issue and using older version worked for me too
-
@dpcons I assembled a board copied from yours for testing.

I could replicate the problem. It is with the ESP core version and the MySensor Version
MySensors version 2.3.2 and ESP8266 core 3.0.2 does not work,MySensors version 2.3.2 and ESP8266 core 2.7.4 works
Mysensors development version 2.4.0-Alpha and newest ESP8266 core 3.0.2 also works
So you can either update the esp core to older version 2.7.4, or install the development version of MySensors 2.4.0-Alpha
@hard-shovel Thanks so much for your effort and your timely resolution. I tried going back with previous versions of the library and they didn't work or didn't compile. I greatly appreciate your help with this. I assume something similar is happening to the ESP32 version also. Again, thanks.
-
@hard-shovel Thanks so much for your effort and your timely resolution. I tried going back with previous versions of the library and they didn't work or didn't compile. I greatly appreciate your help with this. I assume something similar is happening to the ESP32 version also. Again, thanks.
@dpcons @hard-shovel @paqor @chrishiscox @mfalkvidd Hi all,
I saw this and got excited that I could use my NodeMCUv1.0 as a MySensors Gateway. I made sure I had the latest MySensors library (2.3.2) and ESP8266 board (3.0.2). I successfully ran a couple examples, first file-->examples-->ESP8266-->Blink then file-->examples-->ESP8266-->interactive (with my ssid & pass), the latter with serial monitor at 115200 baud.
I ensured that my nRF24l01 was functional by connecting it to an Arduino Nano and running the scanner program.
I connected my nRF24l01 to my NodeMCU, both having pins, using new 10cm 7 conductor ribbon cable. (I have successfully used this type of connection to an RPi)
The program ... I copied the program from this page and applied my ssid and password. Nothing ... I suspected that this code is a node template, not a the gateway program.
On that same page was the instruction "Open the WiFi gateway in the Arduino IDE (File -> Sketchbook -> Libraries -> MySensors -> Esp8266Gateway)" I didn't find "Libraries" under "Sketchbook" I a file of the same name at (File -> Sketchbook -> Libraries -> MySensors -> examples --> Esp8266Gateway) which is the same file.
I tried putting into setup the line
Serial.println("com check");but nothing came out on the console.
I think I'm at the same place as @dpcons
update: rechecked my radio with the RF24 "getting started" program and found the radio good. Updated my Arduino IDE. Still not working.
-
@dpcons @hard-shovel @paqor @chrishiscox @mfalkvidd Hi all,
I saw this and got excited that I could use my NodeMCUv1.0 as a MySensors Gateway. I made sure I had the latest MySensors library (2.3.2) and ESP8266 board (3.0.2). I successfully ran a couple examples, first file-->examples-->ESP8266-->Blink then file-->examples-->ESP8266-->interactive (with my ssid & pass), the latter with serial monitor at 115200 baud.
I ensured that my nRF24l01 was functional by connecting it to an Arduino Nano and running the scanner program.
I connected my nRF24l01 to my NodeMCU, both having pins, using new 10cm 7 conductor ribbon cable. (I have successfully used this type of connection to an RPi)
The program ... I copied the program from this page and applied my ssid and password. Nothing ... I suspected that this code is a node template, not a the gateway program.
On that same page was the instruction "Open the WiFi gateway in the Arduino IDE (File -> Sketchbook -> Libraries -> MySensors -> Esp8266Gateway)" I didn't find "Libraries" under "Sketchbook" I a file of the same name at (File -> Sketchbook -> Libraries -> MySensors -> examples --> Esp8266Gateway) which is the same file.
I tried putting into setup the line
Serial.println("com check");but nothing came out on the console.
I think I'm at the same place as @dpcons
update: rechecked my radio with the RF24 "getting started" program and found the radio good. Updated my Arduino IDE. Still not working.
@OldSurferDude @dpcons Hi all,
The sample sketch could also be found using (File -> Examples -> MySensors -> Esp8266GatewayAs MySensors version 2.3.2 and ESP8266 core 3.0.2 combination does not work you need to change one or the other versions.
The simplest is to roll back the ESP8266 Core version to 2.7.4 and keep the MySensors 2.3.2 version
(Tools -> Board -> Board Manager)
Enter ESP8266 in search bar, then click within the ESP8266 data info box, click the select version pulldown.
Select 2.7.4 and then click Install.
Other option is to update the MySensors library to the development version 2.4.0-Alpha but that has to be done manually.
-
@OldSurferDude @dpcons Hi all,
The sample sketch could also be found using (File -> Examples -> MySensors -> Esp8266GatewayAs MySensors version 2.3.2 and ESP8266 core 3.0.2 combination does not work you need to change one or the other versions.
The simplest is to roll back the ESP8266 Core version to 2.7.4 and keep the MySensors 2.3.2 version
(Tools -> Board -> Board Manager)
Enter ESP8266 in search bar, then click within the ESP8266 data info box, click the select version pulldown.
Select 2.7.4 and then click Install.
Other option is to update the MySensors library to the development version 2.4.0-Alpha but that has to be done manually.
@hard-shovel Thanks! Now I'm getting output to the monitor. I think I need to set up the IP address and the port 1883 for the MQTT broker. How is that done? I am also getting data from my Arduino node sensors :) I see "controller" but when I change that to my broker's address I get streaming ETH FAIL
-
@hard-shovel Thanks! Now I'm getting output to the monitor. I think I need to set up the IP address and the port 1883 for the MQTT broker. How is that done? I am also getting data from my Arduino node sensors :) I see "controller" but when I change that to my broker's address I get streaming ETH FAIL
The port was set to 5003 and setting it to 1883 (the default MQTT broker port) it now seems to work
-
The port was set to 5003 and setting it to 1883 (the default MQTT broker port) it now seems to work
@OldSurferDude If connecting to a MQTT Broker i would have expected you to use the GatewayESP8266MQTTClient sketch.
as this is already setup with correct Port 1883 for MQTT and the publishing and subscription topics.I did a quick test of a GatewayESP8266MQTTClient sketch with mosquitto and it works fine for me.
-
@OldSurferDude @dpcons Hi all,
The sample sketch could also be found using (File -> Examples -> MySensors -> Esp8266GatewayAs MySensors version 2.3.2 and ESP8266 core 3.0.2 combination does not work you need to change one or the other versions.
The simplest is to roll back the ESP8266 Core version to 2.7.4 and keep the MySensors 2.3.2 version
(Tools -> Board -> Board Manager)
Enter ESP8266 in search bar, then click within the ESP8266 data info box, click the select version pulldown.
Select 2.7.4 and then click Install.
Other option is to update the MySensors library to the development version 2.4.0-Alpha but that has to be done manually.
@hard-shovel While it all seemed to be working, it appears that the ESP8266 MySensors Gateway was not passing the data onto the MQTT broker. Working, meaning that data from the Arduino sensors were getting to the Gateway, but that data was not getting to the broker. Here are some lines of the debug output:
6217818 TSF:MSG:READ,133-133-255,s=255,c=3,t=7,pt=0,l=0,sg=0: 6217883 TSF:MSG:BC 6217903 TSF:MSG:FPAR REQ,ID=133 6217936 TSF:CKU:OK,FCTRL 6217962 TSF:MSG:GWL OK 6218281 !TSF:MSG:SEND,0-0-133-133,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=NACK:0Also, as an indication that data was not being passed from the Gateway to the broker, I had reset my MQTT Broker and subsequently monitored it with MQTT explorer. The topic "mysensors-out" was not created.
I shut down the ESP8266 MySensors Gateway and restarted the my original one that is running on an RPi. Everything started running as expected.
Thus, my conclusion.
OK, so why isn't the ESP8266 MySensors Gateway passing on the data?
-
@OldSurferDude If connecting to a MQTT Broker i would have expected you to use the GatewayESP8266MQTTClient sketch.
as this is already setup with correct Port 1883 for MQTT and the publishing and subscription topics.I did a quick test of a GatewayESP8266MQTTClient sketch with mosquitto and it works fine for me.
@hard-shovel I try the client
-
@OldSurferDude If connecting to a MQTT Broker i would have expected you to use the GatewayESP8266MQTTClient sketch.
as this is already setup with correct Port 1883 for MQTT and the publishing and subscription topics.I did a quick test of a GatewayESP8266MQTTClient sketch with mosquitto and it works fine for me.
@hard-shovel client worked for me, too. That is, it sent the message "2.3.2" to topic "mygateway1-outx/0/255/0/0/18"