💻
Dev Notes
  • Dev notes
  • Back end
  • books
  • Front End
  • Platforms in which you can improve your skills
  • Run local Jekyll site
  • Recommended podcasts you should listen to
  • Tools
  • code
    • REST
  • docker
    • Docker cli commands
  • git
    • Changing author info
    • Working with Github organizations
    • Working with upstream
  • npm
    • NPM cli
  • unix
    • Mac OS
    • Raspberry Pi
    • Terminal
Powered by GitBook
On this page
  • Installing Golang
  • Run raspberry pi in virtual machine
  • Running services on Raspberry pi
  • Systemd: Run it last

Was this helpful?

  1. unix

Raspberry Pi

PreviousMac OSNextTerminal

Last updated 5 years ago

Was this helpful?

# Raspberry Pi Model Information
cat /proc/device-tree/model

# Finding the Pi Revision Number by reading the "cpuinfo":
 cat /proc/cpuinfo

 # New raspberrypi versions:
 pinout

Source

Installing Golang

# As of Go 1.6 (February 2016), an official ARMv6 package is available for download. So, if your Raspberry Pi has ARMv6 or v7 (see cat /proc/cpuinfo | grep ARM), then just do something like:

wget https://storage.googleapis.com/golang/go1.6.2.linux-armv6l.tar.gz 
sudo tar -xzf go1.6.2.linux-armv6l.tar.gz -C /usr/local
sudo chgrp -R staff /usr/local/go
export GOROOT=/usr/local/go
export PATH="$PATH:$GOROOT/bin"

Source

Run raspberry pi in virtual machine

brew install qemu
# First, create a folder for your VMs and move the image in
sudo mkdir ~/qemu/
mv ~/Downloads/IMAGE.iso ~/qemu/
cd ~/qemu
# Now let’s launch the image in qemu with the following command:
qemu-system-x86_64 -hda IMAGE.iso -m 1024 -net nic -net user

Running services on Raspberry pi

#Service example
vi /home/dani/scripts/tempMonitor/tempMonitor.service

[Unit]
Description=Raspberry Temperature Monitor
After=network-online.target

[Service]
ExecStart=/bin/bash /home/dani/scripts/tempMonitor/tempMonitor.sh
WorkingDirectory=/home/dani/scripts/tempMonitor/
StandardOutput=inherit
StandardError=inherit
Restart=always
User=dani

[Install]
WantedBy=multi-user.target
# Get status about why service failed:
    journalctl -u tv.service

# copy service
sudo cp /home/pi/example.service /lib/systemd/system/

sudo systemctl enable example.service

Systemd: Run it last

Source

Source and example of IFTT integration

https://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/
https://raspberrypi.stackexchange.com/a/46828
https://raspberrytips.com/run-raspberry-in-virtual-machine/
https://domoticproject.com/creating-raspberry-pi-service/
https://www.mauras.ch/systemd-run-it-last.html