LoPy4 sending duplicate messager using Sigfox
I've been doing current draw measurement of my LoPy4(with Pysense shield) using Sigfox and I have noticed that it does send the message out multiple times one after another.
In theory one sigfox message takes 2sec to be sent, but as shown in the picture, there are indeed 3 messages being sent with 1sec pause between them.
The sigfox code is simple (its the example code):
# init Sigfox for RCZ1 region (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 socket as uplink only s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) # send data s.send(dataToSend)
The two yellow lines in the picture are start and end of s.send() command.
(I have turned on and off rgb led to full power for short period of time before and after the s.send() to see power spikes on the oscilloscope, that is how i determined that whatever is happenning between those yellow lines is only the s.send() command working. Those led power spikes are not in the picture.)
Does anyone have more information about why is this happenig?
Any idea how to avoid this?
I do not think it is necessary and in my example it does increase power consumption roughly 2x.
This post is deleted!
s.setsockopt(socket.SOL_SIGFOX, socket.SO_TX_REPEAT, 1)
setting to 1 did not work, but setting to 0 did ;)
Thank you for the idea
As jcaron said, sigfox's specification allow 3 or 1 TX for each frame, 3 is done on 3 differente frequency to ensure that message is received by sigfox back end.
Can you try to add a one line to your code and try if it's work? (as it's not in documentation but i have found it in code i don't know if it work or not)
# configure socket as uplink only s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) s.setsockopt(socket.SOL_SIGFOX, socket.SO_TX_REPEAT, 1)
@j_mor From what I understand the Sigfox spec allows devices to send the frame either 1 or 3 times (the "multiple frame" procedure) for redundancy and reducing packet loss. I would have expected a parameter to switch that on or off, but I can't see one in the docs or in the public part of the code.