Robobot install on Raspberry
Back to Robobot B
Raspberry installation notes
Raspberry Pi recommended 64-bit OS is Debian GNU/Linux 13 (trixie) (2025)
Install Raspberry on blank SD-card
Use Raspberry Pi Imager (download from https://www.raspberrypi.com/software/)
rpi-imager
Select operating system 'Raspberry Pi OS (64bit)' and storage, an empty SD-flash of at least 16GB.
Next
Edit settings: set:
- Hostname (e.g. robobot)
- Username (local) and password (remember to spell the password correctly).
- SSID (DTUdevice), and associated password
- Time zone (Europe/Copenhagen)
- Danish keyboard
- In Services, enable SSH.
Then yes, yes.
When finished, mount the SD into the Raspberry Pi
Get in contact with Raspberry
If everything is configured as above, you just need to determine the IP. On a Linux computer, you can find the Raspberry Pi's IP address using (if on the same local network):
sudo apt install net-tools nmap nmap -sP 192.168.2.0/24
else
You need a screen and keyboard.
Log on to the Raspberry Pi
$ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
...
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
...
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.197.217.175 netmask 255.255.252.0 broadcast 10.197.219.255
inet6 fe80::f620:b431:69cc:44f4 prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:f4:0e:a4 txqueuelen 1000 (Ethernet)
RX packets 486 bytes 41505 (40.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 421 bytes 43403 (42.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
In this case, the IP4 (inet) is 10.197.217.175.
If you don't get an IP address, the Wi-Fi may not be set correctly (see the Network setup).
Additional packages
Install the following packages:
libreadline-dev libopencv-dev libgpiod-dev gpiod cmake subversion aptitude telnet ntp (better use timesyncd) ntpdate (--) nmap lsof libpaho-mqtt-dev libpaho-mqttpp-dev (if not available, then not needed) python3-paho-mqtt python3-opencv python3-setproctitle mosquito mosquitto-dev mosquitto-clients libusb-dev libcli11-dev (maybe not available) sudo apt install libreadline-dev libopencv-dev libgpiod-dev gpiod cmake subversion aptitude telnet nmap lsof python3-paho-mqtt libpaho-mqtt-dev python3-opencv python3-setproctitle mosquitto mosquitto-dev mosquitto-clients libusb-dev libcli11-dev
and, if libcli11-dev is not available
Install command line interface library (if not found by 'apt install libcli11-dev')
cd cd git git clone https://github.com/CLIUtils/CLI11.git
The library is 'header-only', and the makefile for Raspberry looks in ~/git/CLI11 for the file, so no need to build.
Configure Mosquitto
At installation, the Mosquitto server does not allow remote access.
A complete configuration file can be found here: https://github.com/eclipse-mosquitto/mosquitto/tree/master
Only two options are needed, so we make a set of local options:
sudo nano /etc/mosquitto/conf.d/robobot.conf
Insert these lines (insert from clipboard is Ctrl+Shift+v in nano)
listener 1883 allow_anonymous true
Save and restart mosquito
sudo service mosquitto restart
More details here MQTT_and_Mosquitto
Configure serial port /dev/ttyACM0
At times, a serial port echoes what is received. This creates an endless loop, as the Teensy sends a reply, if something is not understood. This is a configuration of the port; see the settings using stty:
stty -a -F /dev/ttyACM0 speed 9600 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0; -parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon iexten -echo -echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
Especially echo (last line) must have a '-' in front. However, other types of handshake, such as 'ixoff', should be disabled as well. This can all be set by:
stty -F /dev/ttyACM0 raw -echo -echoe
When installing the udev rule for Teensy devices, then the above command is executed when a Teensy device is detected. See Arduino_and_Teensy_libraries#Add_Teensy_board_support.
The udev rule is included in robobot/setup directory as 00-teensy.rules, is should be copied to /etc/udev
sudo cp ~/svn/robobot/setup/00-teensy.rules /etc/udev/rules.d/
The file contains
# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/ # # The latest version of this file may be found at: # http://www.pjrc.com/teensy/00-teensy.rules # # This file must be placed at: # # /etc/udev/rules.d/00-teensy.rules (preferred location) # or # /lib/udev/rules.d/00-teensy.rules (req'd on some broken systems) # # To install, type this command in a terminal: # sudo cp 00-teensy.rules /etc/udev/rules.d/00-teensy.rules # # After this file is installed, physically unplug and reconnect Teensy. # ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1" ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789a]*", ENV{MTP_NO_PROBE}="1" KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666", RUN:="/bin/stty -F /dev/%k raw -echo" KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666" SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", MODE:="0666" KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", MODE:="0666" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", MODE:="0666" # # If you share your Linux system with other users, or just don't like the # idea of write permission for everybody, you can replace MODE:="0666" with # OWNER:="yourusername" to create the device owned by you, or with # GROUP:="somegroupname" and manage access using standard Unix groups. # # ModemManager tends to interfere with USB Serial devices like Teensy. # Problems manifest as the Arduino Serial Monitor missing some incoming # data, and "Unable to open /dev/ttyACM0 for reboot request" when # uploading. If you experience these problems, disable or remove # ModemManager from your system. If you must use a modem, perhaps # try disabling the "MM_FILTER_RULE_TTY_ACM_INTERFACE" ModemManager # rule. Changing ModemManager's filter policy from "strict" to "default" # may also help. But if you don't use a modem, completely removing # the troublesome ModemManager is the most effective solution.