New Version 2019


Raspberry Pi Installation

On Ubuntu:
download Raspbian Stretch
install Raspbian on micro SD card using startup disk creator

Raspberry Pi Configuration

sudo raspi-config
enable I2C
enable serial port
disable serial port shell
enable built-in VNC Server (RealVNC)

VNC Server

in options, make sure authentication is set to VNC
On Ubuntu client side, using vinagre
headless VNC server

File Sharing

mkdir /home/user/sshfs_pi/

sudo sshfs -o allow_other pi@ /home/user/sshfs_pi/

Testing communication with Arduino

minicom -b 9600 -o -D /dev/ttyAMA0 Set fixed IP

Install Node.js

Zero requires different installation than biger RPi because it uses ARM 6 architecture
tar -xzf node-v11.6.0-linux-armv6l.tar.gz
sudo cp -R node-v11.6.0-linux-armv6l/* /usr/local/
nano ~/.profile
at the end then press ctrl + x to exit. Type yes to save.
simple web server:
sudo npm install http-server -g
serial to web socket:
npm install express
npm install ws
npm install serialport
npm install ip
(-g, module not found?)

Autostart node server on Pi startup

add the MPPT software as a service using systemd.
add file MPPT.service to /etc/systemd/system.
Start and stop:
sudo systemctl start MPPT.service
sudo systemctl stop MPPT.service
check status:
sudo systemctl status MPPT.service
during development
sudo systemctl daemon-reload
sudo systemctl restart MPPT.service
To start automatically at boot:
sudo systemctl enable MPPT.service
To list all services:
sudo systemctl list-unit-files
sudo systemctl list-unit-files | grep MPPT.service
To see output from service:
journalctl -u MPPT.service -b
To shorten journal file:
sudo journalctl --rotate
sudo journalctl --vacuum-time=1s


Operating System

How to Setup Raspberry Pi Zero W for Headless

Application Software

npm install rpio
npm install raspi
npm install raspi-pwm

PWM on Raspberry Pi

Raspberry Pi Power Consumption

Raspberry Pi Zero Pins