RFLink with NodeMCU, readings are not sent on wifi

About receivers, transmitters, transceivers, connections, antennas etc.

Moderators: rtenklooster, BertB, Voyager, Stuntteam

Post Reply
Message
Author
955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

RFLink with NodeMCU, readings are not sent on wifi

#1 Post by 955 » 06 Mar 2020, 22:25

I am using RFLink but as I wanted to go wireless, I am using it with the NodeMCU kit as sold by nodo-shop.nl
The kit connects the RX/TX on the Mega to the TX/RX of the NodeMCU. As per their guide: https://www.nodo-shop.nl/nl/index.php?c ... achment=31
My idea is to create MQTT messages by using the "espRFLinkMQTT" by seb821 on the NodeMCU.
https://github.com/seb821/espRFLinkMQTT

When connected through the USB/serial port RFLink collects measurements from sensors and switches perfectly.
However, when using NodeMCU with wifi and 'espRFLinkMQTT', only ~20% of all RFLink readings are resulting in a MQTT message.

I have used seb821's guide pretty much straight off. Program builds and executes but something seems to go wrong during execution.
seb821 have suggested that some of the latest libs that should not be used?

Anyone have any idea how to resolve and/or debug?

Thanks!

/Niklas

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#2 Post by seb82 » 07 Mar 2020, 18:26

Well this is weird. Especially if it working time to time. Did you try disabling the serial debug ? Maybe it will help releasing some processing time.

For information, I have compiled the firmware recently with core 2.6.3 and latest libraries (except Arduinojson that is 5.13.5) and used it with no problems.

What I suspect though it that Wifi is interfering with a good reception of the 433 MHz messages.

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#3 Post by 955 » 09 Mar 2020, 22:28

Thanks for replying.
Yes, I think it weird that it is working soso. I would rather accept that it does not work at all.
I am new to the 8266, ESPeasy and Arduino environment but decent in programming.

I am using your code from github, straight off more or less, but had to do a minor change to get it compiling with the RX/TX pin setup.

I am using the following part of config.h:

Code: Select all

/*********************************************************************************
 * Serial and hardware configuration
/*********************************************************************************/
//SoftwareSerial softSerial(4, 2, false,BUFFER_SIZE+2); 
auto& debugSerialTX = Serial;
auto& rflinkSerialRX = Serial;
auto& rflinkSerialTX = Serial;
//SoftwareSerial& rflinkSerialTX = softSerial;

#define MEGA_RESET_PIN 0
//#define SERIAL_DEBUG
It is not possible to uncomment the

Code: Select all

//#define SERIAL_DEBUG
as this will result in a compile error:
espRFLinkMQTT:194:5: error: expected ';' before 'else'
It does look OK too me and I havn't dug further - so SERIAL_DEBUG is undefined.

I also notice that I quite often cannot connect to it using its ipadress. Most of the time webbrowser states that the response takes too long time. And when I am connected it feels unstable and becomes unresponsive after a while. It is just a meter from my router so signal is (too?) strong.
How can 433MHz interfere so severly with a 2.4GHz device?

I tried to crank up the CPU frequency from 80MHz to 160MHz, though I saw a minor improvement but not the silverbullet.
I am compiling with the Board "NodeMCU 1.0" setting.

Happy to get any advice or directions.

Thanks!

/Niklas

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#4 Post by seb82 » 10 Mar 2020, 12:08

I have just pushed my latest version to github.
- Default configuration is now using RX/TX ESP pins
- It does compile properly now while uncommenting SERIAL_DEBUG but I could not test functionnality
- There are a few improvements by not using Strings anymore except for web interface

I did figure out that web interface is quite instable. It may be linked to the extensive use of Strings. Unfortunately, my programming skills are not good enough to improve it.

I would not be suprised that there are interferences with wifi as wifi signal is pretty strong and components quite close one to another. You should be able to test it connecting RFLink to your computer and then bringing the ESP close to the RFLink (you may have to do some kind of ping or refresh the web interface in order to generate traffic with the ESP).

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#5 Post by 955 » 10 Mar 2020, 22:17

