Radio Data rates #33
-
|
Can anyone comment on what the usable downlink data rates are for the RFM series LoRa radios from low earth orbit? Tnx! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Here's one way to think about it (there are plenty of other approaches). LoRa Settings
The above worked great and I always had 20+ dBm of margin so I could have pushed the data rate higher if I needed to. V-R3x also had an s-band LoRa radio (SX1280) that could really move some bits. Ultimately, I'm of the opinion that the sat should start with (and default to) a setting that confidently closes the link. That's the most important part. Once you close the link, you can always configure the data rate higher (see beep-sat advanced example for demo of other-the-air commanding). Sending camera data⭐ After my description below, it became clear to me I should generalize my existing code for doing this and make it available. See the example code at the end of this post.
Below is some untested (but heavily commented) code that achieves what I've described above. Once I return from travel I'll be able to test it on hardware and confirm it works. 💻 untested example code (EXPAND ME)
def send_file(self,chunk_size,filename,start=0,stop=None,p=False):
'''
Send the specified filename starting at byte number `start` and ending at `stop`
Typically `start` and `stop` arguments wont be specified, but it gives us the option
of selecting regions of a file just in case some packets are missed during downlink
'''
if p: print('send_file()',filename)
try:
filesize=os.stat(filename)[6]-start
except Exception as e:
if p: print('[send file] {} error: {}'.format(filename,e))
return []
if stop is not None:
filesize=stop-start
# packet length
buff_end=chunk_size+2 # add two bytes for [chunk#][total chunks][...]
# second byte of the buffer is the total number of chunks that make up the file
cubesat.send_buff[1]=int((filesize)/chunk_size)
# open the file as binary
with open(filename,"rb") as f:
for i in range(cubesat.send_buff[1]):
f.seek(start+(i*chunk_size))
# set first byte of the buffer to be the current chunk number
cubesat.send_buff[0]=i+1
# read the bytes FROM the file INTO our buffer via the memoryview object
# this pre-populates the buffer, so all we return with this function is
# the chunk#, total chunk count, and length of the packet
f.readinto(cubesat.send_buff[2:buff_end])
# we want to yield here (rather than return) so this function behaves as a generator
yield (cubesat.send_buff[0],cubesat.send_buff[1],buff_end)
'''
The above send_file() function is a generator, allowing us loop through its output
and efficiently manage the SD card and radio access over the SPI bus
'''
for chunk in send_file(chunk_size=240,filename='/sd/data/IMG00012.bin'):
'''
note: NO RADIOHEAD HEADER!
The send_fast() function from our rfm9x radio library takes two arguments:
data: byte, bytearray, or memoryview object. In our case, it's a slice of our memoryview object
l: The precomputed length of `data` argument (this saves us from calculating it each time)
This will fill the radio FIFO with our latest "chunk" or packet data and send it.
'''
cubesat.radio1.send_fast(cubesat.send_buff[:chunk[2]],chunk[2])P.S. I'm also developing a "Beep-Sat Advanced-2" example which demos: deep sleep + intermittent computing, rapid over-the-air commanding, and compartmentalized configuration loading. It's fully functional but I'm not satisfied with my handling of |
Beta Was this translation helpful? Give feedback.
Here's one way to think about it (there are plenty of other approaches).
LoRa Settings
The above worked great and I always had 20+ dBm of margin so I could have pushed the data rate higher if I needed to. V-R3x also had an s-band …