Menu

Installing and Pi Setup

lostbard

Installing and Pi Setup

The Raspberry Pi toolkit is a somewhat Matlab compatible raspi toolkit for GNU octave.

It has local Octave set of functions for controlling a Raspberry PI as well as a server (Raspberry Pi) comonent running remotely on the Raspberry Pi.

Installation then has two components;
1. raspi tool kit installation on the computer running GNU Octave.
2. a Raspbeery pi running pigpiod with additional scripts and setup completed.

Toolkit Installation

The Raspberry Pi toolkit must be installed and then loaded to be used.

It can be installed in GNU Octave directly from octave-forge, or can be installed in an off-line mode via a downloaded tarball.

NOTE The toolkit has a dependency on the instrument-control package, so it must be installed in order to successfully install the Raspberry Pi toolkit

The toolkit must be then be loaded once per each GNU Octave session in order to use its functionality.

Online Direct install

With an internet connection available, the Raspberry Pi package can be installed from octave-raspi website using the following command within GNU Octave:

pkg install https://sourceforge.net/projects/octave-raspberrypi/files/v0.0.1/raspi-0.0.1.tar.gz/download

Off-line install

With the raspi toolkit package already downloaded, and in the current directory when running GNU Octave, the package can be installed using the following command within GNU Octave:

pkg install raspi-0.0.1.tar.gz

Loading

Regardless of the method of installing the Raspberry Pi toolkit, in order to use its functions, the toolkit must be loaded using the pkg load command:

pkg load raspi

The toolkit must be loaded on each GNU Octave session.

Hardware setup

The raspi packages uses pigpio on the Raspberry Pi hardware to communicate with the board.

In order to use the raspi hardware with the toolkit, it must have the pigpiod server installed and running on the Raspberry Pi board.

Raspberry Pi OS

The raspi toolkit is tested using the official Raspberry Pi Lite OS (https://downloads.raspberrypi.org/raspios_lite_armhf_latest), but should also work with the full version.

The image needs to be loaded to the Pi SD card and the pi booted successfully before installing the additional software required by the raspi toolkit.

The network should be configured so that access to the pi can be obtained and the ssh service enabled.

The additional software can be installed using a simple install script that comes with toolkit or can be setup manually for more control.

Quick setup

To use the quick set up, copy the raspi_setup_hw.sh from the pkg bin directory to the raspberry pi.

  1. Using ssh, login to the Pi and cd to the directory on the pi that contains the setup.

  2. Run the setup as sudo. ie: sudo ./raspi_setup_hw.sh

  3. Reboot the Pi ie: sudo reboot

  4. Attempt to connect to the Pi using the toolkit.

Manual setup

Manual setup is the list of command that are done normally using the setup script.

  1. Install pigpiod i2c-tools avahi-daemon openssh-server and any dependancies

> sudo apt-get install pigpiod i2c-tools avahi-daemon openssh-server

  1. Run the raspi-config tool

> sudo raspi-config

In the interface options, enable ssh, rgpio, i2c, spi, serial

  1. Add pigpio access to directories in /opt/piggpio/access

At a minimum read/write to /tmp is required.

Defaults used in the installer:

  /home/pi/* u

  /tmp/raspi-* u

  * r
  1. Enable avahi for mDNS

> systemctl enable avahi-daemon

Optionally, also set the host name in /etc/hostname, especially if more than one pi will be used.

  1. Copy the cgi scripts from the raspi tool kit repo to /opt/pigpio/cgi/

  2. Optionally use raspi-config to turn off startup of the GUI.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.