Information system master unit
-
Hardware:
- Raspberry Pi Pico W.
- USB cable with data transfer capability.
-
Software: - Visual Studio Code (VSCode) installed. - VSCode Extension: MicroPico. - Python 3.x (preferably version 3.11 or newer). - MicroPython UF2 file installed on the Raspberry Pi Pico W.
Follow the official MicroPython setup guide for installing it on your Pico.
- Open Visual Studio Code.
- Go to the Extensions panel and install the MicroPico extension.
- After installing, ensure your Raspberry Pi Pico is connected to your computer via USB.
- Copy the repository to your local machine:
git clone https://github.com/publictransitdata/ISMU.git
cd ISMU- Ensure Python files for your project are located in a directory that will be synced to the Pico. Typically, this is the project’s root directory.
- Launch Visual Studio Code and open the project directory:
code .python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
opptionally:
pip install -r requirements-dev.txt
pre-commit install
- Right-click on area in folder/project view.
- In the context menu that appears, select Initialize MicroPico project
- At the bottom of vs studio you will see a button with the same name and you have to click it
- To upload your code:
- Right-click on the file you want to upload in the side panel (or folder/project view).
- In the context menu that appears, select Upload File to Pico
You don't need all files on board. You only need: app, config, lib, utils directories and main.py
Important
Your lib directory must contain two specific files: lang.py and font.py. An English lang.py is included by default, though you can easily replace it with your preferred language. For the font.py file, please see the chapter on generating font files using the write library.
- Right-click on the
main.pyin Mpy Remote Workspace. - In the context menu that appears, select run current file on Pico
Alternatively, right-click main.py in the MicroPython Remote Workspace, then click the Run button at the bottom.
git clone https://github.com/micropython/micropython.git
cd micropython
make -C mpy-cross
make BOARD=RPI_PICO_W submodules
make BOARD=RPI_PICO_W clean
make -j $(nproc) BOARD=RPI_PICO_W FROZEN_MANIFEST=/path/to/manifest.py/file/inside/ISMU/directory
The ISMU directory contains two manifest files. One includes main.py (manifest_release.py) to auto-start the program on power-up, while the other excludes it so you can run the code manually from an IDE.
Important
Your lib directory must contain two specific files: lang.py and font.py. An English lang.py is included by default, though you can easily replace it with your preferred language. For the font.py file, please see the chapter on generating font files using the write library.
Firmware can be deployed to the device by putting it into bootloader mode
(hold down BOOTSEL while powering on or resetting) and then either copying
firmware.uf2 to the USB mass storage device that appears.
You can find
firmware.uf2inside build-RPI_PICO_W directory. (schematic path : micropython/ports/rp2/build-RPI_PICO_W)
After loading compiled code to firmware, you don't need anymore app, lib, utils directories and main.py(if you used manifest_release.py), so you can remove it from there. In config directory you need to have: char_map.json, font.py, lang.json(language file).
todo