coloradocube / balloonsat

COTS balloonsat mission to test the RPi 4 with a battery UPS, a quad camarray, a GPS module, a RockBLOCK module, and a small number of Qwiic sensors
0 stars 5 forks source link

Outdoor telemetry via RockBLOCK & external antenna #61

Closed ivogeorg closed 2 years ago

ivogeorg commented 2 years ago

Description

  1. Use RockBLOCK:
Name Serial IMEI
RockBLOCK 206507 - Version 3 206507 300434066314570
  1. Use RockBLOCK external antenna.
  2. Use blinka library.
  3. Use USB connector (default for v3). Cable has FTDI USB-to-UART.

Knowledge

  1. Adafruit example for Serial: https://learn.adafruit.com/using-the-rockblock-iridium-modem/raspberry-pi-example.
  2. RockBLOCK guides.
  3. RockBLOCK API reference.

Deliverables

  1. Can send a line of telemetry MO message and receive in https://rockblock.rock7.com/Operations#.
ivogeorg commented 2 years ago

Issue with limit to the length of text

The Adafruit RockBLOCK library limits the text to send to 120 bytes (len(text) > 120). When a message is sent adhering to this length, it appears normally as text: 2022-01-22 14:38:29,8.71,7.21,26600,35.9,843.61.... If this limit is removed, for example to allow the stated outgoing length of 340, the message arrives unencoded (ASCII character codes in hex, appended together with no spaces): 323032322d30312d32322031343a34313a35392c372e38342c362e38372c3135323631302c33382e31392c3834332e353....

View of RockBLOCK message list

Screen Shot 2022-01-22 at 15 13 35

Details of message

The non-encoding is evident in this view...

Screen Shot 2022-01-22 at 15 17 50

Delivery to email

Interestingly enough, the email with the message contains both the unencoded hex data and the encoded text.

Screen Shot 2022-01-22 at 15 27 06
ivogeorg commented 2 years ago

The format in which the message is sent is just a hex string. To decode it to a Python string, use the following code:

message = "323032322d30312d32322031343a34323a35342c372e372c362e392c33313935392c33382e33352c3834332e362c313531392e31382c2d302e32332c322e38382c2d392e34382c302e30322c2d302e30322c2d302e302c342e30352c362e332c2d35352e36352c342e39382c3735332e382c332e37372c32392e320a"
enc_string = bytes.fromhex(message)
dec_string = enc_string.decode("ascii")
print(dec_string)
# 2022-01-22 14:42:54,7.7,6.9,31959,38.35,843.6,1519.18,-0.23,2.88,-9.48,0.02,-0.02,-0.0,4.05,6.3,-55.65,4.98,753.8,3.77,29.2
ivogeorg commented 2 years ago

Hack in /usr/local/lib/python3.9/dist-packages/adafruit_rockblock.py: changed enforced byte limit for text in text_out setter. To remove/improve in #76.