Skip to content

Commit ef060f7

Browse files
authored
Bump pysquared version (#6)
* Bump pysquared version * Update Makefile * Remove docs, update radio inputs, bump pysquared version, bump sync-time
1 parent 93bd41e commit ef060f7

File tree

8 files changed

+13
-248
lines changed

8 files changed

+13
-248
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PYSQUARED_VERSION ?= v2.0.0-alpha-25w14
1+
PYSQUARED_VERSION ?= v2.0.0-alpha-25w14-3
22
PYSQUARED ?= git+https://github.com/proveskit/pysquared@$(PYSQUARED_VERSION)
33

44
.PHONY: all
@@ -32,7 +32,7 @@ pre-commit-install: uv
3232

3333
.PHONY: sync-time
3434
sync-time: uv ## Syncs the time from your computer to the PROVES Kit board
35-
$(UVX) --from git+https://github.com/proveskit/[email protected].0 sync-time
35+
$(UVX) --from git+https://github.com/proveskit/[email protected].1 sync-time
3636

3737
.PHONY: fmt
3838
fmt: pre-commit-install ## Lint and format files

README.md

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,11 @@
1-
# # ProvesKit RP2040 v5 CircuitPython Flight Software
1+
# ProvesKit RP2040 v5 CircuitPython Flight Software
22

33
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
44
![CI](https://github.com/proveskit/CircuitPython_RP2040_v5/actions/workflows/ci.yaml/badge.svg)
55

6-
Software for CircuitPython flight software in the PROVES Kit.
7-
8-
If this is your first time using CircuitPython, it is highly recommended that you check out Adafruit's [Welcome to CircuitPython](https://learn.adafruit.com/welcome-to-circuitpython/overview?gad_source=1&gbraid=0AAAAADx9JvTRorSR2psQubn32WqebKusM&gclid=CjwKCAiA-Oi7BhA1EiwA2rIu28YArt-jNTE3W3uwE055Tp7hyH9c9pE_NsqIOOh1aopnW00qXGBedRoChysQAvD_BwE) to help you get started!
9-
10-
# Usage
11-
If you have just received a clean PROVES Board, ensure you have loaded the latest firmware from that board's GitHub Repo. Currently the [latest FC Board firmware](https://github.com/proveskit/flight_controller_board/tree/main/Firmware) is `FC_FIRM_V2.uf2`.
6+
Software for the v5 PROVES Kit flight control board.
127

138
# Development Getting Started
149
We welcome contributions, so please feel free to join us. If you have any questions about contributing please open an issue or a discussion.
1510

16-
You can find our Getting Started Guide [here](docs/dev-guide.md).
17-
18-
## Manually Updating CircuitPython Code on a PROVES Board
19-
You can cleanly load new software by doing the following:
20-
1. Clone the branch you wish to put on your board to your local machine.
21-
2. Connect to the target board so it mounts as an external drive.
22-
3. If many files have changed, connect to the target board using a serial terminal and run the following code in the REPL to erase all of the existing code:
23-
```py
24-
import storage
25-
storage.erase_filesystem()
26-
```
27-
> NOTE: If you have only changed one or two files, it is fine to just drag and drop them onto the external drive to overwrite the existing files.
28-
4. The target board will now disappear and remount. Once remounted copy and paste the contents of the flight software folder for the target board from your GitHub repo.
29-
5. When the new files are onboard you can verify that all the hardware on the board is working properly by opening a serial connection and entering the REPL after using `ctrl+c` to interupt the code that is currently running.
30-
31-
## General Structure:
32-
- **boot.py** This is the code that runs on boot and initializes the stack limit
33-
- **main.py** This code tasks all the functions the satellite should do in a semi-asynchronous manner utilizing the asyncio library
34-
- **safemode.py** This code is unimplemented pending new firmware releases that allow the microconrtoller to perform a routine when in safemode
35-
### pysquared lib
36-
This software library contains all of the libraries required to operate the sensors, PySquared board, and radio module.
37-
- **Big_Data.py** This is a class developed to obtain data from the sensors on the 5 solar faces. Since all the faces maintain the same sensors, this class handles the individual face sensors and returns them all to the main code.
38-
- **flag.py** This is code that allows for some registers within the microcontroller to be written to and saved through power cycles
39-
- **Field.py** This is code that implements the radio module for sending and listening
40-
- **functions.py** This is a library of functions utilized by the satellite to obtain data, detumble, run the battery heater
41-
- **pysquared.py** This is a library that initializes and maintains all the main functions for the pysquared architecture
42-
- **adafruit_rfm.py** This is a library that implements all the radio hardware. This code is a modified version of the pycubed_rfm9x which is a modified version of the adafruit_rfm9x file.
43-
- **cdh.py** This is the code that handles all the commands. A majority of this code is pulled from the cdh file developed by Max Holliday at Stanford.
44-
- **detumble.py** This code implements the B-dot algorithm and returns outputs that allow the system to do a controlled detumble with the satellite's embedded magnetourquer coils
45-
- **payload.py** This code implements any desired payload. On the Pleiades missions, the payload has been the BNO055 IMU. Since the use of a stemmaQT connector allows multiple devices on the same bus, a BNO IMU could be used in conjunction with several other sensors if desired.
46-
- **logger.py** This class emulates the logging abilities of mainline Python and creates .json format logs for all of the satellite activities.
47-
- **config.json** This file is used to configure the system variables for the satellite software.
48-
## Adafruit Libraires
49-
These are open source software libraries that are pull from Adafruit. They don't ship by default anymore in our repo, instead they are installed by our package manager when you run the `make` toolchain.
50-
- **asyncio** This is the library responsible for scheduling tasks in the main code
51-
- **adafruit_bno055.py** This is the library that is responsible for obtaining data from the BNO055 IMU
52-
- **adafruit_drv2605.mpy** This is the pre-compiled library that is responsible for driving the magnetorquer coils using the drv2605 motor driver
53-
- **adafruit_ina219.py** This is the library that is responsible for obtaining data from the INA219 Power Monitor
54-
- **adafruit_mcp9808.mpy** This is the pre-compiled library that is responsible for obtaining data from the MCP9808 Temperature Sensor
55-
- **adafruit_pca9685.py** This is the library that is responsible or driving the power to the satellite faces using the pca9685 LED driver
56-
- **adafruit_tca9548a.mpy** This is the pre-compiled library that multiplexes the I2C line to each satellite face using the tca9548a I2C Multiplexer
57-
- **adafruit_veml7700.py** This is the library that is responsible for obtaining data from the veml7700 Light Sensor
58-
- **adafruit_vl6180.py** This is the library that is responsible for obtaining data from the vl6180 LiDAR sensor
59-
## tests
60-
This software is used for performing tests on the satellite. Currently this is seperated into `repl` (tests that are meant to be run from the REPL enviroment on the board) and `unit` (tests that can be run independently of the hardware).
61-
- **radio_test.py** This is an omnibus radio testing script that will allow you to send, receive, and command boards running the PySquared library.
62-
63-
## Testing setup
64-
65-
1. Follow the steps to set up your venv and install packages in the linting setup
66-
2. Run tests with `make test`
11+
You can find our Getting Started Guide [here](https://github.com/proveskit/pysquared/blob/main/docs/dev-guide.md).

docs/dev-guide-linux.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs/dev-guide-macos.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

docs/dev-guide-windows.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

docs/dev-guide.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

lib/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
adafruit-circuitpython-74hc595==1.4.6
12
adafruit-circuitpython-asyncio @ git+https://github.com/adafruit/[email protected]
23
adafruit-circuitpython-drv2605==1.3.4
34
adafruit-circuitpython-lis2mdl==2.1.23
@@ -10,3 +11,4 @@ adafruit-circuitpython-tca9548a @ git+https://github.com/proveskit/Adafruit_Circ
1011
adafruit-circuitpython-ticks==1.1.1
1112
adafruit-circuitpython-veml7700==2.0.2
1213
proves-circuitpython-rv3028 @ git+https://github.com/proveskit/[email protected]
14+
proves-circuitpython-sx126 @ git+https://github.com/proveskit/[email protected]

main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@
7979
config.radio,
8080
Flag(index=register.FLAG, bit_index=7, datastore=microcontroller.nvm),
8181
spi0,
82-
initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT),
83-
initialize_pin(logger, board.RF2_IO0, digitalio.Direction.INPUT),
84-
initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT),
85-
initialize_pin(logger, board.RF2_IO4, digitalio.Direction.INPUT),
82+
initialize_pin(logger, board.SPI0_CS0, digitalio.Direction.OUTPUT, True),
83+
board.RF2_IO0,
84+
initialize_pin(logger, board.RF1_RST, digitalio.Direction.OUTPUT, True),
85+
board.RF2_IO4,
8686
)
8787

8888
i2c1 = initialize_i2c_bus(
@@ -143,9 +143,9 @@ def send_imu_data():
143143
IMUData = []
144144
watchdog.pet()
145145
logger.info("IMU has baton")
146-
IMUData = f.get_imu_data()
146+
IMUData = imu.get_gyro_data()
147147
watchdog.pet()
148-
f.send(IMUData)
148+
radio.send(IMUData)
149149

150150
def main():
151151
f.beacon()

0 commit comments

Comments
 (0)