Problem with Sigfox Payload
-
@livius
Had already tested this but not the good result.jiemde
-
@Jiemde
what are results - maybe this hint something -
@livius
Here is the printscreen

-
sadly i do not have sipy to test self but
looking at your values i see that you have variation on most significant bits
try then this:
int1:uint::32:little-endian int2:uint::32:little-endianif this does not help then post output from corrds recived by pytrack + output packed
and what you got for this frames on sigfox -
@livius
No change in the displaying data.
As I don't have my SiPy/Pytrack with me at my office, I will reply this evening to your other question.best regards
jiemde -
@livius
You will find the output you ask:def sendtosigfox():
datatosend = struct.pack('ii', int(coords[0]*100000), int(coords[1]*100000)) print('sigfox send: {}\n'.format(datatosend)) size1=struct.calcsize('i') size2=struct.calcsize('ii') print('calcsize: ', size1, size2) sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) s.setblocking(True) s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) s.send(datatosend) s.setblocking(False) s.close()while True:
acc = LIS2HH12(py)
roll = acc.roll()
print('X= ', roll)
pitch = acc.pitch()
print('Y= ', pitch)
yaw = acc.yaw()
print('Z= ', yaw)
time.sleep(1)
gps = L76GNSS(py)
coords = gps.coordinates()
print(coords)
sendtosigfox()
time.sleep(600)The output in Atom/Pymakr:

The output in Sigfox backend

Regards
Jiemde -
@Jiemde
can you add before struct.packprint(coords) or print(str(coords)) #if above not work cast first to string -
is this really your position?
b'\xc8\x17M\x00k\xb5\x08\x00' (5052360, 570731)will be really helpfull to see
print(coords)as mentioned below
-
@livius
Yes it 's my position !
The coords are displayed just before the "sigfox send: " on the output in Atom/pymakr picture.(50.5236, 5.707314)
Jiemde
-
@Jiemde
Ahh i see :) I have missed it.and i see problem (previously i have thinked in opposite direction)
try do this (one of this should do the trick)
datatosend = struct.pack('>II', int(coords[0]*100000), int(coords[1]*100000))or not and on sigfox backend (i do not know why little not do the job and suppose that only above line will work for you)
int1:uint::32:big-endian int2:uint::32:big-endian -
@livius
Hi livius, That's work!, now I need to understand how work the "format" of the "pack" function and specialy "little and big-endian.Best regards
Jiemde
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login