This is the code for the payload section by Norco College Rocketry.
There is a pi zero in the nosecone acting as a wireless access point for the three raspberry pi boards below in payload proper. There is also an arduino on the ground connected to a radio transceiver.
The repository is broken down by the python code (.py files) in the code directory.
There are libraries and tutorials required to set up each pi, located below, along with which sensors are being utilized.
This one is a little more involved.
This is how our server/client communicate.
sudo apt-get install -y mosquitto mosquitto-clients
sudo systemctl enable mosquitto
sudo systemctl status mosquitto
sudo pip install paho-mqtt
You can test if it is working locally with there 2 in 2 different terminals:
mosquitto_sub -h localhost -t "test/message"
mosquitto_pub -h localhost -t "test/message" -m "Hello, world"
Here are the tutorials I used:
https://tutorials-raspberrypi.com/raspberry-pi-mqtt-broker-client-wireless-communication/
https://appcodelabs.com/introduction-to-iot-build-an-mqtt-server-using-raspberry-pi
Here is a good reference https://pypi.org/project/paho-mqtt/
Follow this raspberry pi official tutorial to get it working
https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md
sudo pip3 install adafruit-circuitpython-bno055
sudo pip3 install adafruit-circuitpython-mma8451
sudo pip3 install adafruit-circuitpython-tca9548a
Here is the GitHub link for the reference code
https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A
Here is a useful link for the multiplexer
https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A
sudo pip3 install adafruit-circuitpython-onewire
sudo pip3 install adafruit-circuitpython-ds18x20
sudo pip3 install adafruit-circuitpython-ads1x15
sudo pip3 install adafruit-circuitpython-bmp3xx
sudo pip3 install adafruit-circuitpython-bme280
sudo pip3 install adafruit-circuitpython-sgp30
Combined with an RFM96W, our Arudino acts as a remote interface to our Raspberry Pis abord the rocket. Code for the Arduino can be found in ShiroRiri/rfm96w-repl