This document is for all steps getting started with an embedded Linux Machine and specifically addressing the path for SCUTTLE developers who lack formal training in computer science such as myself. -DM
I am using markdownguide.org for formatting this document.
-
SSH must be enabled on the Pi. Go to the raspi SSH documentation and use STEP 3 to enable SSH directly from the SD card.
-
Create the wpa_supplicant.conf file and configure it to give WiFi access to the Pi. Use this method when you have no monitor.
- Using notepad, create a file called wpa_supplicant.conf
- Copy the body from an example into your file.
- On your desktop, insert the pi's SD card as a USB drive and add wpa_supplicant.conf to the root folder.
- On the next boot, your Pi will access this file to read the WiFi credentials and attempt to connect.
-
Check the connection by finding your Pi on the network. With your PC connected to the same AP, open up an SSH terminal.
- Attempt a connection to "raspberrypi.local" in the ip address field. You should establish a connection as long as SSH has been enabled on your pi.
Notes: * default directory: etc/wpa_supplicant * You may add a second network just below the first, with one empty line between
Notes: * Connection manager (connman) is preferred for Beaglebone and installed out-of-box. * connman info found at mankier.com
To install connman:
> sudo apt-get install connman
* Details for after install are here
* Note: installation may take 5 minutes.
- Configure your Pi to connect to the wifi
- Using PC, connect to the same access point (AP) as the pi
- initialize an SSH session with "raspberrypi.local" instead of IP
- After you open SSH with the Pi, use this command:
ip addr
- This displays connection info. Look under wlan0 for wireless connection
- This displays connection info. Look under wlan0 for wireless connection
1. Second option: > ifconfig * IP is found under wlan0, named "inet"
- use this command:
iwconfig wlan0 | grep quality
- run this command:
sudo systemctl start cloud9.service
Notes: * Use the following to check your Linux version > lsb_release -a * To read your Debian version: > cat /etc/debian_version * See the tree of linux distros wiki
Advanced Package Tool (APT) handles installations on Debian, Ubuntu, and more.
-
This command searches online for updates to installed packages, and modifies the sources.list file on your machine.
sudo apt-get update
-
This command upgrades packages according to sources.list
sudo apt-get upgrade
-
Remove packages no longer needed for other programs
sudo apt autoremove - this removes packages no longer needed for other programs
-
Update packages on the system that don't require removals or new installations of pkgs.
sudo dist-upgrade
- see video
-
sudo dist-upgrade - this updates any packages on the system that don't require removals or new installations of packages. see video
Nodered.org getting started with raspberry pi documentation
- This script installs nodered and nodejs latest versions for debian devices:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
- Command purely for installation of nodeRED (not recommended):
sudo npm install -g --unsafe-perm node-red
- Run nodered from Command-line:
node-red
- Set up the secret key by editing ~/.nodered/settings.js by inputting secret key: scuttle2020
- Check if nodered is running:
sudo systemctl status nodered.service
For using on your desktop visit nodered.org)
See the log in this separate gist
For new installations, we need to add a few modules for nodes
-
The most important is node-red-dashboard
npm install node-red-dashboard
- More detailed instructions here
- More detailed instructions here
-
Alexa controlled Node-Red nodes
npm install
- more info at the nodered docs
- tested by DA on Pi running
-
To install, follow the instructions on remo github
-
To run, go to the install directory then run
python controller.py
-
To stop running:
killall /bin/bash python ffmpeg
-
To list microphone devices connected
arecord -l
-
To list your webcam's supported resolution(s)
v4l2-ctl --list-framesizes=YUYV
-
For setting up remo.tv on a beaglebone, some issues are resolved in this issue thread
Go to the directory containing an audio file.
> omxplayer example.mp3
Simply play an audio file. omxplayer is included in the pi distro
Download a sample audio file to test the speakers: > wget https://bigsoundbank.com/UPLOAD/wav/0002.wav * this webpage has many more sounds available to download.
Use Alsa to play the file:
aplay 0002.wav
Testing microphone: see this simple writeup
- to install flite:
sudo apt install flite
- directory of voices: /usr/share/festival/voices/english
- source for free .wav files https://www.wavsource.com/movies/2001.htm
- getting started video on youtube
- Show the currently installed version:
python3 --version
- List installed Python2 Packages:
pip list
- Important note: calling pip will default to pip2 as of late 2020. see proof
- List installed Python3 Packages:
pip3 list
-
Activate the i2c bus on the pi
sudo raspi-config
- Navigate to communication busses and activate i2c
-
Check if the devices are communicating on the bus:
sudo i2cdetect -r 1
-
Install python smbus2 (for using encoders)
sudo apt install python3-smbus2
- due to dependencies, pip3 did not reach a successful install 2020.11.17
- trial on 12.04: installation failed. Ran these command sequence for successful smbus2 install:
sudo apt-get install python3-pip sudo pip3 install --upgrade setuptools sudo pip3 install smbus2
- followed step2 from makersnack to choose the above two commands to upgrade pip3
-
Install numpy on the raspi
sudo apt install python3-numpy
- very fast installation
- Install Paho-MQTT for python 3
pip3 install paho-mqtt
- Find more info at pypi.org
- follow this example. Use sudo if the program will need sudo
sudo crontab -e
- select an editor & add this line at the end of crontab file (adjust per your program)
@reboot /usr/bin/python3 /home/pi/scuttle/software/python/basics_pi/L3_gpDemo.py
- save and close crontab, then reboot to test
- We use pygame to access bluetooth controller. To install:
sudo apt install python3-pygame
- very fast installation (>1min)
- Requires install for some functions including logger.debug() and LogInit()
sudo pip3 install fastlogging
- Further info on fastLogging at pyPi.org
- Use this lib to make log files with varying debug levels built-in
sudo apt-get install festival festvox-kallpc16k
- info at wisercoder.com
- setup on youtube
Shut down immediately (does not work for me -DM)
sudo shut down -r now
sudo pip3 install pi-ina219
How to clone a repository:
git clone https://github.com/MXET/scuttle scuttle
The hyperlink should be the main page of the repository. The last part of the command is installation directory name. It will be created if it does not exist already.
Reduce the size of a repository with prune:
git gc --aggressive --prune=all # remove the old files
I chose this command based on this stack overflow thread as well as some more information available at panjeh.medium.com Detailed tutorial available from atlassian.com but I did not read carefully.
First, boto3 must be installed for python to access AWS. find boto information at pypi.org > pip install boto3
Also you must install mpg123 aparrently > sudo apt-get install mpg123
To use Polly on Remo, open the configuration file for remo.tv, then under tts set type=polly
A common module for commanding GPIO on raspi: RPi.GPIO (installed by default)
Instructions to update the GPIO library on sourceforge.net
The authors of the rpi.gpio library offer a wiki
Notes from 2020.11.06 GPIO testing:
- To view graphical pinout from within command line, run:
sudo apt update sudo apt install python3-gpiozero
- After that is installed, use the command
pinout
Note: this may no longer work with Python2. Only python3. Further info on raspi webpage or on readthedocs.io
- See processes and cpu load
top
Servo video with diagram on youtube
Servo (alternative): following a video from explainingComputers.com
Note: I successfully repeated this video using pin 12 and GND, omitting 5v pin. -DM
Steps to start raspi camera with ribbon cable. Not necessary for USB cameras.
sudo apt update sudo apt install python3-picamera
More info: at raspberrypi documentation
These notes were last update around 2020.08
Following tutorial at colcon.readthedocs.io
> curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
> sudo apt install python3-colcon-common-extensions : this took 30.8Mb of space
Next following instructions at: robotis.com
Install Gazebo9 > $ curl -sSL http://get.gazebosim.org | sh
Next you're pointed to this set of instructions at ros.org
> export LANG=en_US.UTF-8
> sudo apt install gnupg2 lsb-release : this required 411kB
> sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
> sudo apt update
> sudo apt install ros-dashing-desktop : UNABLE TO LOCATE PACKAGE
Next, upgrading
- The above tutorials may be for AMD 64 bit processors only.
I also followed the tutorial at medium.com/realroboox
- arrived at step 3 with: "Unable to locate package ros-eloquent-ros-base"