Thanks!
I will get new copy from github and let you know my findings.
Any version restrictions from include libs?

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#6 Post by seb82 » 11 Mar 2020, 16:07

955 wrote:
10 Mar 2020, 22:17
Any version restrictions from include libs?
Not really except for Arduinojson as mentionned above.

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#7 Post by 955 » 12 Mar 2020, 23:17

Some testresults. The changes you have done shows significant improvements on the webpart.
I am, more often able to connect successfully thru the IP adress, and when shown it seems more stable.
Every now and then I still get a timeout but all in all it is a significant improvement.

However, the RFLink+NodeMCU combo does still not pick up all 433MHz sensor readings.
The following log was taken during 5min using the RFLink uploader without NodeMCU, showing the picked up readings on the serial port.

20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
10;version;
20;01;VER=1.1;REV=48;BUILD=04;
10;status;
20;02;STATUS;setRF433=ON;setNodoNRF=OFF;setMilight=OFF;setLivingColors=OFF;setAnsluta=OFF;setGPIO=OFF;setBLE=OFF;setMysensors=OFF;
2020-03-12 22:43:15 - 20;03;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
2020-03-12 22:43:25 - 20;04;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:43:28 - 20;05;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:43:35 - 20;06;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:44:03 - 20;07;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
2020-03-12 22:44:08 - 20;08;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:44:11 - 20;09;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:44:18 - 20;0A;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:44:51 - 20;0B;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
20;0C;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:44:54 - 20;0D;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:45:01 - 20;0E;Drayton;ID=d290;SWITCH=18;CMD=OFF;
20;0F;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:45:34 - 20;10;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:45:37 - 20;11;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:45:39 - 20;12;AlectoV3;ID=30b7;TEMP=80b8;HUM=38;BAT=OK;
2020-03-12 22:45:44 - 20;13;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:46:17 - 20;14;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:46:20 - 20;15;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:46:27 - 20;16;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:47:00 - 20;17;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:47:03 - 20;18;Cresta;ID=2801;TEMP=00cb;HUM=57;BAT=OK;
2020-03-12 22:47:10 - 20;19;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:47:15 - 20;1A;AlectoV3;ID=30b7;TEMP=80b8;HUM=38;BAT=OK;
2020-03-12 22:47:43 - 20;1B;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:47:46 - 20;1C;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:47:53 - 20;1D;Cresta;ID=3901;TEMP=00bc;HUM=64;BAT=OK;
20;1E;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
2020-03-12 22:48:03 - 20;1F;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
2020-03-12 22:48:26 - 20;20;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
2020-03-12 22:48:29 - 20;21;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
2020-03-12 22:48:36 - 20;22;Cresta;ID=3901;TEMP=00bc;HUM=64;BAT=OK;


But when I use RFLink + nodeMCU I get the following. (using same physical location)
As you can see there are five! sensor readings in ~45min! For sensorID=2101 there are 30min between two readings.
So the majority of readings and other sensors are not reported at all.
Specfically sensorID=2101 comes every ~40sec

I expected the same number of sensor readings using RFLink + nodeMCU.
Why are these not picked up by the RFLink+nodeMCU combo?
Any ideas? How can I debug?
v2_80MHz_nodeMCU_3.JPG
v2_80MHz_nodeMCU_3.JPG (214.02 KiB) Viewed 2552 times

User avatar
Stuntteam
Site Beheer
Posts: 637
Joined: 27 Jan 2016, 16:46

Re: RFLink with NodeMCU, readings are not sent on wifi

#8 Post by Stuntteam » 13 Mar 2020, 00:48

Perhaps a lot of resets..?
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#9 Post by seb82 » 13 Mar 2020, 14:14

Stuntteam wrote:
13 Mar 2020, 00:48
Perhaps a lot of resets..?
This is likely. Indeed, the firmware sends two commands to RFLink at startup : 10;ping; and 10;version;

Code: Select all

