Hexa data decoding

Post Reply
teschnergergely
Posts: 5
Joined: Tue Jul 02, 2019 9:18 am
Company: Széchenyi István Uni

Hexa data decoding

Post by teschnergergely » Tue Jul 02, 2019 9:51 am

HI,

We are currently testing our first Plug & Sense Agriculture Xtreme. We have managed to receive data in the form of HEX, is there a way to convert this to ASCII text. I have been referring to the Data Frame document but struggling to work out what a HEX translation

These are two data bursts received.
{"cmd":"rx","seqno":124,"EUI":"0004A30B0024928B","ts":1562015734796,"fcnt":44,"port":3,"freq":867700000,"rssi":-96,"snr":12.2,"toa":410,"dr":"SF9 BW125 4/5","ack":false,"bat":255,"data":"1936345700295cb7410200a183420376e8c3470ce0feb73e94703dca409800001c429c3333c741894f8dbf418d3333bb4191d1225442"}
{"cmd":"gw","seqno":124,"EUI":"0004A30B0024928B","ts":1562015734796,"fcnt":44,"port":3,"freq":867700000,"toa":410,"dr":"SF9 BW125 4/5","ack":false,"gws":[{"rssi":-96,"snr":12.2,"ts":1562015734796,"time":"2019-07-01T21:15:34.778140322Z","gweui":"024B0BFFFF03117A","lat":47.8637956,"lon":17.2532867}],"bat":255,"data":"1936345700295cb7410200a183420376e8c3470ce0feb73e94703dca409800001c429c3333c741894f8dbf418d3333bb4191d1225442"}

Our Config file
Plug and Sense!: Smart Agriculture Xtreme

Sensors:
Socket A: Temperature, air humidity and pressure
Socket B: Leaf wetness Phytos 31
Socket C: Conductivity, water content and soil temperature GS3
Socket D: Soil oxygen level
Socket E: none
Socket F: none

Industrial protocol: none

GPS: none

Sleep time: 900 seconds

Serial ID: 3250BC32C8913E63

Node name: none

Critical battery warning: ON
Battery threshold 1: 50 %
Battery threshold 2: 30 %
Battery threshold 3: 10 %


Watchdog configuration: ON
Watchdog period: 60 minutes => This means every 60 minutes the node will be rebooted to avoid possible stuck states.


Communication module: LoRaWAN
region: 0
adr: on
sending_mode: unconfirmed
port: 3
protocol: otaa
dev_eui: 0004A30B0024928B
app_eui: 0004A30B0024928B
app_key: AAAAAAAAAAAAAAAAAAAAAA0123456789


Sensor data will be sent according to the following format:
LoRaWAN EU or LoRaWAN IN:

This communication protocol uses the Tiny Frame format
Data rate 0:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5]
Tiny Frame 2: | counter[1] | length[1] | | tc2 [5] | mv2 [5]


Data rate 1:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5]
Tiny Frame 2: | counter[1] | length[1] | | tc2 [5] | mv2 [5]


Data rate 2:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5]
Tiny Frame 2: | counter[1] | length[1] | | tc2 [5] | mv2 [5]


Data rate 3:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5] | tc2 [5] | mv2 [5]


Data rate 4:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5] | tc2 [5] | mv2 [5]


Data rate 5:
Tiny Frame 1: | counter[1] | length[1] | | tc [5] | tf [5] | hum [5] | pres [5] | lw [5] | dp1 [5] | ec1 [5] | tc3 [5] | co [5] | tc2 [5] | mv2 [5]

Could you help to the ASCII conversation?

Many Thanks

teschnergergely
Posts: 5
Joined: Tue Jul 02, 2019 9:18 am
Company: Széchenyi István Uni

Re: Hexa data decoding

Post by teschnergergely » Tue Jul 02, 2019 3:50 pm

19 25 counter
36 54 length
34 52 Sensor ID for battery level. That value will be an uint8_t
57 87 % battery level

00 295cb741 22.92 TC
02 00a18342 65.81445 HUM
03 76e8c347 100304.922 PRES
0c e0feb73e 0.359366417 LW
94 703dca40 6.31999969 DP1_C
98 00001c42 39 SOIL3???????? uS/m????? Not amoungst agriculture Xtreme sensor. Sensor ID 152.
9c 3333c741 24.9 TC3_C
89 4f8dbf41 23.9439983 CO_D
8d 3333bb41 23.4 TC2_D
91 d1225442 53.034 MV2_D

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

Re: Hexa data decoding

Post by libelium-dev » Wed Jul 03, 2019 8:38 am

Hi,

Your conversion seems correct.

Yes, the 152 ID correspond to EC1_C, it is a float and the units are uS/m. The line is missing in the table we will fix it as soon as possible.

Regards

teschnergergely
Posts: 5
Joined: Tue Jul 02, 2019 9:18 am
Company: Széchenyi István Uni

Re: Hexa data decoding

Post by teschnergergely » Wed Jul 03, 2019 8:53 pm

Thanks!

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

Re: Hexa data decoding

Post by libelium-dev » Thu Jul 04, 2019 9:15 am

You're welcome!

teschnergergely
Posts: 5
Joined: Tue Jul 02, 2019 9:18 am
Company: Széchenyi István Uni

Re: Hexa data decoding

Post by teschnergergely » Tue Jul 23, 2019 7:03 pm

Hi,
I have some question.
What is exactly the unit of ID:148 sensor? This is in the table N/A.

Thanks!

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

Re: Hexa data decoding

Post by libelium-dev » Wed Jul 24, 2019 11:00 am

Hi,

The dielectric permittivity values are a dimensionless number.

Regards

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest