This post is a follow up of starting up with RIOT-OS. To be able to develop with RIOT-OS an easy (and easier) way to do so is just to install docker and web UI docker interface Portainer to control docker.
Installing Docker and Portainer, is an initial stepping stone for using the dockerized development environment for RIOT-OS, since I don’t want to install all the development environments in my machine.
On Arch-Linux is as simple as installing the Docker package using pacman, enabling the services and rebooting.
Basically we need to run, as root the following commands:
pacman -S docker systemctl enable docker.service reboot
After rebooting the following command should return some information
A sample output is:
Containers: 2 Running: 0 Paused: 0 Stopped: 2 Images: 9 Server Version: 18.09.0-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog ... ... ...
Installing the Docker Portainer Web UI is as simple as:
docker pull portainer/portainer
To run Portainer a set of complete instructions on this page, but basically on the simplest way is:
$ docker volume create portainer_data $ docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
We can now check if the docker image is up:
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7a38ae7fc922 portainer/portainer "/portainer" 4 seconds ago Up 3 seconds 0.0.0.0:9000->9000/tcp portainer
Since I have already ran the Portainer container, the initial setting up steps when accessing the URL HTTP://localhost:9000 do not appear, but we need to choose:
- A set of credentials to use as de administrator for portainer
- The local machine registry to connect to the local docker containers.
1- At initial access we define an user and password:
2- Then we connect to our local docker instance:
Press Connect and then we can now access our Docker instance from Portainer:
Pressing the Local Docker Connection we can now manage our docker resources.
Installing the build environment for RIOT-OS
We can do it by two ways:
From the command line:
docker pull riot/riotbuild
This container is very big, so we need to wait some time for the container image download. The command line shows in greater detail the download process.
After the image is downloaded, we can follow these instructions for building our apps using the docker container as the build environment.
After the image is installed:
To use is is as simple as going the the examples directory and do:
From this we are now able to build based RIOT-OS applications for several targets, including the ESP8266/ESP32.
As we can see we even don’t need to have a running container, just the image.