SW packages required
Before installing the Wilson SW some packages are needed.
We assume that the starting point is a Raspberry Pi Zero with Raspbian installed, the graphic interface disabled, Internet connection available and the SSH service enabled.
Open an SSH session and copy and paste into the console the commands in the following sections.
FTP server
The FTP server is part of the development environment although not used at runtime. Type the following comand into the console to install vsftp:
pi@wilson:~ $sudo apt-get install vsftpd -y
Once the installation is finished, edit the configuration file
pi@wilson:~ $sudo nano /etc/vsftpd.conf
and include the following settings (to allow ftp access only to local users giving them write permission):
• anonymous_enable=NO• local_enable=YES• write_enable=YES• local_umask=022
Apache
We need a WEB server for the WEB app to be used as remote control of the vehicle. To keep things simpler, we host the WEB server in the Raspberry so we don't need to look for a server in the cloud. Install Apache by running the following command:
pi@wilson:~ $sudo apt-get install apache2 -y
Once installed, edit the configuration file:
pi@wilson:~ $sudo nano /etc/apache2/sites-available/000-default.conf
and change the default directory (DocumentRoot) as follows:
...DocumentRoot /var/www
Finally, we add the user www-data to the list of sudoers to grant Apache server with the permissions needed. Edit the /etc/sudoers file:
pi@wilson:~ $sudo nano /etc/sudoers
and add the following:
...# Add www-datawww-data ALL=(ALL) NOPASSWD: ALL
PHP
Install PHP 7.3:
pi@wilson:~ $sudo apt-get -y install php7.3
and the following packages:
pi@wilson:~ $sudo apt-get -y install libapache2-mod-php7.3
With this we have finished with the packages. Restart the Apache server to ensure that the changes are applied:
pi@wilson:~ $sudo /etc/init.d/apache2 restart[ ok ] Restarting apache2 (via systemctl): apache2.service.
SW installation
Setting the environment
First, we create some directories, including the bin for the executables and add it to the PATH.
Copy and paste the following commands into the SSH console:
pi@wilson:~ $cd ~;mkdir bin;mkdir logs;mkdir wilson;mkdir downloads
Add the bin directory created to the PATH:
pi@wilson:~ $export PATH=$PATH:~/bin
Wilson program installation
Download the tarball with the software in source code:
pi@wilson:~ $wget http://www.iambobot.com/downloads/wilson_c.tar.gz -O ~/downloads/wilson_c.tar.gz
Unzip the file we just downloaded:
pi@wilson:~ $tar -C / -xvf ~/downloads/wilson_c.tar.gz
Run the winstall script that came within the tarball to compile the code:
pi@wilson:~ $winstall
WEB app
Just like we did for the SW in C, download and unzip the tarball with the HTML code of the WEB app.
pi@wilson:~ $wget http://www.iambobot.com/downloads/wilson_web.tar.gz -O ~/downloads/wilson_web.tar.gz
Unzip the file just downloaded:
pi@wilson:~ $sudo tar -C / -xvf ~/downloads/wilson_web.tar.gz