How to make an IoT protocol (parsing, answering)?

Looking at the document you posted I think it says that both lat and lon must be zero, not just one, for invalid.

The A/V flag is standard NMEA. For some reason they picked V to mean INvalid, so look at that first.. Invalid usually means no gps signal so i guess it means the iwp01 message comes from the gps side and the iwp02 from the wifi side

You are right. Thanks.

Hi dceejay. This is a TRV protocol, of course inspired from the NMEA. IWAP01 is total fingerprint tracking GPS+LBS+STATUS+BASES+WIFI. IWAP02 is only LBS+WIFI fingerprint. After test, I observed the IWAP01 is not sent by the watch (either the gps poor quality or just beidu I'm afraid). I think the manufacturer is not completely honest with the technical species or abilities...). Do you know if there is a solution to implement OpenCellid (LBS) any WiFi fingerprint tracking (I found Shyhook) under Node-Red. I think it is only API service afterall... Maybe something open source?

Are you saying that you don't need the code for IWAP01?

Nooooo! :slight_smile:
I need it, of course. I discussed with the manufacturer who said it is a technical problem, cause in his Android APP, it is running with GPS coordinates. I saw it. Now they are investigating to understand from where it is coming.

You said it was not sent by watch. Have you seen the watch send it?

We can't see the packets directly... It is displayed in their soft! And we need it! I

My contact just gave me the right order ...
1 WiFi
2 GPS
3 LBS

And they just told me I have to setup the emergency mode on the watch but only from their server... in fact I understand they don't activate the GPS because of electric consumption :slight_smile:
"you can set the common model to emergency model, so that you can receive the data, :blush:"

Have you actually got the watch sending messages into node-red? If you have then you should be able to see what it is sending.
Also who is the this 'we' that needs it?

???? You and me of course!! You helped me from 10 days!!

I can say I need it if you prefer...

And I will make the real tests with the watch as requests and answers are ok.
If we (you and me) can't discuss with the device. The device will enter in security mode after 3 attempts. So it is not ok to realise tests under Node-Red in these conditions.
But if your question is "did you already use and decode hex logs between the watch and your server?".. The answer is yes of course, and this is where I saw IWAP01 package was never sent by the device. I've made tests for 2 weeks before trying to use node-red to finally remove their poor Chinese APP. Now they told me to activate and how to activate the GPS... I will do it tonight asap. I'm actually in Berlin waiting for my return flight. I don't have a valid German simcard on the watch...

I won't have much time over the next week or so so I think you might have to have a go by yourself. Looking at the transaction details again I see it isn't necessary to test the flag or the lat and lon, the software can just see whether there is more data to read and if so then to carry on. If you look at how I handled the other one I did just that.

Thanks for your help Colin.
Of course it is necessary to get the addtional datas and the reasons are clear now :

After a complete day spent to decode the double language of the manufacturer, I understood this device is using the GPS chip only if the emergency mode is activated.
Decoding the IWAP01 package is -of course- necessary EVEN if there is no GPS coordinates provided, BECAUSE inside this message, when if long. = 0 and lat = 0, the rest of the message is giving you the infos the device is scanning around itself, as LBS datas, WIFI datas, speed, direction...
AND WHEN YOU GET THESE INFOS YOU CAN THEM WITH A DEDICATED API FOR MOBILE LOCATING SERVICE as https://mozilla.github.io/ichnaea/api/geolocate.html#api-geolocate-latest .... IT WILL GIVE YOU THE REAL POSITION OF THE DEVICE ... WITHOUT GPS :slight_smile:

Here, the purpose is to not use the GPS (big electric consumption for the device... life battery is / 5!!) to get the real position. The manufacturer forgot to tell me about this... as they sold real time tracking idea... So not possible in the countryside where there are not WIFI bases and so rare cell towers for LBS :slight_smile:

Google is using this system for years now to display your position on any Google maps, without your GPS activated, to sell advertising based on tracking ... as they consider they dont need your consent if the tracking is done with public LBS GSM/3G/4G or/and WIFI fingerprint...

So, the real problem now, is to collect and decode the usefull infos in IWAP01... AND ALSO IN IWAP02, and to POST the request with a JSON body at https://location.services.mozilla.com/v1/geolocate?key=XXXX .... as

{
"wifiAccessPoints": [{
"macAddress": " WIFImacAddressFromIWAP01",
"signalStrength": WIFIsignalFromIWAP01
}, {
"macAddress": "WIFImacAddressFromTheWatch"
}]
}
...

{
"cellTowers": [{
"radioType": "wcdma",
"mobileCountryCode": mccFromIWAP01,
"mobileNetworkCode": mncFromIWAP01,
"locationAreaCode": lacFromIWAP01,
"cellId": cidFromIWAP01,
"signalStrength": GSMsignalFromIWAP01
}]
}