rflinkSerialTX.println(F("10;ping;"));                       	// Do a PING on startup
delay(100);
rflinkSerialTX.println(F("10;version;"));                   	// Ask version to RFLink
Did you wire the reset pin from the ESP to RFLink reset pin ?
You can change it with MEGA_RESET_PIN in config.h.

Also, what power supply are you using ? Indeed, an ESP use quite some power and maybe if affects the RFLInk.

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#10 Post by seb82 » 13 Mar 2020, 14:25

In fact, it looks like the ESP is resetting, not the RFLInk as it does not start back at zero (hex number after 20;).

My suggestion is to disconnect the RFLink and connect the ESP with USB. Then with the serial monitor, try to send commands from the computer to ESP that are similar to what RFLink sends and see how it reacts. Enabling SERIAL_DEBUG in config.h will bring more information.

User avatar
Stuntteam
Site Beheer
Posts: 637
Joined: 27 Jan 2016, 16:46

Re: RFLink with NodeMCU, readings are not sent on wifi

#11 Post by Stuntteam » 13 Mar 2020, 17:26

seb82 wrote:
13 Mar 2020, 14:14
Stuntteam wrote:
13 Mar 2020, 00:48
Perhaps a lot of resets..?
This is likely. Indeed, the firmware sends two commands to RFLink at startup : 10;ping; and 10;version;

Code: Select all

rflinkSerialTX.println(F("10;ping;"));                       	// Do a PING on startup
delay(100);
rflinkSerialTX.println(F("10;version;"));                   	// Ask version to RFLink
After booting up you should be fine with just looking at:
20;00;Nodo RadioFrequencyLink - RFLink Gateway V1.1 - R48;
The ping command you only need to send to RFlink IF there has not been any communication from RFLink's side for <timeout> seconds where you probably stick to 30 seconds.. In case of timeout send ping and check for pong as a sign of RFlink still running but not having any RF communication.
In all other cases, make sure you do not send unneccesary commands like ping/version etc. to RFLink
-=# RFLink Gateway Development Team #=-
Introduction: http://www.nemcon.nl/blog2/
Generic Support forum: http://www.esp8266.nu/forum/viewforum.php?f=8

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#12 Post by 955 » 14 Mar 2020, 12:35

Thanks for suggestion on how to debug and proceed.
I am not fully aware on how how to carry out these steps but it is a great opportunity to learn. I usually will work it out after some time.

I thought of insufficient powersupply might be the issue so to rule that out, I use 5V/2.3A usb plug which I connect to the RFLink USB port.
I reckon RFlink should provide nodeMCU with sufficient power as this is how the RFLink/nodeMCU kit it is designed. Don't you think?

What will enabling Serial Debug in espRFLinkMQTT give me?
Any additional and useful info?

Stay tuned and thanks for your support!

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#13 Post by seb82 » 14 Mar 2020, 13:57

Forget RFLink wifi kit for now. Just connect your computer straight to the NodeMCU micro USB alone. Then you open Arduino IDE Serial Monitor and try to send some commands as if you were the RFLink (lots of examples in the protocol reference). Idea is to check whether this is stable or not alone. You can open the web interface in parallel as a second step.

Uncommenting "#define SERIAL_DEBUG" will provide lots of information in the serial monitor. And it should help identify why it reboots.

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#14 Post by 955 » 15 Mar 2020, 00:28

Dead stable!

I posted the strings that I received from RFLink only to the serial monitor. Works like a charm and dead stable.
This is full transcript from serial monitor after reboot and showing what I sent:

Code: Select all

