Brain: Service

Brain: Service #

view - Documentation

The Zakhar service provides access to the robot status and the CAN bus network.

The service prints information onto an ssd1306-based 128x32 OLED display connected to /dev/i2c-1:

The service publishes status information and incoming CAN messages to ZeroMQ subscribers. It also provides a ZeroMQ service to send CAN messages to the CAN bus.

The service allows all TCP connections including connections from external machines. See brain_pycore for compatible subscriber and client implementation classes.

Requirements #

OS and Hardware #

The service is supposed to be run on Raspberry Pi 4 with a Debian-like Linux (e.g. Raspberry OS). The OS should be initialized with the init script:

1
sudo bash scripts/init/init.sh

The script will create a zakhar directory in the system root and prepare the robot environment.

The service expects to see an I2C 128x32 display with the ssd1306 controller. E.g. this one. The display should be connected to /dev/i2c-1.

Python #

The service is written in python 3, so it requires Python > 3.5

The service requires several python packages:

You can install the last four packages using pip and pypi. brain_core should be installed from the repository:

1
pip install git+https://github.com/Zakhar-the-Robot/brain_pycore

Installation #

To install the service run the installation script as root:

1
sudo bash scripts/service_install.sh

Connections #

TypePortTopic
Robot status publisher5557status
CAN received msgs publisher5556can_rcv
CAN send message server5566n/a