A telemetry server using
- a Raspberry Pi Pico to receive data wirelessly from the rocket and
- a regular Raspberry Pi to host the telemetry webpage, easily accessible from a phone
Websockets are used send data from the Pi to the client browser.
Made for the IIT-B Rocket Team's Ground Station.
Why not use the pico only? the limited RAM and micropython restriction
Why not use the pi only? the libraries for wireless communication are only on the Pico
We might switch to use one board exclusively in the future
- Activate
venv
A Python venv is used for handling dependency versions easily.
On the Raspberry Pi:
python -m venv venv
./venv/bin/activate
On Windows (when testing the frontend):
python -m venv venv
.\venv\Scripts\activate.bat
- Install Python dependencies
pip install -r requirements.txt
- Run the webserver:
python webserver.py- Run the data sender from serial to socket:
python serial_to_socket.pyWhen testing on a laptop, instead of serial_to_socket.py, run test_socket.py which sends sample data in the local file test_data.csv
python test_socket.py- Open the app at http://localhost:5000/
The website is a plain index.html file.
The class State in state.js manages the entire app state. index.js opens the socket and updates State
Physical numbering vs GPIO numbering: https://pinout.xyz/
GP UART pins:
- Pico
- UART0: 0/1, 12/13, 16/17
- UART1: 4/5, 8/9
- Pi: UART: 8/10
Connections:
- Pi8(GP15) > Pico7(GP5)
- Pico6(GP4) > Pi10(16)
- Pi6(GND) > Pico3(GND)
UART shows up as file:
/dev/ttyAMA0 (from forum)
How to enable Tx Rx pins on Pi
Run in Headless mode (Tom's Hardware)
Getting Started (includes webserver and GPIO tutorials)
Python websockets docs