|
Post by Kohala Jim on Jan 12, 2021 19:38:01 GMT -8
Per my topic, I've come into possession of a Weather Rack 2 system and I'm attempting to make this sketch run on a Wemos D1 mini. My goal is to package the Weather Rack 2 payload up into an MQTT JSON object for consumption
I have a RXB6 433MHz Superhet Rx module connected and powered up.
I mapped the data pin to D0 in the class .h file: #define RX_IN_PIN D0
I've also #undef'd the logic analyzer (WRLOGIC) to avoid Arduino pin mode conflicts: #undef WRLOGIC
Lastly, I'm instantiating the weatherRack2 class without the T/H sensor: weatherRack2 = SDL_Arduino_WeatherRack2(600, true, false);
The sketch compiles and runs but is stuck in a proverbial watchdog reset operation about every 3 seconds... Here's the debug dump:
Soft WDT reset
>>>stack>>>
ctx: cont
sp: 3ffffda0 end: 3fffffc0 offset: 01a0
3fffff40: 3ffe87b6 feefeffe feefeffe 00000000
3fffff50: 3ffe84d0 3ffee570 00000000 40201978
3fffff60: 00092803 00000001 3ffe8820 40202279
3fffff70: 3fffdad0 0000000c 3ffee614 3ffee67c
3fffff80: 3fffdad0 3ffee570 3ffee614 40201b30
3fffff90: feefeffe 00000000 3ffee614 40201d20
3fffffa0: 3fffdad0 00000000 3ffee63c 40202d74
3fffffb0: feefeffe feefeffe 3ffe84f0 40100bd1
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld
-----------
SwitchDoc Labs
Arduino WeatherRack2 and Indoor T/H Test
-----------
------------
Any clues or tips appreciated as I'm delving into a void of unknowns here with this endeavor Thanks in advance
KJ
|
|
|
Post by Kohala Jim on Jan 13, 2021 17:32:53 GMT -8
So, I get to answer my own tech post...
I did some web scrapes to determine how/why there was a watchdog operation going on when there's no code in the sketch. A few key hits later in the Arduino forum there were some comments that described the underpinnings of the ESP8266 operations. Specifically, blocking loops needed to service the watchdog operations.
Per the suggested advice, I added this to the .returnMessageValues() class method in the primary while{} blocker:
while (noErrors && (nosBytes < maxBytes))
{
microLengthofPulse = micros();
boolean clearOnce = true;
boolean NotFoundTran = true;
while (NotFoundTran)
{
yield();
if (digitalRead(RxPin) != tempBit)
NotFoundTran = true;
Now it's running!
------------
MESSAGE_WEATHERRACK2_GOOD
currentWR2.messageid=19
currentWR2.time=
currentWR2.device=12
currentWR2.modelnumber=0
weatherRack2.currentWR2.battery=0
currentWR2.avewindspeed=0.00
currentWR2.gustwindspeed=0.00
currentWR2.winddirection=174
currentWR2.cumulativerain=57
currentWR2.temperature=23.72
currentWR2.humidity=24
currentWR2.light=69627
currentWR2.uv=251
currentWR2.CRC=0x20
Headers Found=115
WeatherRack2 Sensors Found=19
Indoor T/H Found=0
------------
Hopefully anyone else looking to port this over to a D1 mini will find this useful. Now I'll wedge in the MQTT support in able to log the Weather Rack 2 data into Grafana and InfluxDB
|
|
|
Post by SDL on Jan 14, 2021 8:42:13 GMT -8
|
|
|
Post by Kohala Jim on Feb 3, 2021 9:25:03 GMT -8
I used the Arduino sketch to start off with... Haven't explored the ESP32 flavor, so likely this has compensation for Espressif silicon. One other oddity after getting this operational is I don't think I have the exact Station Rack? The unit came with a local display that's also surfacing barometric pressure.
|
|
|
Post by SDL on Feb 3, 2021 9:40:12 GMT -8
Hmm. could you tell me where you got that unit? No problem, just curious about the display. Some of our early units we worked with came with a display.
I'm a little amazed that our software worked, but quite pleased!
BP
|
|
|
Post by Kohala Jim on Feb 3, 2021 10:20:44 GMT -8
Acquired this at a local garage sale... the accompanying user reference cites the Sainlogic WS-0835
|
|
|
Post by SDL on Feb 3, 2021 12:45:31 GMT -8
Thanks! That is a compatible model with our software. Same bulk manufacturer, but an earlier model. Looks like they don't make those anymore but used the same protocol.
Interesting!
BP
|
|
|
Post by Kohala Jim on Feb 3, 2021 13:08:07 GMT -8
Thanks! That is a compatible model with our software. Same bulk manufacturer, but an earlier model. Looks like they don't make those anymore but used the same protocol. Interesting! BP Yes, I used Google Image search and found your WR2 unit that matches this one. Although it has Baro data, I'm convinced it's local to the HMI display as there's nothing in the payload. I'm also dubious of the Vis & UV level data since they don't appears to fluctuate at all. Your specs list a 0-15 UV index and visible lux of 0 to 200 klux (which is declared as uint-16 in the Arduino class). The unit has no apparent aperture where you're unit is shown to have this sensor. Here's the MQTT payloads that surface:tele/a8ea54/VLLEVL 69627 tele/a8ea54/UVLEVL 251Awesome work on the class object... it works nicely despite the high noise floor here in my office. KJ
|
|
|
Post by SDL on Feb 4, 2021 16:04:36 GMT -8
Ours seems to work fine. Not sure what is going with your unit. They may look the same outside, but that doesn't mean the firmware version is the same. I'm not even sure how to check except by looking at the raw output. Here is a chart coming from the WR2. BP
|
|