BUG in MAXIMET station in WaspSensorXtr.cpp

Questions about the Waspmote v15 and its modules
Post Reply
jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

BUG in MAXIMET station in WaspSensorXtr.cpp

Post by jot4p » Thu Nov 21, 2019 4:44 pm

Hi Libelium,

You use this method to convert maximet strings to objects:

const char string_26[] PROGMEM = "%c %d %s %d %d %s %d %s %d %s %s %s %s %d %s %s %s %d %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %d %s %d %s %s";

and add the values to the object like this: gmx.windChill = atof (windChill_local);

But You have a problem... sometimes the maximet sensor (for example 550) don't send values.. like "windChill" because and after this parameter all is wrong..

If you check the manual:
Note: Wind Chill is only reported when the temperature is below 10°C and the wind speed is at least
1.5m/s.
.. in my case I don't have wind.

Example:
WS RX:Q 013 000.03 128 000 000.00 000 000.00 090 0100 0992.7 0992.7 0992.7 046 +024.9 +012.7 10.74 00000.000 000.000 N 115 +026 1.2 +017.4 07:27 11:46 16:05 228:+05 16:42 17:23 18:03 -81 +00 +1 2019-11-21T15:14:40.2 +11.8 0000

if you check .. wind chill is not present..
"N 115 HERE +026 1.2"

You need to parse values like arrays... and if value is not present put some "n/d" or "-", because now

Can you adjust your WASPSensorXTR.cpp ?

jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by jot4p » Thu Nov 21, 2019 4:50 pm

jot4p wrote:
Thu Nov 21, 2019 4:44 pm
Hi Libelium,

You use this method to convert maximet strings to objects:

const char string_26[] PROGMEM = "%c %d %s %d %d %s %d %s %d %s %s %s %s %d %s %s %s %d %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %d %s %d %s %s";

and add the values to the object like this: gmx.windChill = atof (windChill_local);

But You have a problem... sometimes the maximet sensor (for example 550) don't send values.. like "windChill" and after this parameter all is wrong..

If you check the manual:
Note: Wind Chill is only reported when the temperature is below 10°C and the wind speed is at least
1.5m/s.
.. in my case I don't have wind.

Example:
WS RX:Q 013 000.03 128 000 000.00 000 000.00 090 0100 0992.7 0992.7 0992.7 046 +024.9 +012.7 10.74 00000.000 000.000 N 115 +026 1.2 +017.4 07:27 11:46 16:05 228:+05 16:42 17:23 18:03 -81 +00 +1 2019-11-21T15:14:40.2 +11.8 0000

if you check .. wind chill is not present..
"N 115 HERE +026 1.2"

You need to parse values like arrays... and if value is not present put some "n/d" or "-"...

Can you adjust your WASPSensorXTR.cpp ?

jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by jot4p » Thu Nov 21, 2019 9:44 pm

To repair this I use:

Utils.setMuxAux2();
beginSerial(19200, 1);
serialFlush(1);
delay(5);

to change use the string directly from the maximet station.. but after that I receive

".4G module not started
Error code: 1
"
Why ? How I can select againd the correct connection for 4G modem ?

jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by jot4p » Fri Nov 22, 2019 12:27 pm

OK..

solved..

while ((cur = strsep(&buffer_clone, " ")) != NULL)

Now I have the correct code:

ORIGINAL:
Q 078 000.02 321 000 000.00 000 000.00 000 0100 0978.3 0978.3 0978.3 051 +023.9 +013.2 11.12 00000.000 000.000 N 243 +025 1.1 +017.2 07:28 11:46 16:04 171:+18 16:41 17:23 18:02 +06 -32 +1 2019-11-22T11:11:43.5 +11.8 0000

TRANSFORMED:
Q 078 000.02 321 000 000.00 000 000.00 000 0100 0978.3 0978.3 0978.3 051 +023.9 +013.2 11.12 00000.000 000.000 N 243 +025 1.1 +017.2 07:28 11:46 16:04 171:+18 16:41 17:23 18:02 +06 -32 +1 2019-11-22T11:11:43.5 +11.8 0000

PARSER:
%c %d %s %d %d %s %d %s %d %s %s %s %s %d %s %s %s %s %s %c %d %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by libelium-dev » Fri Nov 22, 2019 1:19 pm

Hi,

What API version are you using? Could you please try with the last one? We fixed a similar problem in the last API version.

The problem with the 4G module occurs due to both devices uses the UART1 and it's necessary to manage it properly. Please test the last API and let us know if the problem is solved.

Regards

jot4p
Posts: 192
Joined: Thu Apr 21, 2016 5:19 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by jot4p » Mon Nov 25, 2019 4:38 pm

Ok.

You add 0 if you detect ",," but 0 can be 1 real value.. and this is not correct...

//if ',,' situation occurs, avoid with a zero -> ',0,'
if(buffer_ws_raw[i-1] == ' ')
{
buffer_ws_raw = '0';
i++;
}
buffer_ws_raw = ' ';

In my solution I add ", - ," and after that return -1000.. because it's different 0 (null) or 0 (real ºc value) .....

libelium-dev
Posts: 27967
Joined: Mon Sep 28, 2009 1:06 pm

Re: BUG in MAXIMET station in WaspSensorXtr.cpp

Post by libelium-dev » Tue Nov 26, 2019 9:29 am

Hi,

Thank you for your advice we will consider it for the next API release.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest