Guide Thymio Raspberry

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 4

Guide for Thymio, Raspberry and Python
Benjamin Bocquillon
June 29, 2018
1 Thymio, Raspberry, and Python
This is what you need to follow this manual:
Thymio II with cable
Raspberry Pi 2
External battery with cable
Empty Micro SD
Dongle WI-FI or Ethernet Cable
Figure 1: Requested object
2 Connect Thymio to a computer
This wiki page aggregates the configurations needed to use Raspberry 3 to control Thymio II robot.
First of all you need to install Raspberry Pi Operating System. You can install NOOBS on the
SD card and follow the instructions in order to install Raspbian on the SC card.
Remember the default login username and password:
username: pi
password: raspberry
3 Initial Configuration
After that, launch raspberry configuration tool using sudo raspi-config (in case it is the first boot of
the OS, the configuration tool will be shown automatically) and make the following configurations:
Expand filesystem
1
Internationalization Options
Locale en_US.UTF-8 UTF-8
Time zone: Europe >Amsterdam
Keyboard Layout: choose Generic 105-keys (intl) PC>Other>choose your keyboard
language
Advanced Options
Set the desired hostname (testthymio in our case)
Enable SSH server
Disable the login shell accessibility over serial (by other words, select option "No" on
the serial menu)
enable the camera
Then Reboot Raspberry Pi:
sudoreboot
4 SSH and VNC server Configuration
On file /etc/ssh/sshd_config make the following changes (using an editor like nano or vim. Do
not forget to edit as super user - using sudo):
Uncomment line regarding the use of public keys (AuthorizedKeysFile %h/.ssh/authorized_keys)
Uncomment line regarding GSSAPI Authentication (GSSAPIAuthentication no) in order to
remove lag from ssh login
Add "UseDNS no" on the end of the file
4.1 ENABLING VNC SERVER GRAPHICALLY
On your Raspberry Pi, boot into the graphical desktop.
Select Menu > Preferences > Raspberry Pi Configuration > Interfaces.
Ensure VNC is Enabled.
4.2 ENABLING SSH SERVER GRAPHICALLY
On your Raspberry Pi, boot into the graphical desktop.
Select Menu > Preferences > Raspberry Pi Configuration > Interfaces.
Ensure SSH is Enabled.
5 Network Configuration
Disable IPv6
To disable, edit a file: sudo nano /etc/sysctl.conf
Add the following line:
net.ipv6.conf.all.disableipv6=1
For the change to take effect without rebooting:
sudo sysctlp
2
6 Connect Raspberry to eduroam University Network
I put this content inside /Etc/wpa/supplicant/wpasupplicant.conf (make sure you update your
password and identity)
country=GB
ctrlinterface =DIR =/var/run/wpasupplicantGROUP =netdev
updateconfig = 1
network= ssid="eduroam"
keymgmt =WPAEAP
pairwise=CCMP
group=CCMP TKIP
eap=PEAP
identity="<username>@oslomet.no"
domainsuffixmatch = ”radius.hioa.no
phase2="auth=MSCHAPV2"
password="<your password here>"
I then reloaded the Interface by issuing:
wpacli iwlan0reconfigure
7 Installing Thymio’s control program
First of all Update and Upgrade everything present inside the Raspberry:
sudoapt getupdate
sudoapt getupgrade
In order to install D-Bus run the following command:
sudoapt getinstalldbus − ∗dev
8 Controlling Thymio II robot
At this point, you should be able to control the thymio through raspberry. In order to be able to
start D-Bus on raspberry with X11 you have to access the Raspberry with the following command
(this works for Linux and Mac OS; on Windows you need to download and install Xming)
ssh Xpi@P IADDRESS
To start aseba in order to communicate with the thymio II you need to run the command:
asebamedullaser :name =T hymio II
Transfer the code that you want to run to the Raspberry and run it. The example needs to
install also gobject library:
sudoapt getinstallpython gobject
Now you can run the example:
pythontest.py
8.1 Control the camera with Python
It is also possible control the camera installed on Raspberry with Python. This code takes a picture
and saves it in the Raspberry memory:
importpicamera
3
camera =picamera.P iCamera()
camera.startpreview()
time.sleep(2)
camera.capture(0image.jpg0)
If you press "f" after runs test.py the camera will take a picture.
9 Controlling Thymio II robot from your own laptop
After enabling VNC on the Raspberry PI, download VNC viewer from your laptop. Besides, you
have to be connected on the same network. After installing VNV viewer, you have to enter the IP
adrress of the Raspberry Pi, VNC will ask you the username and the password of the Raspberry.
4

Navigation menu