-
-
Notifications
You must be signed in to change notification settings - Fork 79
Appendix Q Using Non Raspberry Pi Hardware
Genmon was originally tested with the Raspberry Pi platform however nothing in it's design is inherently tied to the Raspberry Pi. As mentioned in this article genmon has some basic requirements and the file system support makes assumptions that the underlying operating system is Linux. Since most of the genmon documentation is geared toward the Raspberry Pi and the operating system is assumed to be the Raspberry Pi Operation System (formally know as Raspbian, or a Debian based linux distribution specifically for hte Raspberry Pi), this page is dedicated to using genmon with other non Raspberry Pi and the Linux distribution that supports the platform.
- WARNING - currently, none of the extensions or functionality that uses digital inputs/outputs on the GPIO will work as the RPi.GPIO library is Raspberry Pi only, it throws an exception if it detects a non-Raspberry board.
- I2C, SPI, and 1-Wire do not appear to use the RPi.GPIO library, so add-ons using those MIGHT work if the pins are available, but some boards have a subset of the 40-pin connector.
- Pin mappings and function indexes (GPIO-07 vs GPIO-04, UART0 vs UART2, I2C-0 vs I2C-1) may be different even if the pins are physically in the same location.
- Raspberry Pi OS adds the default user to a ton of groups that provide all GPIO related access, these permissions are not typically granted on any other OS.
The following setup was used with the NanoPi Neo Plus 2 using DietPi for the operating system.
-
Download dietpi for the NanoPi Neo Plus 2 from here:
-
Load the NanoPi Neo Plus 2 image on an SD card with the Raspberry Pi Imager app using the option for a user specified image
-
boot the NanoPi and log in as root, let the install of the operation system finish by updating the operating system software
-
The install script informed me that the serial device (/dev/ttyS0) was enabled and I allowed it to remain enabled
-
Restarted and used dietpi-config (Advanced Options->Serial UART) to configure the serial port and set ttyS0 to NOT use the console
-
Logged in as the dietpi user, ran the genmon setup per the standard install, do not setup the serial port with the script
-
Modify the /etc/genmon/genmon.conf file to use /dev/ttyS0 instead of /dev/serial0 for the serial device. If you do not modify the config file before starting genmon, the software will not be able to open the non-existent serial device and will exit.
The main difference in alternative Raspberry Pi hardware is the peripherals, specifically serial, I2C, SPI, Bluetooth and GPIO. The Raspberry Pi OS comes with a program named raspi-config to help manage peripherals and other system settings. For DietPi the program that does this is named dietpi-config. Using the operating system supplied program to modify configuration files to enable or disable peripherals is the preferred method for managing the build in I/O on these devices.
If you plan on using the PintSize.me HAT the pin numbers for the UART may not match. The remainder of this page describes using the HAT with NanoPi.
Most non-Rasperry Pi's use usernames other than pi. You can use the default, or if you want to change it you can use the following lines. If you do, you may have to adjust other commands in provided scripts. If you want to change the username, it is highly recommended to do it before doing any other changes as if the account is in use it cannot be renamed.
usermod -l mynewusername -d /home/mynewusername -m myoldusername
groupmod --new-name mynewusername myoldusername
- login as root
- execute
sed -Ei 's/^(overlays=.*)/\1 uart1/' /boot/armbianEnv.txt
to enable UART1 - execute
cat /proc/tty/driver/serial
to verify that it is enabled, a reboot may be required and this can be run later
Some users have reported issues installing the Cryptography module. If Cryptography doesn't install correctly or get recognized during the genmon install use the following steps to correct the issue.
- execute
apt install -y git build-essential cargo gfortran libffi-dev libopenblas-dev libssl-dev openssh-client python3-dev python3-pip
- upgrade pip to a newer version
pip3 install --upgrade pip
- install pyopenssl which will compile cryptography, this can take up to 60 minutes.
pip3 install pyopenssl
usermod -a -G sudo,dialout dietpi
- Select NO when genmon asks to configure the serial port.
- When it comes time for the serial test, execute with the correct serial port.
~/genmon/OtherApps/serialtest.py /dev/ttyS1
- After the install finishes, update
sudo nano /etc/genmon/genmon.conf
and set the port line toport = /dev/ttyS1
- edit
/boot/hw_intfc.conf
- update
intfc:uart2=off
tointfc:uart2=on
- comment the line
intfc:dtoverlay=console-on-ttyS2
- update
- edit
/boot/extlinux/extlinux.conf
- remove
console=ttyFIQ0,1500000n8
andconsole=ttyS2,1500000n8
from the line that looks like:append earlyprintk console=ttyFIQ0,1500000n8 rw init=/sbin/init rootfstype=ext4 rootwait root=UUID=783271c5-9845-49fd-819f-a09107a2ec9d console=ttyS2,1500000n8
- remove
sudo usermod -a -G tty,dialout rock
- Select NO when genmon asks to configure the serial port.
- When it comes time for the serial test, execute with the correct serial port.
~/genmon/OtherApps/serialtest.py /dev/ttyS2
- After the install finishes, update
sudo nano /etc/genmon/genmon.conf
and set the port line toport = /dev/ttyS2