Development environment
Two ways to work on ImSwitch: on your own computer with simulated devices, or directly on the Raspberry Pi of a FRAME.
On your computer
git clone https://github.com/openUC2/ImSwitch
cd ImSwitch
uv venv --system-site-packages
uv sync
uv run python main.py --headless --http-port 8001
The server then answers on port 8001. The interactive API description is at /imswitch/api/docs. Choose a setup file with virtual devices to work without hardware.
On the FRAME
On the FRAME, ImSwitch runs in a container that starts at boot. To run your own copy from source, stop the container first, because only one program can hold the camera and the serial port.
-
Connect to the machine: hotspot, network cable or USB-C, see connectivity.
-
Stop the ImSwitch container. On the landing page open Machine Administration, then Dozzle, the container viewer under the advanced settings. Select the ImSwitch container and stop it.
docker psanddocker stopin a terminal do the same. -
Open the machine in your editor over SSH, for example with the Remote - SSH extension of Visual Studio Code and the host
pi@192.168.4.1. SSH access: access. -
In the ImSwitch folder, activate the environment and start
main.py, or start it under the debugger:source .venv/bin/activatepython main.py --headless --http-port 8001 -
The first start after a change of dependencies takes several minutes. The API is ready when
/imswitch/api/docson port 8001 answers.
A restart of the machine brings the container back. Your copy does not start by itself.