Let’s start it up and check that everything works
At this point you have already assembled the chassis, placed the the power and control modules on it, connected the modules together and plugged a Raspberry Pi Zero and a boblock card in the corresponding slots of the motherboard.
You also know the IP address of the Raspberry on your network. You can do this in many ways, but the easiest is to configure your router or Access Point to assign a fix IP address to the Raspberry's MAC address.
Now we are ready to check that everything works.
I2C
The WBUS connects the Raspberry and the boblocks through the I2C bus. The Raspberry acts as the I2C master while the boblocks work as slaves. Let's check that the Raspberry sees the boblocks.
The first thing is to activate the I2C interface on the Raspberry given that the default installation doesn't activate it.
Open a SSH session with the Raspberry and run Raspi-Config:
pi@wilson:~ $sudo raspi-config
And from the menu select:
5 Interfacing Options -> P5 I2C -> Enable
Call i2cdetect to detect which modules are listening on an I2C address:
pi@wilson:~ $sudo i2cdetect -y 1
If it happens, such as with Raspberry PI OS Lite, that the command i2cdetect is said not to be found then you need to install the following:
pi@wilson:~ $sudo apt-get install i2c-tools -y
The response should look like this:
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- 08 -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Address 8 is that of the motor module and therefore the above result indicates that the Raspberry sees that module.
Wilson
The compilation of the Raspberry software generated the executable ~/bin/wilson. When it is called from the command line the program shows some system information:
pi@wilson:~ $wilson --info
The response should be:
Wilson version 01.00.00-2020.02.23-162020 MAC WLAN0 B8:27:EB:6E:A5:70 IP WLAN0 192.168.3.50 Module at I2C addr 8 Name: WILSON motor Version: 1.00
In addition to the SW version, the IP and MAC addresses of the Raspberry, the outcome is saying that the module at I2C address 8 is the motor controller and that its version is 1.00.
Now it is time to test the full thing. Run the program without parameters to get the WEB server started and ready to listen the WEB app commands.
pi@wilson:~ $wilson MAC WLAN0= B8:27:EB:6E:A5:70 IP WLAN0= 192.168.3.50 GPIO 23 set as out GPIO 24 set as out motor_connect YES WEB server at 192.168.3.50:4096 WEB server process running Wilson>
WEB app
Open the browser on your mobile and enter as URL the IP address shown by the command wilson.
The WEB app looks like this:
Use the blue button like a joystick to make the vehicle move.
With all this we have completed the baseline configuration. On top of it we will add the rest of the features.