1

Why would messages/load_interval return null

(19/08/2019 18:59:00 отредактировано tuckerBA)

Тема: Why would messages/load_interval return null

I was looking through the docs and I don't see a case when it would be null.

https://sdk.wialon.com/wiki/en/sidebar/ … d_interval

I've attached my params

  • Why would messages/load_interval return null
2

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

Hello!

it seems like is using not correct flag mask
you use use flag 0x0001 (1), which contains of 2 flags: 0x0000 (0) - data messages, 0x0001 (1) - messages with position.
So the same you should use for mask - 0xFF00 (65280) - determines message type, 0x0001 (1) - determines availability of position info in data messages, the result  "flagsMask":65281

Diana Cheley
Wialon Hosting Expert
Gurtam
3

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

Hey Diana hope you're doing well!

The params I posted are working most of the time (different vehicle_id or timestamps), but I figured out what the issue was. The response wasn't null, when I ran json_decode on the response it ended up being null. I'm pretty sure it's because of an unknown character in the obd_vin of one of the messages.

That is interesting about the flags though, I have been doing it wrong it looks like so I'll go through and correct it everywhere. Thanks for the heads up.

4

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

Actually I have more information which lead me to another question. For that last set of params, this is the response I get before I json_decode it (see attached). You can see the question mark on the last line in obd_vin. When I pull that same message inside Wialon, this is what it looks like: (see 2nd attached). Do you know what could cause a question mark to be returned there? I'm pretty sure that's what is causing my issue, but I don't know how to prevent it because I don't know what's causing it.

Thanks again for looking into this for me.

  • Why would messages/load_interval return null
  • Why would messages/load_interval return null
5

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

Hello Tucker!

question mark in JSON means that value of parameter obd_vin is not in UTF-8 coding. In Wialon we use standart UTF-8  encoding, if some symbols cannot be parsed with UTF-8, they wiil be replaced a question mark

Diana Cheley
Wialon Hosting Expert
Gurtam
6

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

Gotcha so this is just an issue with the TopFly device not returning a symbol that can be utf8 encoded? I did end up figuring out that I needed to add a flag to my json_decode and it would fix the utf8 encoding issue, but I wasn't sure why I was getting that in the first place.

7

Why would messages/load_interval return null

Re: Why would messages/load_interval return null

tuckerBA пишет:

Gotcha so this is just an issue with the TopFly device not returning a symbol that can be utf8 encoded? I did end up figuring out that I needed to add a flag to my json_decode and it would fix the utf8 encoding issue, but I wasn't sure why I was getting that in the first place.

correct, the device can send text value in some other encoding.  Recently we have found some messages from one device which sent text data in Windows 1254 (Turkish) encoded. And only one text editor (Sublime) could guessed about it smile

Diana Cheley
Wialon Hosting Expert
Gurtam