Struggling with message format for Sigfox transmission
-
Re: Data format for Sigfox transmission
So i'm continuing to have issues with what must be a simple task. Below is my code... simply trying to send the variable data1 via Sigfox.
A message is received but the data is always represented as "21030490058604" from the Sigfox back end which I assume is an error code of some form as its always the same irrelevant of the content of my variable.
The content is encoded from 2315051001 to b'\xf9\xdf\xfc\x89'. But I'm unclear if this is how the data should be prepared for sigfox? As ever any help appreciated.
from network import Sigfox import socket from time import sleep import _thread import array import ustruct # init Sigfox for RCZ1 (Europe) sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) # create a Sigfox socket s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) # make the socket blocking s.setblocking(True) # configure it as uplink only s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) # send some bytes data1 = 2315051001 print (data1) data1 = ustruct.pack('i', data1) while True: try: s.send(data1) print (data1) except: print ("fail") pass sleep(900)```
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