How to make sense of gps data sent to sigfox
james.matthews last edited by james.matthews
I'm trying to send latitude and longitude from the Pytrack to sigfox. The code I am using to do this is this:
print(str(latitude), ":", str(longitude)) s.send(struct.pack('f',float(latitude)) + struct.pack('f',float(longitude)))
The print command gives me this:
51.753743 : -1.252524
but in Sigfox I see this:
You can see this in the attached image
I've also tried this:
but it wasn't helpful. Can anyone help make this text something useful?
Eventually I'd like to be able to automatically view this on a map. Could anyone help with that? would AWS be helpful here?
Eric73 last edited by
This float , have been packed in a binary form
'''s.send(struct.pack('f',float(latitude)) + struct.pack('f',float(longitude)))'''
then sent to sigfox backend data and showed in hexadecimal
so, to have original value you just have to unpack it from hexadecimal to float
''' lat=b'\xd5\x03\x4f\x42' '''this is the way to create and assign hexadecimal value to a 'python byte object' with len=4
james.matthews last edited by
That's awesome, thanks!
However, I do not understand what you did. How (and why) did you know to write it like this:
Eric73 last edited by Eric73
It's seem your sensor will to be near oxford isn't it ?