Optimize resources Link to heading

If you are confortable using ssh, command line and want to have extra resources availabe for the pi, then, this section interesting.

  • Activate ssh network connection with raspi-config, and setup key pair authentication.
  • use nfs for accessing files in my linux environment:
    sudo apt install nfs-kernel-server
    
  • Export /home/rms so it can be accessed via nfs in the local network:
    cat /etc/exports 
    /home/rms  192.168.1.0/24(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
    
  • remove a few not required services, getting a headless system:
sudo -s   # session as root
apt remove realvnc-vnc-server
apt remove nomachine
systemctl stop cups
systemctl disable cups
systemctl stop anydesk
systemctl disable anydesk
systemctl stop smbd        
systemctl disable smbd
systemctl stop nmbd        
systemctl disable nmbd        
systemctl stop hciuart  
systemctl disable hciuart
systemctl stop bluetooth
systemctl disable bluetooth
systemctl stop ModemManager
systemctl disable ModemManager
systemctl stop lightdm
systemctl disable lightdm
  • By using XForwarding yes in /etc/ssh/sshd_config it is possible to connect via ssh to the pi and still run applications like skyfit2:
ssh -X meteorpi 
...
rms@meteorpi:/home/rms/source/RMS $ python -m Utils.SkyFit2
# skyfit2 will display ok
  • I created a small script start_capture.sh to run source/RMS/Scripts/RMS_StartCapture.sh as a systemd service on boot.
rms@meteorpi:~/source/RMS $ cat start_capture.sh 
#!/bin/bash
HOME=/home/rms
. "$HOME/.cargo/env"
source $HOME/vRMS/bin/activate
cd /home/rms/source/RMS/
$HOME/source/RMS/Scripts/RMS_StartCapture.sh

The service is defined as follows:

root@meteorpi:/etc/systemd/system# cat rms_start_capture.service 
[Unit]
Description=RMS Start Capture

[Service]
Type=oneshot
ExecStart=/home/rms/source/RMS/start_capture.sh
User=rms
Group=rms
WorkingDirectory=/home/rms/source/RMS
StandardOutput=null
StandardError=null

[Install]
WantedBy=multi-user.target

More changes in boot/config.txt Link to heading

The raspberry pi is not too far away from the camera. Just in case, I disabled lights in the /boot/config.txt file:

# Disable the PWR LED
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
# Disable the Activity LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Disable ethernet ACT LEDs
dtparam=eth_led0=4
# Disable ethernet LNK LEDs
dtparam=eth_led1=4

As no desktop is used on the pi, gpu memory is comented out, so it just gets the default. As no real time clock is needed, also its module is comented out:

#gpu-memory=256
#dtoverlay=i2c-rtc,ds3231

There could better ways to achieve the results. Please let me know if you know something (pablo.pita at pitagoral.com).