00:05:38.471 -> Rebooting device...
00:05:38.958 -> Not connected, retrying in 1s
00:05:39.059 -> I guess this is my password.
00:05:40.144 -> Init rflink serial done
00:05:40.144 -> Connecting to Stenstrom24G ...
00:05:41.141 -> 1 2 3 
00:05:43.166 -> 
00:05:43.166 -> WiFi connected
00:05:43.166 -> IP address:	 192.168.1.214
00:05:43.166 -> MQTT connection state : 0
00:05:43.166 -> Ready for OTA on IP address:	192.168.1.214
00:05:43.200 -> HTTPUpdateServer ready
00:05:43.200 -> HTTP server started
00:05:43.200 -> 
00:05:43.267 -> 10;ping;
00:05:43.383 -> 10;version;
00:05:43.383 -> Uptime : 0 min
00:06:02.978 -> Enabling MQTT debug...
00:06:34.218 -> 
00:06:34.218 -> === RFLink packet ===
00:06:34.218 -> Raw data = 20;03;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
00:06:34.253 -> MQTT topic = rflink/FineOffset-00b7/ => {"TEMP":21.6,"HUM":38}
00:06:34.253 -> 
00:06:34.253 -> 
00:06:59.233 -> 
00:06:59.233 -> === RFLink packet ===
00:06:59.233 -> Raw data = 20;04;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK;
00:06:59.268 -> MQTT topic = rflink/Cresta-2101/ => {"TEMP":22.0,"HUM":40,"BAT":"OK"}
00:06:59.268 -> 
00:06:59.268 -> 
00:07:14.173 -> 
00:07:14.173 -> === RFLink packet ===
00:07:14.173 -> Raw data = 20;05;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK;
00:07:14.173 -> MQTT topic = rflink/Cresta-2801/ => {"TEMP":20.2,"HUM":57,"BAT":"OK"}
00:07:14.173 -> 
00:07:14.173 -> 
00:07:26.223 -> 
00:07:26.223 -> === RFLink packet ===
00:07:26.258 -> Raw data = 20;06;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK;
00:07:26.258 -> MQTT topic = rflink/Cresta-2F01/ => {"TEMP":21.4,"HUM":39,"BAT":"OK"}
00:07:26.258 -> 
00:07:26.258 -> 
00:07:43.182 -> 
00:07:43.182 -> === RFLink packet ===
00:07:43.182 -> Raw data = 20;07;FineOffset;ID=00b7;TEMP=00d8;HUM=38;
00:07:43.182 -> MQTT topic = rflink/FineOffset-00b7/ => {"TEMP":21.6,"HUM":38}
00:07:43.216 -> 
00:07:43.216 -> 
00:07:52.390 -> 
00:07:52.390 -> === RFLink packet ===
00:07:52.390 -> Raw data = 20;08;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK; 
00:07:52.390 -> MQTT topic = rflink/Cresta-2101/ => {"TEMP":22.0,"HUM":40,"BAT":"OK"}
00:07:52.425 -> 
00:07:52.425 -> 
00:08:07.564 -> 
00:08:07.564 -> === RFLink packet ===
00:08:07.564 -> Raw data = 20;09;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK; 
00:08:07.564 -> MQTT topic = rflink/Cresta-2801/ => {"TEMP":20.2,"HUM":57,"BAT":"OK"}
00:08:07.564 -> 
00:08:07.564 -> 
00:08:19.831 -> 
00:08:19.831 -> === RFLink packet ===
00:08:19.831 -> Raw data = 20;0A;Cresta;ID=2F01;TEMP=00d6;HUM=39;BAT=OK; 
00:08:19.864 -> MQTT topic = rflink/Cresta-2F01/ => {"TEMP":21.4,"HUM":39,"BAT":"OK"}
00:08:19.864 -> 
00:08:19.864 -> 
00:08:28.999 -> 
00:08:28.999 -> === RFLink packet ===
00:08:28.999 -> Raw data = 20;0B;FineOffset;ID=00b7;TEMP=00d8;HUM=38; 
00:08:29.034 -> MQTT topic = rflink/FineOffset-00b7/ => {"TEMP":21.6,"HUM":38}
00:08:29.034 -> 
00:08:29.034 -> 
00:08:40.323 -> 
00:08:40.323 -> === RFLink packet ===
00:08:40.323 -> Raw data = 20;0D;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK; 
00:08:40.323 -> MQTT topic = rflink/Cresta-2801/ => {"TEMP":20.2,"HUM":57,"BAT":"OK"}
00:08:40.357 -> 
00:08:40.357 -> 
00:08:50.757 -> 
00:08:50.757 -> === RFLink packet ===
00:08:50.757 -> Raw data = 20;0E;Drayton;ID=d290;SWITCH=18;CMD=OFF; 
00:08:50.757 -> MQTT topic = rflink/Drayton-d290/ => {"SWITCH":"18","CMD":"OFF","SWITCH18":"OFF"}
00:08:50.791 -> 
00:08:50.791 -> 
00:09:00.292 -> 
00:09:00.292 -> === RFLink packet ===
00:09:00.292 -> Raw data = 20;10;Cresta;ID=2101;TEMP=00dc;HUM=40;BAT=OK; 
00:09:00.326 -> MQTT topic = rflink/Cresta-2101/ => {"TEMP":22.0,"HUM":40,"BAT":"OK"}
00:09:00.326 -> 
00:09:00.326 -> 
00:09:12.082 -> 
00:09:12.082 -> === RFLink packet ===
00:09:12.082 -> Raw data = 20;11;Cresta;ID=2801;TEMP=00ca;HUM=57;BAT=OK; 
00:09:12.082 -> MQTT topic = rflink/Cresta-2801/ => {"TEMP":20.2,"HUM":57,"BAT":"OK"}
00:09:12.082 -> 
00:09:12.082 -> 
00:09:25.887 -> 
00:09:25.887 -> === RFLink packet ===
00:09:25.887 -> Raw data = 20;12;AlectoV3;ID=30b7;TEMP=80b8;HUM=38;BAT=OK; 
00:09:25.921 -> MQTT topic = rflink/AlectoV3-30b7/ => {"TEMP":-18.4,"HUM":38,"BAT":"OK"}
00:09:25.921 -> 
00:09:25.921 -> 
00:10:43.380 -> Uptime : 5 min
And this is what I saw in webinterface:
v2_80MHz_nodeMCU_only_noRFLink_1.JPG
v2_80MHz_nodeMCU_only_noRFLink_1.JPG (141.67 KiB) Viewed 2304 times
So nodeMCU seems to work flawless. That is good. :-)
Question is why nodeMCU is reset so often.

