Skip to content

Satellite Software

yashikabatra15 edited this page Mar 28, 2022 · 31 revisions

Satellite Software

Troubleshooting

  • Can't read from the IMU: As suggested try changing the address from 0x69 to 0x68 in line 131 of lib/pycubedmini.py

self.IMU = bmx160.BMX160_I2C(self.i2c1,address=0x69)

Running Basic BeepSat Code on PyCubedMini Boards

Resources

PyCubed Beep-Sat Basic Guide can be found here.

Installation

Step 1

Download the latest Beep-Sat code from its GitHub Repo. Either download the zip or if you're familiar with git, fork & clone the repo.

Step 2

(Optional) With your PyCubed board plugged into your computer, backup your PYCUBED drive by copying its contents to a directory on your computer.

Step 3

Copy the files from /software_example_beepsat/basic/ to your PYCUBED drive, overwriting any files when prompted.

PyCubedMini Specific Instructions

  • Copy the files from the most recent flight-software lib directory to your PYCUBED driver, overwriting any files when prompted.
  • Change the import statement from pycubed import cubesat to from pycubedmini import pocketqube as cubesat. This ensures that you are importing the correct Satellite object from pycubedmini.py.
  • Look at the first bullet point under troubleshooting if applicable.

Step 4

Open a serial terminal.

PyCubedMini Specific Instructions

  • At this point, you should get error messages on your terminal telling you that certain attributes being accessed by Tasks do not exist for your Satellite object. This is because there are a lot of initializations done on the pycubed.py Satellite object that are not part of the pycubedmini.py file. In order to fix this:
  • Copy the following lines (taken from the __init__ function in pycubed.py) into the __init__ function in pycubedmini.py:
         self.data_cache={}
         self.filenumbers={}
         self.vlowbatt=6.0
         self.debug=True
  • Save and observe the output as the beep-sat conducts its mission.

Step 5

After observing the output in the terminal for a few moments, start working through understanding each task by stepping through the code breakdown discussion (below) while opening and playing with its respective file in /Tasks/task_filename.py.

Tasks

Blink LED Task

Details on the blink_task.py file can be found at this link.

Report IMU Data Task

Details on the imu_task.py file can be found at this link.

Monitor Battery Voltage Task

Details on the battery_task.py file can be found at this link.

Report Time Since Boot Task

Details on the time_task.py file can be found at this link.

Transmit Beacon Packet and Listen Task

Due to differences between the PyCubed and PyCubedMini boards, we must make some alterations to the beacon_task.py and pycubed_rfm9x.py files.

  • Note: the pycubed_rfm9x.py file is the version taken from the most recent flight-software lib directory, NOT the version in the Beep-Sat code GitHub Repo. Necessary Changes:
  1. In the beacon_task.py file, change all references to radio1 to radio. The PyCubedMini library's version of the Satellite class has no field named radio1, and rather refers to the radio attached on the board as radio.
  2. Copy and paste the below function await_rx after the function rx_done (line 629) in the RFM9x class of file pycubed_rfm9x.py:
    async def await_rx(self,timeout=60):
        _t=time.monotonic()+timeout
        while not self.rx_done():
            if time.monotonic() < _t:
                yield
            else:
                # Timed out
                return False
        # Received something
        return True

Details on the beacon_task.py file can be found at this link.

Troubleshooting

  • Can't read from the IMU: As suggested try changing the address from 0x69 to 0x68 in line 131 of lib/pycubedmini.py

self.IMU = bmx160.BMX160_I2C(self.i2c1,address=0x69)

Running Advanced BeepSat Code on PyCubedMini Boards

Clone this wiki locally