Skip to content

Raspberry Pi Setup

Graham Ross edited this page Mar 16, 2021 · 30 revisions

Raspberry Pi setup

  • Flash the Raspberry Pi OS (32-bit) onto SD card using the Raspberry Pi Imager found at www.raspberrypi.org/software.

  • For headless setup, SSH can be enabled by placing a file named ssh onto the boot partition of the SD card (see www.raspberrypi.org/documentation/remote-access/ssh)

  • install sd card into rpi and power it up.

  • Find raspberry pi's IP address on your router and reserve address. (example used below 192.168.0.25)

  • log in using ssh [email protected] (default password is raspberry)

  • run sudo raspi-config

  • select update then **Finish **when done

  • Change the default password using: passwd or use passwordless SSH access by copying your public key to rPi (see www.raspberrypi.org/documentation/remote-access/ssh/). Using powershell on Windows 10, execute: cat ~/.ssh/id_rsa.pub | ssh [email protected] 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'

Update the OS

  • sudo apt update

  • sudo apt full-upgrade (available on new versions of Pi)

  • sudo reboot

  • login again with ssh [email protected]

Setup IOTstack:

  • Install git: sudo apt install -y git curl

  • cd ~

  • Get IOTStack from github using git: git clone https://github.com/SensorsIot/IOTstack.git IOTstack

  • cd ~/IOTstack

  • Run IOTStack: ./menu.sh

  • IOTStack should install Python, Docker and Docker compose, if it doesn't, select "Native Installs" then select "Install Docker and Docker-Compose".

  • Reboot the pi when done.

  • cd ~/IOTstack and run ./menu.sh again

  • Select: Portainer-ce Node-RED InfluxDB Grafana Eclipse-Mosquito Telegraph MariaDB

  • docker-compose up -d

  • Browse 192.168.86.25:9002

  • Create "admin" User & Password

  • Select: "Docker (Manage the local Docker environment)"

  • Connect

  • docker exec -it mosquitto sh
  • mosquitto_passwd -c /mosquitto/pwfile/pwfile YourMQTTUserName

pw

re-enter pw

exit

  • Connect to MQTT broker using MQTTfx to test.

Install the Battery Tester Web App in a docker container.

  • Using FTP, copy the WebApp folder from code/Python/WebApp to your root folder.

  • cd WebApp

  • run ./start.sh