Skip to content

Configuring the Server and Client

Shreyas Ramakrishna edited this page Feb 19, 2019 · 7 revisions

Configuring RPi3 (server) for DeepNNCar

The following section may be skipped if the RPi3's SD card has already been configured to support the functionalities of DeepNNCar. However, for a new setup of RPi3, the following steps will have to be followed and it will require a mouse, computer, and a monitor.

Installing Raspbian OS

An instance of Raspbian must be downloaded and installed on the SD card. There are several interfaces available online. An image of the Raspbian Stretch Desktop is recommended. Follow the installation guide at
https://www.raspberrypi.org/documentation/installation/installing-images/README.md

The initial boot will require the default username and password. To protect against attacks, it is highly advised to change the password. Follow the steps at https://www.raspberrypi.org/documentation/linux/usage/users.md to properly sign in and change the password.

Connecting to WPA-Enterprise

There are two ways of connecting to the WiFi, (1) The Raspbian desktop version has a desktop option to connect to the WiFi, sometimes this is not visible directly on the desktop. Then open a new terminal and type sudo raspi-config, this will open a config window, then from this select network option, and then enter the Wifi SSID and password, (2) However, if you do not have the desktop version or you do not have a monitor, then open wpa_supplicant.conf (/etc/wpa_supplicant/)} with admin privileges (sudo). Then paste the following text with appropriate changes to the identity and password fields.

Network = {

    	ssid="University Wifi"
    	proto=RSN
    	key_mgmt=WPA-EAP
    	pairwise=CCMP
    	auth_alg=OPEN
    	eap=PEAP
    	identity="username"
    	password="password"
    	phase1="peaplabel=0"
    	phase2="auth=MSCHAPV2"
    	priority=1

    } 

Follow any one of the above steps to configure the WiFi on RPi3.

Enabling SSH

Enabling SSH will give the user terminal access to the RPi3 from a remote desktop, and it will allow the user to run scripts on the RPi3. Follow the guide at https://www.raspberrypi.org/documentation/remote-access/ssh/ to enable SSH on RPi3. To SSH into RPi3, you will have to know the IP address of the device. This can be found by connecting RPi3 to a monitor and then typing the command ifconfig in a terminal which will return the IP address of the RPi3. Kindly make a note of the IP address of RPi3 as we require it to set up our server-client communication. Use the following installation command to ssh into the RPi3.

sudo ssh username@IP

It is recommended to use ubuntu xenial 16.04/ 18.04 for the remote desktop using ssh to connect to RPi3, however, you could also use putty on windows to connect to the RPi3.

Now type in the above command in a remote desktop terminal using the appropriate username and IP address of the RPi3. By default, username is "pi". You should then be prompted to enter the password for the "pi" login. By default, this password is "raspberry"; however, for security reasons this password should be changed.

Installing Software Packages

Install the following packages and dependencies

sudo apt-get install python3
sudo apt-get install python3-pip

Follow the link to download the Raspbian stretch image and copy it onto an SD card.

https://www.raspberrypi.org/documentation/installation/installing-images/

Follow the link to install OpenCV 3.4

https://www.alatortsev.com/2018/04/27/installing-opencv-on-raspberry-pi-3-b/

Install Tensorflow v1.9

sudo apt install libatlas-base-dev
pip3 install tensorflow

Install the latest version of keras

sudo apt-get install python3-numpy
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
sudo apt-get install python3-dev 
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
sudo apt-get install python3-setuptools
sudo apt-get install python3-scipy
sudo apt-get update
sudo apt-get install python3-h5py
sudo pip3 install keras 

Follow the link to install pigpio library for configuring the hardware interrupts.

http://abyz.me.uk/rpi/pigpio/download.html

Install ZeroMQ (ZMQ) package with python bindings using the following installation commands.

  sudo apt-get install python-dev
  sudo pip install pyzmq

Installations on the client (Desktop/ Laptop)

We recommend the use of Ubuntu 18.04 (on Virtual Machine or Ubuntu installation) for training the CNN and performing autonomous driving experiments on the client. However, the data collection mode would require windows installation as the scripts used to configure Xbox one controller is compatible with windows.

Note: Currently, we are working towards utilizing a mouse to perform the driving (with continuous steering) for the data collection mode.

Installing Ubuntu on Virtual Machine

We require the client to have a windows installation with Virtual Machine (VM) running Ubuntu 18.04. To get the Virtual machine setup, first, download the VM from the link https://www.virtualbox.org/.

After downloading the VM, you need to download an image of Ubuntu 18.04 from the Ubuntu website using the following link https://www.ubuntu.com/download/desktop. Once you have the image downloaded, then you can follow the instructions in the link http://www.psychocats.net/ubuntu/virtualbox to setup the Ubuntu virtual environment required for the experiments.

Installing other software packages

Tensorflow, Keras, ZMQ and OpenCV packages have to be installed on the client. Tensorflow and keras are required for training and validating the CNN, OpenCV for pre-processing the images before training, ZMQ for communicating with the server (RPi3). It is also important to have the same versions of these libraries on both the server and the client.

Note: It is important to have same versions of Tensorflow and keras on both the server and client. As the trained CNN model from the client is going to be used in RPi3 for predictions, it is important to have matching versions. We had problems with backward compatibility, i.e. we trained the CNN on a higher version and tried to run it on RPi3 with a lower version which did not work.

Starting DeepNNCar

Once the proper peripheral devices are connected and the wiring is correct, connect the battery to the ESC XL5 via the high current wires. Then connect the RPi3 to its power supply. Within a few seconds, you should see a flashing GREEN light, indicating the RPi3 is booting. Then hold the button on the ESC XL5 for a few seconds until a flashing GREEN light appears. The TQ Top Qualifier Receiver should also display a solid RED light.

After checking the hardware configuration and if you have followed the software installations as discussed above, then you are successfully ready to use DeepNNCar!

Clone this wiki locally