Hi everybody,
first to all I would like TANKS to
DeKay http://www.wxforum.net/index.php?action=profile;u=1954 for this
https://github.com/dekay/im-me/blob/master/pocketwx/src/protocol.txt.
UV radiationMessage 4:
Here are readings for UV and readings from console.
40 00 00 FF C5 00 4C D2 -- Off (unplugged sensor)
40 00 00 00 45 00 98 29 -- 0
40 00 00 0B C5 00 73 40 -- 0.9
40 00 00 0B 05 00 65 14 -- 0.9
40 00 00 11 05 00 E1 B6 -- 1.3
40 00 00 12 85 00 A3 7E -- 1.5
40 00 00 12 45 00 B5 2A -- 1.4
40 00 00 11 45 00 EC 7A -- 1.4
40 00 00 11 C5 00 F7 E2 -- 1.4
40 00 00 0F 45 00 B4 18 -- 1.2
40 00 00 0D C5 00 C1 E0 -- 1.1
40 00 00 09 45 00 06 B8 -- 0.7
40 00 00 19 05 00 48 17 -- 2.0
Byte 3 and 4 are solar radiation (the first byte is MSB and the second LSB), but you can notice that lower nibble of 4th byte is always 5, so they use only 3 nibbles!
And here is the equation:
UVI = ((VALUE>>4)-4)/200 rounded on first decimal place. Why -4? Because 0 is 0x45>>4 = 0x4 = 4
e.g. 40 00 00 11 45 00 EC 7A
0x1145>>4 = 0x114 = 276
(276-4)/200= 1.36 rounded on one decimal place = 1.4
Solar radiationMeesage:6
60 00 00 FF C5 00 11 82 -- Off (unplugged)
60 00 00 00 45 00 AD 21 -- 0
60 00 00 00 85 00 BB 75 -- 2
60 00 00 01 05 00 97 DD -- 7
60 00 00 01 85 00 8C 45 -- 11
60 00 00 01 C5 00 81 89 -- 11
60 00 00 02 45 00 C3 41 -- 16
60 00 00 05 85 00 50 85 -- 39
60 00 00 06 C5 00 04 19 -- 47
60 00 00 08 45 00 04 80 -- 58
60 00 00 08 C5 00 1F 18 -- 74
60 00 00 15 C5 00 1E 2A -- 153
60 00 00 16 45 00 5C E2 -- 156
60 00 00 17 45 00 6B D2 -- 163
60 00 00 17 C5 00 70 4A -- 167
60 00 00 18 C5 00 5C 7B -- 176
60 00 00 1C C5 00 80 BB -- 202
60 00 00 1E 45 00 F5 43 -- 218
60 00 00 1D 85 00 BA 47 -- 221
60 00 00 25 05 00 CD DB -- 260
60 00 00 43 C5 00 F2 44 -- 478
60 00 00 48 45 00 19 2D -- 513
60 00 00 48 C5 00 02 B5 -- 513
60 00 00 56 85 00 57 1B -- 610
60 00 00 6E 85 00 3B 1F -- 782
60 00 00 72 45 00 1B 49 -- 810
60 00 00 74 05 00 A4 25 -- 816
60 00 00 75 45 00 9E D9 -- 830
60 00 00 79 45 00 EB B8 -- 847
60 00 00 78 05 00 D1 44 -- 847
60 00 00 8E 05 00 80 B6 -- 986
60 00 00 FA 85 00 9F E6 -- 1761
Byte 3 and 4 are solar radiation. The first byte is MSB and the second LSB.
We can see that 0 is 0x45 and Off 0xffc5 and all data ends with 5, so the story is similar...
Thay says that readings are in range 0-1800. I had reading for 1761 and for 39 so 1761+39 = 1800 or 0xfa8+0x58 = 0x1000 Zero is starting from 0x4 so 0x1000 - 0x4 = 0xffc. Hmmmm I already saw that value!!! 0xFFC5 - sensor unplugged! And because we have two values we need 0x1000 - 0x8 = 0xff8.
So, probably max value of 1800 is 0xFF85. 0xFF8 or 4088 devided by 1800 is 2.27
w/m2 = round(((VALUE>>4)-4)/2.27) So let's check that silly 2.27!
Using Matlab, I plotted those values
val=[4,16,28,36,88,108,132,348,356,372,380,396,460,592,1084,1164,1384,1768,1828,1856,1876,1920,4008]; - (VALUE>>4)
res=[0,7,11,16,39,47,58,153,156,163,167,176,202,260,478,513,610,782,810,816,830,847,1761];
The result was (almost) straight line!
Than I used polyfit to find the best fitted line with this one.
[P,S] = polyfit(res,val,1)
P =
2.2704 -0.2488
S =
R: [2x2 double]
df: 22
normr: 20.5292
So, Matlab says that I need to multiply values with 2.27 and to subtract 0.2488.
Than I plotted just this w = round(((VALUE>>4)-4)/2.27) and lines were almost perfectly fitted! Why almost?? Ok this is maybe little bit confusing...
I have VP2 Pro Wi-Fi, and I bought just cabled IIS without any sensor, and R485 to USB converter.
I found on this forum that they talk at 4800/8/n/1, and I start to get same data as Dekay.
Because I didn’t had cabled console to read real data, I done this:
Using RJ11 splitter I sent readings from sensors to both IIS. The bad thing was that I couldn’t manage to turn them on at the same time, so I had few seconds delay between readings on wifi console and PC. Because of that , I have some outliers and/or bad readings.
So, if someone have cabled IIS and cabled console, please use Rj11 splitter + RS485toUSB and read data simultaneously and check is this formula valid or not, or share your readings in this topic.
And once again, THANK YOU DeKay!!!