This repository contains the source code for the embed part of the project.
The control part of the project is responsible for getting the decisions of the user and the manual controller (movement inputs).
Today, it is a simple script, but it will be improved in the future to first become a TUI (and stay that way for manual debug). Then, the feature and endpoints will be implemented to the control panel of the project (Flutter project).
The ESP is a command board for the motors (land and water propulsion) that will translate the controller inputs into the correct signals for the motors drivers.
Other features are to expect such as relays control, leds and more.
The embedded Raspberry Pi will be responsible for the communication between the ESP and the control panel (Flutter project). It gathers and transmit user inputs to the ESP and send sensors data to the control panel (user).
It is an API with two main features: get the status of the websockets (open/close) and access the websockets to receive/send data.
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all parts it needs, such as libraries and other dependencies, and ship it all out as one package.
On the Raspberry Pi, the installation is a little bit different from the common OS. The official documentation is here.
The all-in-one command to install Docker on the Raspberry Pi is:
curl -fsSL https://get.docker.com | shTODO: change to clean install.
Once set up, clone the repository:
git clone https://github.com/THE-TRAVELERS/Embed-Control.gitMove to the directory:
cd Embed-Control/src/command/RpiRun the docker build command:
docker compose buildAnd then, run the up command:
docker compose up -dThe service will be up and running. To check the logs, we may use the tool lazydocker:
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bashNow you should be able to access the logs of your containers using:
lazydockerFirst clone the repository and navigate to Embed-Control/src/command/Rpi (steps above).
Then, let's set up a virtual environment:
python3 -m venv travenv
source travenv/bin/activateThen, install the requirements:
pip install -r requirements.txtNow, we can run the FastAPI server for a debug environment:
fastapi dev /app/main.py --port 8000Or for a production environment:
fastapi run /app/main.py --port 8000Note
WIP
Note
WIP
This project is licensed under the MIT License - see the LICENSE file for details.
