By Mykhailo Didur
Hi! That is my pet project, the goal of which to learn how Yocto works and what can I do with it.
- Support of custom request responce library (LRRP - Lightweight request-response library)
- Custom RPC framework (MIDF - Mocto interface definition framework)
- Util to observe other services' state
- Support of DS18B20 temperature sensor
- Remote test execution
- Logging service with ring buffer
- Support of plugin manager
- Wifi service support
- Support of initializing smart devices over serial(ESP32)
⚠️ The developer may work after 6 p.m. by Kyiv until midight. So, the sources may be not buildable during development process.
- Get sources
We are using repo tool to manage all the yocto sources. As for the custom modules, they are placed on github and has been downloading during the Yocto build process.
How to install repo you can see here
Init the manifest:
repo init -u [email protected]:yocto-is-easy/manifest.git
Do the sync of sources:
repo sync
- Build docker image and run its container
Before doing this step it is recommended to include your user to the docker group.
It is created docker image to build Yocto without dependency to the development platform(Arch, Ubuntu, etc.)
From the top directory run:
source docker/env-setup.sh
Run the builder:
run.sh
- Set the target machine
In workdir/build/conf/local.conf change the MACHINE variable:
MACHINE ??= "raspberrypi3-64"
If you have a board of another version (like Raspberry Pi 4), so, set it.
- Build Yocto image
The project has several images:
- mocto-image - release image
- mocto-image-dbg - debug image(it includes tests for services and remote executor support)
bitbake mocto-image-dbg
- Flush image to SD card
SD card image is placed in the workdir/build/tmp/deploy/images/raspberrypi3-64
Use the following command to flush the image:
dd if=mocto-image-dbg-raspberrypi3-64.rpi-sdimg of=/your/sd-card/path
- Run Raspberry Pi
Put the card to your device, run it, connect over ssh and enjoy the result
Several commands to test image.
Check the states of services:
observe
result:
temp_check : online
test_service : online
Run one of available tests:
exec-local temp-check-tests
result:
Running main() from /home/build/workdir/build/workspace/googletest/googletest/src/gtest_main.cc
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from TempCheckTest
[ RUN ] TempCheckTest.ok_temperature_format
[ OK ] TempCheckTest.ok_temperature_format (1647 ms)
[ RUN ] TempCheckTest.get_temperature_time_1s
[ OK ] TempCheckTest.get_temperature_time_1s (832 ms)
[----------] 2 tests from TempCheckTest (2479 ms total)
[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (2479 ms total)
[ PASSED ] 2 tests.
Run the client of temp-check-service (aka temp check client):
tcc
result:
Current temperature is: 22.437 C