Osmand protocol drops digits on custom values

88bit23 days ago

Hi I have a custom value "BatV" for battery voltage, it is definitely going out correctly with 4.987 however when I look at it in the front end it shows me only one digit 4. How are columns formatted in the database? can I alter the table so as not to cause any issues?

Anton Tananaev23 days ago

Do you want to show the logs?

88bit23 days ago

Thank you Anton for getting back to me so quickly, I looked into the logs and they look clean.

curl -X POST "https://trackme.xxxxxxx/?id=a840xxxxxxxx&lat=-33.xxxxx&lon=151.xxxxx&timestamp=1738651816&altitude=211&gatewayId=ac1f09fffe057c8a&rssi=-45&dr=5&spreadingFactor=7&uuid=undefined&major=undefined&minor=undefined&wifissid=undefined&wifirssi=undefined&name=trackerd-ls-001&batV=4.002"

This is a LoRaWan tracker that can detect WiFi & BLE access points and beacons as additional tracking methods, hence the unusual values

2025-02-03 00:02:12  INFO: Event id: a840415c16596274, time: 2025-02-03 00:02:12, type: deviceOnline, notifications: 0
2025-02-03 00:02:12  INFO: [T05597349] id: a840415c16596274, time: 2025-02-03 00:02:11, lat: -33.6xxx, lon: 151.13xxxx, course: 0.0
2025-02-03 00:02:12  INFO: [T05597349: osmand > 10.10.10.37] 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2025-02-03 00:02:12  INFO: [T05597349] disconnected

I suspect, that when the column is first created it evaluates the input and sets it as float or integer. I had initially not formatted the number to keep the 3 digits behind the comma. Interestingly I created a new variable name, but it did not change. I have another device, that is showing one additional digit and that value was formatted correctly from the beginning. Some mentioned in the forum that using multiplication to overcome this problem. I think the next stop is looking into the table and checking on the column format.

Thank you in advance for your help

88bit23 days ago

Sorry I should had attached that, too
Screenshot from 2025-02-04 18-26-44.png

Anton Tananaev23 days ago

You skipped the most important part of the log - the raw data from your device.

88bit23 days ago

I would have assumed this Hex data is the raw data logged. Maybe I need a different log level?

2025-02-03 00:02:12  INFO: [T05597349: osmand > 10.10.10.37] 485454502f312e3120323030204f4b0d0a636f6e74656e742d6c656e6774683a20300d0a0d0a
2025-02-03 00:02:12  INFO: [T05597349] disconnected
Anton Tananaev23 days ago

Your assumption is wrong. Incoming hex should have "osmand < 10.10.10.37" and it should obviously show before the decoded data. What you included is the response from the server to the device.