Any ideas what to look for now?
Could it be that the reset happens at every reception of a 433MHz message? From a message frequence point of view it makes sense.

seb82
Normal user
Posts: 31
Joined: 05 Sep 2018, 10:56

Re: RFLink with NodeMCU, readings are not sent on wifi

#15 Post by seb82 » 15 Mar 2020, 17:36

Well, it is difficult to help you here.

Some ideas :
- Comment the lines mentionned above that send a ping and version command on startup and see whether it helps (you can try to ping continously the ESP or look at running time on web interface).
- Remove antenna so that nothing gets to the RFLink. Check whether NodeMCU resets. Then send a 433 MHz signal.
- Try another firmware for the RFLink Wifi Gateway.
- Try direct connection from RFLInk RX/TX to TX/RX of the NodeMCU (ie without the RFLink Wifi gateway). Be aware that they are different voltage 5V / 3.3V so there is a risk for the NodeMCU (you are supposed to use a Logic Level Converer though I have done it many times with esp8266). Make sure there is only one power supply and a common ground.

Good luck and let us know.

955
Normal user
Posts: 7
Joined: 25 Feb 2020, 08:04

Re: RFLink with NodeMCU, readings are not sent on wifi

#16 Post by 955 » 15 Mar 2020, 22:24

Thanks for your ideas and support!

I was thinking to check some voltages on the wifi gateway first.
Secondly to have the nodeMCU on a breadboard and provide RX/TX from RFLink as you suggest on your last bullet.
As both the nodeMCU and RFLink seems to work standalone I will focus on the interface between them.

I will probably do the other bullets as well.

I will surely keep you updated, there is not so much spare time this week though.
Sad, as it now starts to get interesting. :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests