Application Note #12 - Raspberry Pi Server with IOTstack

Objectives

  • create a Raspberry PI Server based on video #295 on Andreas Spies youtube channel
  • document my experience.

Descripion

  • build a Raspberry IOT server based on Docker containers
  • this note does not describe all the steps in video #295, its a trial run. If successful, follow up notes will complete the installs

Platform

  • Raspberry PI 3 Model B

    video #295 installs to a Raspebrry PI 4, but I had a Pi 3 on hand so I installed to it. The plan is to evaluate on a Pi 3 and switch to Pi 4 if I keep on the long term.

    1
    uname -a

    Linux raspberrypi 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux

=============================================================================

References

  1. Andreas Spiess’s Video #295 - Raspberry Pi Server based on Docker,…
  2. github – SensorsIot IOTstack…
  3. gist - “Run Raspberry Pi 4 from SSD”
  4. updated firmware lets you boot Pi4 from USB

    Procedures

    NOTEthis project is relatively new and evolving fast. In short, theres bugs, but they’re getting fixed. Some of these instructions will get obsoleted by the bug fixes, so be aware of that. For example the “docker group” issue will get fixed soon I’m sure: see issue #204. I also generated a couple issues: see #213 and #212
    NOTE
    use the discord channel, its a primary source of info

Step 1

Download the project software

Install support tools

1
2
# install these support tools first:
sudo apt install -y git curl

Download software

1
2
3
git clone https://github.com/SensorsIot/IOTstack.git
cd IOTstack
bash ./menu.sh
  1. Install docker with the menu, restart your system.
  2. Run menu again to select your build options,
1
2
3
4
5
6
7
8
9
10
# Fix permission denied
sudo groupadd docker
#Add your user to the docker group.
sudo usermod -aG docker $USER
# Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
newgrp docker
# Check if docker can be run without root
docker run hello-world
## reboot to ensure fresh system
reboot
  1. From the menu, choose “Build Stack” and pick images
    1
    2
    3
    4
    5
    cd IOTstack
    bash ./menu.sh
    # choose "Build Stack" and pick these images
    # grafana, influxdb, mosquitto, nodered for now.
    # For nodered: highlight nodered, "right click / select & build addons list" then hit enter
    NOTE** you’re gonna get “nodered addons_list.yml errors”
  • while in menu.sh, hilight “nodered” and click the right arrow button. You can build the .yml file in there.
  • then start the stack from docker commands menu.
  1. Go into docker commands and “Start Stack”
    Pulls all images and starts everything up

Seems to work!!

  • connect to nodered
    open url
    localhost:1880
    or

192.168.2.21:1880

NOTE**

  • to monitor logs
    1
    2
    cd ~/IOTstack
    docker-compose logs -f
  1. Post install
  • disable swap and enable log2ram
    • from the main menu, choose misc commands
      • choose “Set swapiness to 0 (Disables swap until restart)”
      • choose “Install log2ram”

back to Series…