It is for those who are trying to troubleshoot issues by decyphering Geofencing IO parameter when the customer sends raw packets and complaining regarding some issues with Geofencing.
Geofencing IO parameter deciphering/parsing.
In order to parse the IO ID 151 "Geofencing" follow the following Steps:
1. You need to get the IO 151 value, convert it to binary and count the bytes.
Generally, it would look like this:
For example our 151 IO received value is 17825793.
After we convert it to binary, we get the following number:
1000100000000000000000001
It has 24 bits, starting from 0, so total 25 characters, starting from the right.
Bit 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Bit nr.24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Here, You can use online converter to help You convert the values to binary https://www.asciitohex.com/
2. Now once you have that, you can follow this table below to get the geofencing data:
Bit Description
0 Geozone status. Inside geozone – 1, outside geozone – 0
1 Entering geozone event. 1 – only when event occurs, 0 – the rest of time
2 Leaving geozone event. 1 – only when event occurs, 0 – the rest of time
3 DIN1 LOW event. 1 – only when event occurs, 0 – the rest of time
4 DIN2 LOW event. 1 – only when event occurs, 0 – the rest of time
5 DIN3 LOW event. 1 – only when event occurs, 0 – the rest of time
6 DIN4 LOW event. 1 – only when event occurs, 0 – the rest of time
7 DIN1 HIGH event. 1 – only when event occurs, 0 – the rest of time
8 DIN2 HIGH event. 1 – only when event occurs, 0 – the rest of time
9 DIN3 HIGH event. 1 – only when event occurs, 0 – the rest of time
10 DIN4 HIGH event. 1 – only when event occurs, 0 – the rest of time
11 AIN1 event. 1 – only when event occurs, 0 – the rest of time
12 AIN2 event. 1 – only when event occurs, 0 – the rest of time
13 Speed event. 1 – only when event occurs, 0 – the rest of time
14 Geozone data unreliable. 1 – when event occurs, 0 – the rest of time
[15..19] Reserved
[20..23] Geozone group ID
[24..31] Geozone ID
- So in the abvoe example you can see that this IO was triggered by:
Inside of geozone 1, of geozone group 1.
For other geozone and geozone numbers, we would need to take bits 20-23 and convert back to decimal, For example group 8 would be: 1000
Same for geozone number, for example geozone number 63 would have bits 24-31: 00111111