BirdNET-Pi October 2023 Installation for Remote System
Bullseye vs Debian version: 12 (Bookworm)
- Current issue with Bookworm release of Raspberry Pi OS
- The installation exited unsuccessfully - tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl is not a supported
- Solution is to install Pi OS (Legacy, 64-bit) Lite version of the Bullseye port
Enable SSH
sudo raspi-config
Interface Options
Select SSH
Select Yes
Server is enabled
Finish
BirdNET-Pi Updates
sudo apt update
sudo apt upgrade
SSD Configuration
lsusb -t
sudo fstrim -v /
lsblk -D
sudo su
- Exit root
exit
Install BirdNET-Pi Software
curl
Installing Packages
Installation installed successfully
Configuration of BirdNET-Pi using Web Portal
Tools Login
Tools Settings
Select a Model Update location - to 4 decimal places
Change default admin password New username is birdnet
Find your location
Update Settings - button
Success - Advanced settings
Advanced settings menu
Update default Admin password settings. Note - username changes from admin to birdnet
Instruction to Access BirdNET-Pi web portal
Update settings
External Booster WiFi Antenna
ifconfig
ssh birdnetpiremote@192.168.1.155
Home Router configuration for Static IP Address
Advanced > Network > LAN Settings
Address Reservation > Add
IP and MAC Address
Add IP and MAC address to list
Static IP address included in list
TeamViewer - Connect to Remote Raspberry Pi computer that has no GUI Interface
To install TeamViewer on a Raspberry Pi without a GUI interface (headless installation), you can use the TeamViewer Host version. Here are the steps to install TeamViewer on a headless Raspberry Pi:
- Access Your Raspberry Pi: You'll need to have SSH access to your Raspberry Pi. Connect to it using SSH from another computer. Alternatively, you can also configure the Raspberry Pi directly (prior to deployment into the field. This is easier and more secure because you don't need to enable SSH.
- Download TeamViewer Host:
- Visit the TeamViewer download page for Raspberry Pi using a web browser: TeamViewer Raspberry Pi Download.
- Look for the TeamViewer Host for Raspberry Pi section.
- Right-click on the appropriate download link (choose 64-bit version for BirdNET-Pi) based on your Raspberry Pi model (e.g., Raspberry Pi 3 or Raspberry Pi 4) and choose "Copy link address" from the context menu.
https://download.teamviewer.com/download/linux/teamviewer_arm64.deb
- Download TeamViewer: - On your Raspberry Pi, use wget to download TeamViewer.
wget https://download.teamviewer.com/download/linux/teamviewer_arm64.deb
- Install TeamViewer:- Install TeamViewer using dpkg. Replace <downloaded-package.deb> with the actual filename you downloaded. This will install TeamViewer without any GUI components.
sudo dpkg -i teamviewer_arm64.deb
sudo apt-get install -f
- Set Up TeamViewer: Now, you can set up TeamViewer to work with your TeamViewer account by running the following command:
sudo teamviewer setup
Follow the on-screen instructions to set up TeamViewer, including signing in with your TeamViewer account or creating one if you don't have an account yet. You will be asked to sign in to your TeamViewer account. Once signed in, an email will be sent to your email address asking for the addition of the remote computer to be verified.
- Click Add to Trusted Devices
- Start TeamViewer: After setting up TeamViewer, you can start it by running:
sudo teamviewer daemon start
- Access the Raspberry Pi: You can now access and control your headless Raspberry Pi using TeamViewer from another computer.
Remember that you will need to have an active internet connection on both your Raspberry Pi and the computer you use to access it via TeamViewer.
Testing MPPT Data upload
- Connect VE.Dect cable to USB Port on Raspberry Pi computer.
- During initial trials using WiFi 3 USB ports were already occupied (Wifi External, SSD external drive, USB microphone) - so the Smart Shunt was not connected.
- To list all USB devices enter the command:
lsusb
- To list specific USB connected devices enter the following command.
- The VE.Direct cable is connected to /dev/ttyUSB0
ls /dev/*USB*
Create MPPT.py file
- Create a new empty file using the following command.
- Create this file in the user directory /home/birdnetpiremote/MPPT.py
- Alternatively, if the python code is available, use nano and create and populate the file in the one step.
touch MPPT.py
- Enter the following python code to read data from the Victron MPPT Solar Charge Controller.
- The following key changes were made:
- Installation of VE.Direct required.
- File write path adjusted. Also set to 'w' so that file is written over each time with new data.
#!venv/bin/python
#import serial
import datetime
from vedirect import VEDirect
port_0 = '/dev/ttyUSB0'
ve_0 = VEDirect(port_0,60,'')
data_0 = ve_0.read_data_single()
datasave_0=""
mppt_dict={}
ls_0=['V','VPV','PPV','IL','LOAD','H19','H20','H21','H22','H23','ERR','CS','FW','PID','SER#','HSDS','MPPT']
for i in range(len(ls_0)):
mppt_dict.update({ls_0[i]:data_0[ls_0[i]]})
print(mppt_dict)
now = datetime.datetime.now()
date_stamp = now.strftime("%Y-%m-%d %H:%M:%S")
data_save_0=date_stamp+'\n'
data_save_1=data_save_0
print(f'The current time is {date_stamp}')
#date = str(line) + "," + date_stamp + "\n"
#print(f'The data is= {data}')
for i in range(len(ls_0)):
length=len(ls_0[i])+len(str(data_0[ls_0[i]]))
data_save_0=data_save_0+ls_0[i]+ " : " + str(data_0[ls_0[i]]) + " "*(20-length)
if (i+1)%5==0:
data_save_0=data_save_0+"\n"
else:
data_save_0=data_save_0+"| "
f=open('/home/birdnetpiremote/MPPT/mppt_data_new.txt','w')
f.write(data_save_0)
f.close
Change File Permissions
- The MPPT.py cannot be executed in the current form and needs to be made executable
- To change file permissions enter the following commands.
sudo chmod +x MPPT.py
Verify that the permissions have been changed with the command
ls -l
Installing vedirect python module
- Tying to run the MPPT.py file will result in a error because the vedirect python module has not been installed.
sudo apt install git
python3 -m pip install "git+https://github.com/jmfife/vedirect"
The command python3 -m pip install "git+https://github.com/jmfife/vedirect" is used to install a Python package directly from a Git repository. Here's what each part of the command does:
- python3: This invokes the Python 3 interpreter.
- -m pip: This uses Python's package manager, pip, to manage package installations.
- install: This is the pip command to install Python packages.
- "git+https://github.com/jmfife/vedirect": This is the argument to the install command and specifies the package to install. In this case, it's a Git repository URL. pip will clone the repository from GitHub and install the package.
So, running this command will install the Python package available in the specified Git repository into your Python environment.
Creating MPPT directory to save MPPT data