Mods
EtienneAr edited this page May 17, 2023
·
2 revisions
Optional accessories and tips for Upkie.
To configure a secondary Wi-Fi access, e.g. using a USB dongle:
- Configure the network you want to connect to in /etc/wpa_supplicant/wpa_supplicant.conf
- Add the following lines to /etc/dhcpcd.conf
# USB wireless dongle
interface wlan1
hook wpa_supplicant
- Run the following command:
$ sudo wpa_supplicant -iwlan1 -D wext -c/etc/wpa_supplicant/wpa_supplicant.conf
Raspberry Pi don't have anyway to keep the datetime after power off, and usually rely on internet connection to set the datetime at each boot. This mod proposes a solution to keep the datetime (even when powered on), without requiring any internet connection. It is useful mostly for having meaningful logs with appropriate datetime stamps.
It relies on a DS3231 chip/module, that need to be wired appropriately (i.e. powered and connected to I2C bus). To configure the raspberry, do the following:
- Enable the I2C bus:
sudo raspi-config
# Interfacing Options –> I2C –> enable
- Edit configuration file
/boot/config.txt
:
sudo nano /boot/config.txt
# add the following line at the end of the file
dtoverlay=i2c-rtc,ds3231
- Edit
/lib/udev/hwclock-set
:
sudo nano /lib/udev/hwclock-set
and comment the 3 following lines:
# if [ -e /run/systemd/system ] ; then
# exit 0
# fi
- Reboot
sudo reboot
- Check the datetime on the raspberry (and set it eventually) :
date
# To set the datetime use
date -s 2023-05-17T17:46:02+02:00
# To read it from another linux machine use
date --iso=seconds
- Write the time on the RTC clock
hwclock -w
# Check that the write worked by reading it
hwclock -r #Should display the correct datetime
- Set the datetime automatically at boot
sudo nano /etc/rc.local
# Add the line
sudo hwclock -s