Board: OrangePi 5 (RS3588S), 8GB, NVMe 256GB Author: DroZDi Version/Date: 25.03.2023 OS: Armbian 23.02 Jammy (Ubuntu) !!! All commands executed from orangepi user (local user) !!! ======================================== Content: 1. OS install 2. NVMe (optional) 3. Update/Upgrade OS 4. VNC 5. GPS (UART0_M2) 6. I2C (I2C5_M3) 7. RTL SDR 8. SDR PLAY 9. SDR++ 10. GQRX 11. AIS catcher 12. FLDIGI 13. ADAFRUIT BLINKA 14. OPENPLOTTER SETTINGS 15. OPENPLOTTER I2C 16. OPENPLOTTER PYPILOT 17. OPENPLOTTER SDR VHF ======================================== 1. OS install Download Armbian image from https://www.armbian.com/orangepi-5/ -> Armbian 23.02 Jammy Gnome burn microSD card with (RasberryImager or other tool) root password, local user (orangepi), wifi connection 2. NVMe If you dont have NVMe disk installed in OrangePI 5 please go to the point 3 sudo fdisk -l to see: Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors Disk model: PC SN740 NVMe WD 256GB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 877C362B-7F67-BD44-88B5-32E58EE7FCC7 Device Start End Sectors Size Type /dev/nvme0n1p1 32768 557055 524288 256M Linux extended boot /dev/nvme0n1p2 557056 14991326 14434271 6.9G Linux filesystem sudo gdisk /dev/nvme0n1 p (print) d 1 w Y sudo gdisk /dev/mtdblock0 p (print) if empty nothing if partitions exist: d 1, d 2, etc to delete all of them w Y sudo nand-sata-install -> Install/Update the bootloader on SPI Flash (MTD flash) sudo fdisk -l /dev/mtdblock0 Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: D4DE76D7-0655-45E6-A437-6DDE355CD733 Device Start End Sectors Size Type /dev/mtdblock0p1 64 7167 7104 3.5M Linux filesystem /dev/mtdblock0p2 7168 7679 512 256K Linux filesystem /dev/mtdblock0p3 7680 8063 384 192K Linux filesystem /dev/mtdblock0p4 8064 8127 64 32K Linux filesystem /dev/mtdblock0p5 8128 8191 64 32K Linux filesystem /dev/mtdblock0p6 8192 16383 8192 4M Linux filesystem /dev/mtdblock0p7 16384 32734 16351 8M Linux filesystem copy Armbian image to for exmaple /home/orangepi/work (scp/ftp) cd /home/orangepi/work sudo dd bs=1M if=Armbian_23.02.2_Orangepi5_jammy_legacy_5.10.110_gnome_desktop.img of=/dev/nvme0n1 status=progress sudo shutdown -h now remove microSD card reboot once system starts insert microSD card perform initial setup as in point 1 sudo tune2fs -U random /dev/mmcblk1p2 remove microSD card 3. Update/Upgrade OS sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia sudo apt update sudo apt dist-upgrade sudo apt install mali-g610-firmware rockchip-multimedia-config sudo apt update && sudo apt upgrade -y sudo apt-get autoremove sudo apt clean sudo apt-get autoclean sudo apt-get full-upgrade sudo apt-get dist-upgrade reboot sudo apt-get install build-essential sudo apt-get autoremove sudo apt clean sudo apt-get autoclean reboot NVMe disk speed test -> if NVMe not installed please skip this step sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash Category Test Result HDParm Disk Read 318.26 MB/s HDParm Cached Disk Read 359.68 MB/s DD Disk Write 227 MB/s FIO 4k random read 86779 IOPS (347118 KB/s) FIO 4k random write 31950 IOPS (127800 KB/s) IOZone 4k read 71866 KB/s IOZone 4k write 97505 KB/s IOZone 4k random read 47349 KB/s IOZone 4k random write 75171 KB/s Score: 20095 4. VNC sudo apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme dbus-x11 xfce4-goodies sudo apt-get install xfonts-base sudo apt-get install tightvncserver sudo apt-get install tigervnc-tools sudo apt-get install xterm touch ~/.Xresources create start vnc script vnc_start.sh: #!/usr/bin/bash vncserver :1 -localhost=no in /home/orangepi/.vnc adjust script xstartup: #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS /usr/bin/startxfce4 [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources x-window-manager & start vnc -> ./vnc_start.sh vncviewer adres_ip:5901 to connect remotely 5. GPS (UART0_M2) GPIO pinout -> http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html enabling /boot/armbianEnv.txt add/change line: overlays=opi5-uart0-m2 (as root) Pins: 2,8,10,14 Pins 4 and 6 used by Cooler/Fan GPS BN-880Q pins in face, starting from left to right: SDA GND TX RX 5V SCL and as above SDA -> 3 not used SCL -> 5 not used 5V -> 4/2 GND -> 6/14 RX -> 8 TX -> 10 X 14 10 8 2 X sudo apt-get install gpsd gpsd-clients minicom sudo adduser orangepi dialout Create a new file in /etc/udev/rules.d called 99-gps.rules with the following: KERNEL=="ttyS0", SYMLINK+="gps0",GROUP="dialout", MODE="0660" sudo reboot (sudo) cat /dev/gps0 should give output sudo systemctl stop serial-getty@ttyS0.service sudo systemctl disable serial-getty@ttyS0.service $ sudo vi /etc/default/gpsd START_DAEMON="true" USBAUTO="false" DEVICES="/dev/gps0" GPSD_OPTIONS="-n" GPSD_SOCKET="/var/run/gpsd.sock" chmod 444 /etc/default/gpsd sudo gpsmon sudo cgps -s sudo cgps -um 6. I2C (I2C5_M3) GPIO pinout -> http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5.html enabling in /boot/armbianEnv.txt add: overlays=opi5-i2c5-m3 (as root) Pins: 1,3,5,9 sudo apt install i2c-tools -y root@orangepi5:~# ls -ltr /dev/i2* crw-rw---- 1 root i2c 89, 0 Mar 25 21:55 /dev/i2c-0 crw-rw---- 1 root i2c 89, 9 Mar 25 21:55 /dev/i2c-9 crw-rw---- 1 root i2c 89, 10 Mar 25 21:55 /dev/i2c-10 crw-rw---- 1 root i2c 89, 5 Mar 25 21:55 /dev/i2c-5 crw-rw---- 1 root i2c 89, 2 Mar 25 21:55 /dev/i2c-2 crw-rw---- 1 root i2c 89, 7 Mar 25 21:55 /dev/i2c-7 crw-rw---- 1 root i2c 89, 6 Mar 25 21:55 /dev/i2c-6 root@orangepi5:~# i2cdetect -l i2c-0 i2c rk3x-i2c I2C adapter i2c-2 i2c rk3x-i2c I2C adapter i2c-5 i2c rk3x-i2c I2C adapter i2c-6 i2c rk3x-i2c I2C adapter i2c-7 i2c rk3x-i2c I2C adapter i2c-9 i2c fde50000.dp I2C adapter i2c-10 i2c ddc I2C adapter root@orangepi5:~# i2cdetect -y 5 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77 root@orangepi5:~# IMU: ICM-20948 (address 0x68, pypilot 3.2.6, SEN-15335) BMP280 - 0x77 AHT20 - 0x38 To be used later: /usr/local/lib/python3.9/dist-packages sudo pip3 install adafruit-circuitpython-ahtx0 sudo pip3 install adafruit-circuitpython-htu21d 7. RTL SDR sudo apt-get update sudo apt-get upgrade cat <no-rtl.conf blacklist dvb_usb_rtl28xxu blacklist rtl2832 blacklist rtl2830 EOF sudo mv no-rtl.conf /etc/modprobe.d/ sudo apt-get install git-core sudo apt-get install git sudo apt-get install cmake sudo apt-get install libusb-1.0-0-dev sudo apt-get install build-essential git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr/ mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON make sudo make install sudo ldconfig sudo cp ../../rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/ sudo reboot orangepi@orangepi5:~/work$ rtl_test Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001 Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 [R82XX] PLL not locked! Sampling at 2048000 S/s. Info: This tool will continuously read from the device, and report if samples get lost. If you observe no further output, everything is fine. Reading samples in async mode... ^CSignal caught, exiting! User cancel, exiting... Samples per million lost (minimum): 0 8. SDR PLAY sudo apt-get update sudo apt-get upgrade -y sudo apt install -y cmake Needed file SDRplay_RPi_Scripts_v0.3.zip --download and for 64bit change name in the script 1installationAPI.sh with SDRplay_RSP_API-ARM64-3.07.1.run (arm 64bit) next: ./1installationAPI.sh (reboot) ./2buildSoapy.sh ./4buildWidgets.sh sudo ldconfig ./4buildWidgets_3.1.5.sh sudo ldconfig in /etc/modprobe.d/no-sdr.conf blacklist sdr_msi3101 blacklist msi001 blacklist msi2500 and reboot checking connected SDRPlay devices: orangepi@orangepi5:~$ SoapySDRUtil --probe ###################################################### ## Soapy SDR -- the SDR abstraction library ## ###################################################### Probe device [INFO] devIdx: 0 [INFO] SerNo: B0002P0001 [INFO] hwVer: 1 [INFO] rspDuoMode: 0 [INFO] tuner: 1 [INFO] rspDuoSampleFreq: 0.000000 ---------------------------------------------------- -- Device identification ---------------------------------------------------- driver=SDRplay hardware=RSP1 sdrplay_api_api_version=3.070000 sdrplay_api_hw_version=1 ---------------------------------------------------- -- Peripheral summary ---------------------------------------------------- Channels: 1 Rx, 0 Tx Timestamps: NO Other Settings: * RF Gain Select - RF Gain Select [key=rfgain_sel, default=1, type=string, options=(0, 1, 2, 3)] * IQ Correction - IQ Correction Control [key=iqcorr_ctrl, default=true, type=bool] * AGC Setpoint - AGC Setpoint (dBfs) [key=agc_setpoint, default=-30, type=int, range=[-60, 0]] ---------------------------------------------------- -- RX Channel 0 ---------------------------------------------------- Full-duplex: NO Supports AGC: YES Stream formats: CS16, CF32 Native format: CS16 [full-scale=32767] Antennas: RX Corrections: DC removal Full gain range: [0, 42] dB IFGR gain range: [20, 59] dB RFGR gain range: [0, 3] dB Full freq range: [0.01, 2000] MHz RF freq range: [0.01, 2000] MHz CORR freq range: MHz Sample rates: 0.0625, 0.096, 0.125, 0.192, 0.25, ..., 6, 7, 8, 9, 10 MSps Filter bandwidths: 0.2, 0.3, 0.6, 1.536, 5, 6, 7, 8 MHz orangepi@orangepi5:~$ SoapySDRUtil --probe="driver=sdrplay" ###################################################### ## Soapy SDR -- the SDR abstraction library ## ###################################################### Probe device driver=sdrplay [INFO] devIdx: 0 [INFO] SerNo: 1804066095 [INFO] hwVer: 255 [INFO] rspDuoMode: 0 [INFO] tuner: 1 [INFO] rspDuoSampleFreq: 0.000000 ---------------------------------------------------- -- Device identification ---------------------------------------------------- driver=SDRplay hardware=RSP1A sdrplay_api_api_version=3.070000 sdrplay_api_hw_version=255 ---------------------------------------------------- -- Peripheral summary ---------------------------------------------------- Channels: 1 Rx, 0 Tx Timestamps: NO Other Settings: * RF Gain Select - RF Gain Select [key=rfgain_sel, default=4, type=string, options=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)] * IQ Correction - IQ Correction Control [key=iqcorr_ctrl, default=true, type=bool] * AGC Setpoint - AGC Setpoint (dBfs) [key=agc_setpoint, default=-30, type=int, range=[-60, 0]] * BiasT Enable - BiasT Control [key=biasT_ctrl, default=true, type=bool] * RfNotch Enable - RF Notch Filter Control [key=rfnotch_ctrl, default=true, type=bool] * DabNotch Enable - DAB Notch Filter Control [key=dabnotch_ctrl, default=true, type=bool] ---------------------------------------------------- -- RX Channel 0 ---------------------------------------------------- Full-duplex: NO Supports AGC: YES Stream formats: CS16, CF32 Native format: CS16 [full-scale=32767] Antennas: RX Corrections: DC removal Full gain range: [0, 48] dB IFGR gain range: [20, 59] dB RFGR gain range: [0, 9] dB Full freq range: [0.001, 2000] MHz RF freq range: [0.001, 2000] MHz CORR freq range: MHz Sample rates: 0.0625, 0.096, 0.125, 0.192, 0.25, ..., 6, 7, 8, 9, 10 MSps Filter bandwidths: 0.2, 0.3, 0.6, 1.536, 5, 6, 7, 8 MHz SoapySDRUtil --check=sdrplay SoapySDRUtil --probe="driver=sdrplay" git clone git://git.osmocom.org/gr-osmosdr cd gr-osmosdr/ mkdir build cd build/ cmake ../ make sudo make install sudo ldconfig !!!! checks: sudo systemctl status/start/stop/enable/disbale sdrplay 9. SDR++ sudo apt install libfftw3-dev libglfw3-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libiio-dev libad9361-dev librtaudio-dev libhackrf-dev sudo apt install libglew-dev libglu-dev libglu1-mesa-dev sudo apt install libglfw3-dev libglew-dev libairspyhf-dev libiio-dev libad9361-dev libairspy-dev librtlsdr-dev portaudio19-dev libzstd1 libzstd-dev limesuite gcc git clone https://github.com/drowe67/codec2.git cd codec2 mkdir build cd build cmake ../ make -j4 sudo make install sudo ldconfig git clone https://github.com/AlexandreRouma/SDRPlusPlus.git cd SDRPlusPlus mkdir build cd build cmake .. -DOPT_BUILD_SOAPY_SOURCE=ON -DOPT_BUILD_BLADERF_SOURCE=OFF -DOPT_BUILD_NEW_PORTAUDIO_SINK:BOOL=ON -DOPT_BUILD_M17_DECODER:BOOL=ON make -j4 sudo make install sudo ldconfig It might not work under VNC only HDMI cable conenction... 10. GQRX sudo apt-get update sudo apt-get install -y cmake gnuradio-dev gr-osmosdr libqt5svg5-dev libpulse-dev sudo apt-get install qtbase5-dev sudo apt-get install qtdeclarative5-dev sudo apt-get install libqt5svg5-dev sudo apt-get install libsndfile1 libsndfile1-dev git clone https://github.com/gqrx-sdr/gqrx.git cd gqrx mkdir build cd build export CXXFLAGS=-O2 cmake .. make -j4 sudo make install sudo ldconfig For SDRPlay devices please put under Other input device window: soapy=0,driver=sdrplay 11. AIS catcher git clone https://github.com/jvde-github/AIS-catcher.git cd AIS-catcher mkdir build cd build cmake .. make -j4 sudo make install sudo ldconfig orangepi@orangepi5:~/work$ AIS-catcher -l AIS-catcher (build Mar 25 2023) v0.44-346-g82fa445 (C) Copyright 2021-2023 jvde-github and other contributors This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Found 1 device(s): 0: SDRPLAY, RSP1, SN: B0007P0003 orangepi@orangepi5:~/work$ more aiscatcher.conf -d B0007P0003 -v 10 -M DT -gs LNASTATE 3 AGC on -s 2304k -u 127.0.0.1 10110 -a 192K chmod 644 aiscatcher.conf orangepi@orangepi5:~/work$ more start-ais.sh #!/bin/bash cd /home/orangepi/work CONFIG="" while read -r line; do CONFIG="${CONFIG} $line"; done < aiscatcher.conf /usr/local/bin/AIS-catcher ${CONFIG} chmod 755 start-ais.conf service: cd /etc/systemd/system aiscatcher.service: # AIS-catcher service for systemd [Unit] Description=AIS-catcher Wants=network.target After=network.target [Service] User=orangepi RuntimeDirectory=/home/orangepi/work RuntimeDirectoryMode=0755 ExecStart=/bin/bash /home/orangepi/work/start-ais.sh SyslogIdentifier=aiscatcher Type=simple Restart=on-failure RestartSec=30 RestartPreventExitStatus=64 Nice=-5 [Install] WantedBy=default.target chmod 755 aiscatcher.service sudo systemctl daemon-reload sudo systemctl enable aiscatcher.service sudo systemctl start aiscatcher.service root@orangepi5:/etc/systemd/system# sudo systemctl status aiscatcher.service ● aiscatcher.service - AIS-catcher Loaded: loaded (/etc/systemd/system/aiscatcher.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2023-04-01 12:56:10 CEST; 5s ago Main PID: 2187 (bash) Tasks: 7 (limit: 9191) Memory: 3.9M CPU: 984ms CGroup: /system.slice/aiscatcher.service ├─2187 /bin/bash /home/orangepi/work/start-ais.sh └─2188 /usr/local/bin/AIS-catcher -d B0007P0003 -v 10 -M DT -gs LNASTATE 3 AGC on -s 2304k -u 127.0.0.1 10110 -a 192K Apr 01 12:56:10 orangepi5 aiscatcher[2188]: This is free software; see the source for copying conditions.There is NO Apr 01 12:56:10 orangepi5 aiscatcher[2188]: warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Apr 01 12:56:10 orangepi5 aiscatcher[2188]: Searching for device with SN B0007P0003. Apr 01 12:56:10 orangepi5 AIS-catcher[2188]: [2193]: sdrplay_api_device: strmHandlerThread: Entry Apr 01 12:56:10 orangepi5 aiscatcher[2188]: UDP: open socket for host: 127.0.0.1, port: 10110, filter: OFF, JSON: OFF Apr 01 12:56:10 orangepi5 AIS-catcher[2188]: [2195]: sdrplay_api_device: heartBeatThread: Entry Apr 01 12:56:10 orangepi5 AIS-catcher[2188]: [2194]: sdrplay_api_device: eventHandlerThread: Entry Apr 01 12:56:11 orangepi5 aiscatcher[2188]: Device : RSP1 Apr 01 12:56:11 orangepi5 aiscatcher[2188]: Settings : rate 2304K bw 192K format CF32 agc ON lnastate 3 grdb 40 Apr 01 12:56:11 orangepi5 aiscatcher[2188]: Model #0 : [AIS engine v0.44] ps_ema ON afc_wide OFF droop ON fp_ds OFF root@orangepi5:/etc/systemd/system# ps -ef|grep -i ais orangepi 2187 1 0 12:56 ? 00:00:00 /bin/bash /home/orangepi/work/start-ais.sh orangepi 2188 2187 18 12:56 ? 00:00:02 /usr/local/bin/AIS-catcher -d B0007P0003 -v 10 -M DT -gs LNASTATE 3 AGC on -s 2304k -u 127.0.0.1 10110 -a 192K root 2205 2098 0 12:56 pts/1 00:00:00 grep -i ais Add to signalK as data source: UDP, 10110, NMEA0183, Validate Checksum, Id ais 12. FLDIGI sudo apt-get update sudo apt-get install fldigi 13. ADAFRUIT BLINKA sudo apt-get install -y python3 git python3-pip sudo apt-get install libgpiod2 python3-libgpiod suod pip3 install gpiod sudo python3 Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import gpiod >>> sudo apt-get update sudo apt-get upgrade sudo pip3 install --upgrade setuptools sudo apt-get install -y python3-smbus python3-dev i2c-tools sudo adduser orangepi i2c git clone https://github.com/orangepi-xunlong/wiringOP.git -b next cd wiringOP sudo ./build clean sudo ./build orangepi@orangepi5:~/work/wiringOP$ gpio readall +------+-----+----------+--------+---+ OPI5 +---+--------+----------+-----+------+ | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | +------+-----+----------+--------+---+----++----+---+--------+----------+-----+------+ | | | 3.3V | | | 1 || 2 | | | 5V | | | | 47 | 0 | SDA.5 | ALT9 | 1 | 3 || 4 | | | 5V | | | | 46 | 1 | SCL.5 | ALT9 | 1 | 5 || 6 | | | GND | | | | 54 | 2 | PWM15 | IN | 1 | 7 || 8 | 1 | ALT10 | RXD.0 | 3 | 131 | | | | GND | | | 9 || 10 | 1 | ALT10 | TXD.0 | 4 | 132 | | 138 | 5 | CAN1_RX | IN | 1 | 11 || 12 | 1 | IN | CAN2_TX | 6 | 29 | | 139 | 7 | CAN1_TX | IN | 1 | 13 || 14 | | | GND | | | | 28 | 8 | CAN2_RX | IN | 1 | 15 || 16 | 1 | IN | SDA.1 | 9 | 59 | | | | 3.3V | | | 17 || 18 | 1 | IN | SCL.1 | 10 | 58 | | 49 | 11 | SPI4_TXD | IN | 1 | 19 || 20 | | | GND | | | | 48 | 12 | SPI4_RXD | IN | 1 | 21 || 22 | 1 | IN | GPIO2_D4 | 13 | 92 | | 50 | 14 | SPI4_CLK | IN | 1 | 23 || 24 | 1 | IN | SPI4_CS1 | 15 | 52 | | | | GND | | | 25 || 26 | 1 | IN | PWM1 | 16 | 35 | +------+-----+----------+--------+---+----++----+---+--------+----------+-----+------+ | GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO | +------+-----+----------+--------+---+ OPI5 +---+--------+----------+-----+------+ sudo pip3 install adafruit-blinka sudo pip3 install --upgrade adafruit-blinka adafruit-platformdetect create file blinka_test.py: import board import digitalio import busio print("Hello blinka!") # Try to great a Digital input #pin = digitalio.DigitalInOut(board.PA6) --not needed now print("Digital IO ok!") # Try to create an I2C device i2c = busio.I2C(board.SCL, board.SDA) print("I2C ok!") # Try to create an SPI device #spi = busio.SPI(board.SCLK, board.MOSI, board.MISO) --not needed now print("SPI ok!") print("done!") sudo python3 blinka_test.py should see I2C OK 14. OPENPLOTTER SETTINGS sudo apt-get update sudo apt-get upgrade sudo apt install python3-wxgtk4.0 python3-ujson python3-pyudev vlc matchbox-keyboard dh-python python3-all sudo apt-get install debhelper dh-virtualenv git clone https://github.com/openplotter/openplotter-settings.git cd openplotter-settings sudo dpkg-buildpackage -b -j4 cd .. sudo dpkg -i openplotter-settings_3.5.0-stable_all.deb open terminal run sudo su - and exit. Next type openplotter-settings click get source click get candidates next from openplotter-settings menu install: signalK-installer opencpn-installer 3.2.6 -> install opencpn 5.6.2 sdr-vhf XyGrib Dasboards Serial CanBus Notifications Add a new entry in /etc/udev/rules.d called 99-gps.rules with the following: KERNEL=="ttyS0", SYMLINK+="ttyOP_gps",GROUP="dialout", MODE="0660" reboot This is needed for SignalK/OpenCPN as GPS source cd /usr/lib/python3/dist-packages/openplotterSettings in openplotterSettings.py 667 self.listApps.InsertColumn(3, _('Status'), width=190) 720 candidate = _('please install manually') 888 candidate = _('please install manually') 896 pending = _('Installed manually') !!! I will work here in that folder later on to adjust a it more to OrangePI 5 :) 15. OPENPLOTTER I2C sudo apt install hostapd dnsmasq bridge-utils dialog usbmuxd libnss-mdns avahi-utils libavahi-compat-libdnssd-dev rfkill python3-pip chrony sudo apt-get install libi2c-dev sudo apt-get install i2c-tools python3-pip python3-dev python3-pil sudo apt install python3-smbus sudo apt install i2c-tools python3-rpi.gpio git clone https://github.com/openplotter/openplotter-i2c cd openplotter-i2c sudo dpkg-buildpackage -b -j4 sudo dpkg -i openplotter-i2c_3.3.12-stable_all.deb sudo i2cPostInstall !!! sudo python3 openplotterI2cRead.py needs to run but from setting doesnt autostart Doing that as Ubuntu service: orangepi@orangepi5:~/work$ more i2c_read.sh #!/usr/bin/bash /usr/bin/sudo /usr/bin/python3 /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py as root: root@orangepi5:~# cd /etc/systemd/system root@orangepi5:/etc/systemd/system# more openplotter-i2c-read.service [Unit] Description=OpenplotterI2CRead [Service] User=orangepi StandardOutput=journal StandardError=journal ExecStart=/home/orangepi/work/i2c_read.sh Restart=on-failure [Install] WantedBy=multi-user.target sudo systemctl daemon-reload sudo systemctl enable openplotter-i2c-read.service sudo systemctl start openplotter-i2c-read.service orangepi@orangepi5:~/work$ sudo systemctl status openplotter-i2c-read.service ● i2c_read.service - OpenplotterI2CRead Loaded: loaded (/etc/systemd/system/i2c_read.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2023-03-26 22:12:59 CEST; 2min 36s ago Main PID: 2356 (i2c_read.sh) Tasks: 3 (limit: 9191) Memory: 15.4M CPU: 2.445s CGroup: /system.slice/i2c_read.service ├─2356 /usr/bin/bash /home/orangepi/work/i2c_read.sh ├─2357 /usr/bin/sudo /usr/bin/python3 /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py └─2358 /usr/bin/python3 /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py mar 26 22:12:59 orangepi5 systemd[1]: Started OpenplotterI2CRead. mar 26 22:12:59 orangepi5 sudo[2357]: orangepi : PWD=/ ; USER=root ; COMMAND=/usr/bin/python3 /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py mar 26 22:12:59 orangepi5 sudo[2357]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000) mar 26 22:12:59 orangepi5 sudo[2360]: root : PWD=/ ; USER=root ; COMMAND=/usr/bin/echo x mar 26 22:12:59 orangepi5 sudo[2360]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0) mar 26 22:12:59 orangepi5 sudo[2360]: pam_unix(sudo:session): session closed for user root orangepi@orangepi5:~/work$ sudo pip3 install adafruit-circuitpython-ahtx0 sudo pip3 install adafruit-circuitpython-htu21d go to /usr/lib/python3/dist-packages/openplotterI2c/ in startup.py 91 if 'openplotterI2cRead.py' in test: in openplotterI2c.py add: self.i2c_sensors_def['AHT20'] = {'magnitudes': [_('humidity'),_('temperature')], 'SKkeys': ['environment.inside.relativeHumidity','environment.inside.temperature'], 'multiplexing':True} line 458: smbus.SMBus(5) in openplotterI2cRead.py add: elif i2c_sensors[i]['type'] == 'AHT20': from adafruit_ahtx0 import AHTx0 if i2c_sensors[i]['channel'] == 0: if i2c_sensors[i]['address']: instances.append({'name':i,'type':'AHT20','tick':[now,now],'sensor':i2c_sensors[i],'object':AHTx0(i2c, address=int(i2c_sensors[i]['address'], 16))}) else: if i2c_sensors[i]['address']: instances.append({'name':i,'type':'AHT20','tick':[now,now],'sensor':i2c_sensors[i],'object':AHTx0(muxInstances[i2c_sensors[i]['address']][i2c_sensors[i]['channel']-1])}) elif i['type'] == 'AHT20': humidityKey = i['sensor']['data'][0]['SKkey'] temperatureKey = i['sensor']['data'][1]['SKkey'] if humidityKey: humidityRaw = i['sensor']['data'][0]['raw'] humidityRate = i['sensor']['data'][0]['rate'] humidityOffset = i['sensor']['data'][0]['offset'] humidityFactor = i['sensor']['data'][0]['factor'] tick0 = time.time() if tick0 - i['tick'][0] > humidityRate: try: humidityValue = round(i['object'].relative_humidity,1)/100 except: humidityValue = i['object'].relative_humidity humidityValue2 = humidityValue Erg = getPaths(Erg,humidityValue,humidityValue2,humidityKey,humidityOffset,humidityFactor,humidityRaw) instances[index]['tick'][0] = time.time() if temperatureKey: temperatureRaw = i['sensor']['data'][1]['raw'] temperatureRate = i['sensor']['data'][1]['rate'] temperatureOffset = i['sensor']['data'][1]['offset'] temperatureFactor = i['sensor']['data'][1]['factor'] tick0 = time.time() if tick0 - i['tick'][1] > temperatureRate: try: temperatureValue = round(i['object'].temperature,1) except: temperatureValue = i['object'].temperature try:temperatureValue2 = float(temperatureValue)+273.15 except: temperatureValue2 = '' Erg = getPaths(Erg,temperatureValue,temperatureValue2,temperatureKey,temperatureOffset,temperatureFactor,temperatureRaw) instances[index]['tick'][1] = time.time() in startup.py comment # if platform2.isRPI: # if platform2.isInstalled('raspi-config'): # output = subprocess.check_output('raspi-config nonint get_i2c', shell=True).decode(sys.stdin.encoding) # if '1' in output: # if i2c_sensors: # msg = _('Please enable I2C interface in Preferences -> Raspberry Pi configuration -> Interfaces.') # if not red: red = msg # else: red+= '\n '+msg # else: # msg = _('I2C disabled') # if not black: black = msg # else: black+= ' | '+msg # else: # msg = _('I2C enabled') # if not black: black = msg # else: black+= ' | '+msg in gpio.py remove lines: self.used.append({'app':'I2C', 'id':'ground', 'physical':'30'}) self.used.append({'app':'I2C', 'id':'ground', 'physical':'34'}) self.used.append({'app':'I2C', 'id':'ground', 'physical':'39'}) 16. OPENPLOTTER PYPILOT git clone https://github.com/openplotter/openplotter-pypilot cd openplotter-pypilot sudo dpkg-buildpackage -b -j4 cd .. sudo dpkg -i openplotter-pypilot_3.2.11-stable_all.deb Run post-installation script: sudo pypilotPostInstall go to /usr/lib/python3/dist-packages/openplotterPypilot/ in gpio.py remove lines: self.used.append({'app':'pypilot', 'id':'ground', 'physical':'30'}) self.used.append({'app':'pypilot', 'id':'ground', 'physical':'34'}) self.used.append({'app':'pypilot', 'id':'ground', 'physical':'39'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'27'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'29'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'31'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'33'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'37'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'28'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'32'}) self.used.append({'app':'pypilot', 'id':'pypilot hat', 'physical':'36'}) enable serial port pins: 16 RX/18 TX of UART4 as UART0 is used by GPS module enabling /boot/armbianEnv.txt add/change line: overlays=opi5-uart4-m0 (as root) This is to motor controller for Pypilot. reboot in openplotterPypilot.py changes in lines: 193 subprocess.check_output(['i2cdetect', '-y', '5']).decode(sys.stdin.encoding) 194 except: 195 self.ShowStatusBarRED(_('I2C is disabled. Please enable I2C5_M3 interface in Orange Pi 5 configuration /boot/armbianEnv.txt')) 198 SETTINGS_FILE = "/usr/local/lib/python3.10/dist-packages/pypilot/RTIMULib" 206 #subprocess.call(['rm', '-f', 'RTIMULibTemp.ini']) 224 if os.path.realpath('/dev/serial0') != '/dev/ttyS4': 225 self.hardwareSerial.SetLabel(_('No UART4 port detected')) 226 if self.active('pypilot'): 227 wx.MessageBox(_('UART4 port must be enabled for motor controller communication. '), _('warning'), wx.OK | wx.ICON_WARNING) 228 else: 229 self.hardwareSerial.SetLabel(_('UART4 port detected')) 238 if os.path.realpath(line) == '/dev/ttyS4': exists = True 239 if not exists: 240 wx.MessageBox(_('The device /dev/ttyS4 in UART4 should be added to the list of serial ports pypilot manages'), _('warning'), wx.OK | wx.ICON_WARNING) open serial application highligth /dev/ttyS4 create alias /dev/ttyOP_pypilot NMEA0183 after restart add to signalK we also have to add this device (/dev/ttyOP_pypilot) in pypilot under serial tab in /usr/local/lib/python3.10/dist-packages/pypilot/ sudo pip3 install adafruit-circuitpython-icm20x sudo apt-get install python3-rtimulib and change adress to 0x68 git clone https://github.com/seandepagnier/RTIMULib2 cd RTIMULib2/Linux/python sudo python3 setup.py install mkdir pypilot-update cd pypilot-update/ git clone https://github.com/pypilot/pypilot git clone https://github.com/pypilot/pypilot_data cp -rv pypilot_data/* pypilot orangepi@orangepi5:~/work/pypilot-update$ find . -type f -exec grep -H 'ttyAMA0' {} \; ./pypilot/pypilot/serialprobe.py: if device == '/dev/ttyAMA0' and name != 'servo': ./pypilot/pypilot/arduino_servo/test.cpp: const char device[] = "/dev/ttyAMA0"; ./pypilot/arduino/motor/Makefile-arduino-1.8:#DEVICE = /dev/ttyAMA0 ./pypilot/arduino/motor/Makefile:#DEVICE = /dev/ttyAMA0 ./pypilot/arduino/hat/Makefile-old:#DEVICE = /dev/ttyAMA0 ./pypilot/arduino/hat/Makefile:#DEVICE = /dev/ttyAMA0 ./pypilot/arduino/rudderfeedback/Makefile:#DEVICE = /dev/ttyAMA0 change everywhere ttyAMA0 -> ttyS4 and change in boatimu.py ./pypilot/pypilot/boatimu.py 55 SETTINGS_FILE = "/usr/local/lib/python3.10/dist-packages/pypilot/RTIMULib" sudo python3 setup.py install cd /usr/local/lib/python3.10/dist-packages/pypilot/ and check in boatimu.py: 55 SETTINGS_FILE = "/usr/local/lib/python3.10/dist-packages/pypilot/RTIMULib" sudo reboot as orangepi user pypilot_boatimu and check if set in /usr/local/lib/python3.10/dist-packages/pypilot/RTIMULib.ini I2CBus=5 17. OPENPLOTTER SDR VHF GQRX is installed (point 10) AIS catcher installed (point 11) -> we will use the service aiscatcher SDP++ installed (point 9) cd /usr/lib/python3/dist-packages/openplotterSdrVhf service.py: change "openplotter-rtl_ais" into "aiscatcher" everywhere and comment las section starting from if sys.argv[1]=='editSdrAis': to the end startup.py: 51 subprocess.check_output(['systemctl', 'is-active', 'aiscatcher']).decode(sys.stdin.encoding) openplotterSdrVhf.py: 125 'service': ['aiscatcher'], add section about SDR++ after line 131: 132 app = { 133 'name': 'SDR++', 134 'included': True, 135 'show': 'sdrpp', 136 'service': '', 137 'edit': False, 138 'install': '', 139 'uninstall': '', 140 } 141 self.appsDict.append(app) and also add 298 elif i['name'] == 'SDR++': 299 if not os.path.isdir(self.conf.home+'/.config/sdrpp'): 300 self.listApps.SetItem(item, 1, _('not installed')) 301 self.listApps.SetItemBackgroundColour(item,(200,200,200)) 302 else: 303 self.listApps.SetItem(item, 1, _('installed'))