invandy / Oregon_NR

Arduino library for Oregon Scientific and Explore Scientific wireless sensors decode and simulate
Other
31 stars 21 forks source link

Timing issue or what else? #24

Open bibo750four opened 7 months ago

bibo750four commented 7 months ago

Hello,

Do you have any clue about this problem:

-If I transmit temp/humidity to my RMR203HG and RMR391PA units using the Transmitter.ino example using THGN132N emulation using an Arduino Uno Ethernet, all is good and both units get the data.

-If I use the same transmission code in the following sketch, the RMR391PA still reads the temperature but the RMR203HG never gets a connection.

Is it a timing issue, due to the additional code? Or what else could it be? For your information, my Arduino Uno ethernet is quite old and has a low reset value for millis().

https://gist.github.com/bibo750four/d6c2acdc8e6cf193c39e147a7f39bf5b#file-oregon_sensor_emulator_arduinojson6-ino

bibo750four commented 7 months ago

Shoud I try to lower the send_time below 39000?

bibo750four commented 7 months ago

I tried to reduce the send_time to 38650 because on serial monitor I observed that the average time between transmissions was 39350ms (with some variation in the range of 20-30ms). However, this did not bring any difference. One device is still reading but the other is not.

invandy commented 7 months ago

Lets try to replace time_marker_send = millis() + send_time; with time_marker_send += send_time; in Oregon_TM.cpp

bibo750four commented 7 months ago

Hello, Thanks a lot for the suggestion. I tried the change in the Oregon_TM.cpp but there is no improvement in the connection behavior: one device still connects, while the other does not. If this information can be useful: in a previous version of my sketch, that was using ArduinoJson version 5 instead of version 6, both units were connecting, but one had frequent disconnections. With ArduinoJson6 things seem to get worse. Can it be some performance limits of my Arduino? But then what is it causing? The transmission itself is bad or just the timing between transmissions? Is it helpful to provide the output of serial monitor so you can see the timing between transmissions?

bibo750four commented 5 months ago

Hello, An update: I now used my sketch on an Arduino MKR Wifi 1010 and the transmission to my Oregon devices is fine. So, I guess I will not investigate the Arduino Uno Ethernet for this project anymore. Thanks for helping.