Beware that this does not take negative values into account, unless you pass exactly 4 bytes. As JavaScript’s bitwise operators always assume 32 bits, fewer number of bytes need sign extension to handle negative values.
(And as an aside, I don’t think the unary plus operator in +(bytes[x] << (x * 8)) has any effect?)
I want to connect my ztrack tracker with cayenne my devices.
Do i have to let the payload in my ttn setup like in the link from you or change it to “Cayenne LPP”?
Or is there a better way to see the coordinates from ztrack tracker on a map (but not ttn mapper)?
// Sign-extend to 32 bits for support of negative values, by shifting 8 bits
// too far to the left, followed by a sign-propagating right shift:
decode.lat = b[0]<<24>>8 | b[1]<<8 | b[2];
decode.lng = b[3]<<24>>8 | b[4]<<8 | b[5];
Hi Guys! Testing a Zane zcar currently - which decoder works with Cayenne? I see they have the sensor listed. Currently not recognising the data format - nothing appearing (integration working as I have many other sensors linked)
Like noted in my previous post, you cannot use a Decoder in TTN Console to convert a random payload into a Cayenne-compatible payload. Instead, the device must generate such payload, and then TTN Console must only be configured to use the Cayenne Integration.
I’ve been testing one of their new Ztrack Pro devices … and have a decoder for their standard format. They’ve now removed number of satellites from the payload but the rest is there. I am getting a mixed bag of results and they have been sending firmware updates to attempt to resolve.
Lat/Long GPS accurate. Altitude incorrect (wildly). Battery %age is odd. It’s consistent, but will never get anywhere near 100% even when the device is fully charged. I get different battery %ages in different payloads that are adjacent - e.g. a keepalive will say 70% and then immediately following I might get 60% in a longer device moved payload. Temperature seems accurate too. But I think there is definitely some correlation between temperature and battery %age.
Would be great if they could nail these little niggles as the form factor is fantastic.
How are you getting access to the Cayenne payloads?