Skip to content

jjbel/pi-pico-telemetry

Repository files navigation

Pi-Pico Telemetry

A telemetry server using

  1. a Raspberry Pi Pico to receive data wirelessly from the rocket and
  2. 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

Install

  1. 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
  1. Install Python dependencies
pip install -r requirements.txt

Run

  1. Run the webserver:
python webserver.py
  1. Run the data sender from serial to socket:
python serial_to_socket.py

When 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
  1. Open the app at http://localhost:5000/

Frontend

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

Pi-Pico UART communication

Using: Medium - Tim Hanewich

Wiring

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:

  1. Pi8(GP15) > Pico7(GP5)
  2. Pico6(GP4) > Pi10(16)
  3. Pi6(GND) > Pico3(GND)

UART shows up as file: /dev/ttyAMA0 (from forum)

Other Useful Links

Geekculture Medium

How to enable Tx Rx pins on Pi

Getting started with the Raspberry Pi

Run in Headless mode (Tom's Hardware)

Getting started with the Raspberry Pi Pico

Getting Started (includes webserver and GPIO tutorials)

Websockets

MDN Docs

MDN writing client apps

Python websockets docs

About

Raspberry Pico receiver, Pi telemetry webserver

Topics

Resources

Stars

Watchers

Forks