Part 3 – Starting the Services
Now we are ready to manually launch the delta5 server. We want to manually launch the service to see if there are any errors printed out or any nodes not being detected. We will do some additional configuration changes such as editing the admin username and password, and changing the default web server port.
First, lets make sure the delta5 service is not running from the previous service created in systemctl.
sudo systemctl stop rotorhazard.service
Now, lets navigate to the server directory and manually launch the delta5 server.
Now start the delta5 service.
sudo python server.py
Some common issues you may run into are missing packages or database issues. If you have issues starting the delta5server, I suggest you try deleting the database file first, database.db in the server directory. To do this, make sure you are in the server directory.
sudo rm database.db
Then try restart the service. Additional common errors relate to the I2C baud rate being too high. If you are getting [Errno 121] Remote I/O Errors, this is most likely the cause. You need to change the baud rate of the I2C bus. To do this, edit your boot config
sudo nano /boot/config.txt
This will force the I2C bus to run at a baud of 75000.
Lastly, if you are getting errors relating to the Neopixel libraries being incompatible or something along those lines (cant remember the exact error), then follow this article. This was the latest issue I ran into with the latest version I had run on the timer when this article was published, and also the image attached at the end of this article. The following link solved my problem. If you have any other questions or issues don’t hesitate to post in the comments.
Updating the Timer
To update the your installation of Delta 5, we need to remove the old directory and re clone the GIT.
cd ~ sudo rm RotorHazard
Now we re clone and unzip the new RotorHazard source. We need to find the latest version of the RotorHazard fork and replace the version in the text below before cloning. Where 1.1.2 marks the current version, visit the RotorHazard latest releases page for more information on the latest release and replace 1.1.2 with the version you want to clone. In this case we use 1.1.2, the latest version at the time this article is updated.
cd ~ wget https://codeload.github.com/RotorHazard/RotorHazard/zip/v1.1.2 -O temp.zip unzip temp.zip mv RotorHazard-1.1.2 RotorHazard rm temp.zip
Now, restart the RotorHazard service.
cd RotorHazard/src/server sudo python server.py
Additional updates to the server components can be performed by running the command below. The above method will only clone the server contents, such as the base python files and the web server files. It will not update the scons and other core server dependencies. I highly suggest doing a backup of your PI image before continuing onto this step.
cd /home/pi/RotorHazard/src/server sudo pip install -r requirements.txt
Links & References
Ready to flash Image!
Below is a image I have created which is pre-configured with the latest version of RotorHazard timer software and is also running the hostapd WiFi hotspot. This is a clean image with no errors so assuming you have all hardware setup correctly, you can flash this image to your PI SD card and just boot the race timer! Connect to it via WiFi, and browse to the IP with your web browser.
Firstly, download and install Win32 Disk Imager.
Now, before running win32, insert a blank SD Card into your computer. Now launch win32 Disk Imager.
Now, select the downloaded and extracted .img file to be flashed. Also select the path of your MicroSD card, be sure to get this right! Now hit write. This will write the image to the SD and when complete, you can just throw the SD into the PI and boot!
Pre-Build RotorHazard Image (Ready To Flash)
RotorHazard v1.1.2 Race Timer IMG – Updated 10.06.19 version 1.1.2
Image Details (Advanced Users):
SSH Enabled I2C Enabled SPI Enabled UART 1 Enabled (Serial UART in case you f&*% something up!) Use pins 8 & 10 Hostapd configured for wlan0 only. eth0 on DHCP
Default Usernames and Passwords:
SSID: racetimer Password: rotorhazard Static IP: 192.168.10.1 Web Login: Username: admin Password: rotorhazard Web server port: 80 Raspbian SU Login (default): Username: pi Password: rotorhazard (I suggest changing this, if you have others connect to the timer as you have SSH enabled. Type passwd in CLI.)
MD5 Hash: 00cdacbe97a0d0222b2e71b9aff5de3c
On the next page, we will look at backing up your current PI image file. If you have everything working perfectly then its a good idea to back it up before doing any major updates, or just in case your SD fails!