Software installation and configuration
All features of Iono Pi, except the real time clock and ADC converter, are controlled via
dedicated GPIO pins and can be used with any operating system and programming
language that supports the GPIO pins control on Raspberry Pi. The real time clock is
interfaced via the I
2
C serial bus, while the ADC uses the SPI lines.
The following software installation notes are based on the Raspbian Jessie operating
system.
Installing the Iono Pi utility
The Iono Pi utility is a simple command-line script to control Iono Pi’s inputs and outputs.
You should enable the SPI interface to use the Iono analog to digital converter, and 1-Wire
support if you need to connect 1-Wire devices.
To enable SPI, run the “raspi-config” configuration utility:
$
sudo raspi-config
Then go to “Advanced Options” (or “Interfacing Options” with the latest Raspbian builds),
“SPI” and select “yes” to enable the SPI interface, then reboot your Raspberry Pi.
Also enable 1-Wire if you need it, or be sure it is disabled if you want to use TTL1 for other
purposes.
Run the following commands to download and install the Iono Pi utility:
$
sudo apt-get install git-core
$
git clone --recursive https://github.com/sfera-labs/iono-pi-c-lib.git
$
cd iono-pi-c-lib
$
sudo sh build
You can run the Iono Pi utility without arguments to print its options:
$
iono
usage: iono <command>
Commands:
-v Print the version number of the ionoPi library
led on Turn on the green LED
led off Turn off the green LED
o<n> open Open relay output o<n> (<n>=1..4)
o<n> close Close relay output o<n> (<n>=1..4)
oc<n> open Open open collector oc<n> (<n>=1..3)
oc<n> close Close open collector oc<n> (<n>=1..3)
di<n> Print the state ("high" or "low") of digital input di<n> (<n>=1..6)
di<n> -f Print the state of digital input di<n> now and on every change
ai<n> Print the voltage value (V) read from analog input ai<n> (<n>=1..4)
ai<n> -r Print the raw value read from the A/D converter's channel
corresponding to analog input ai<n> (<n>=1..4)
1wire bus Print the list of device IDs found on the 1-Wire bus
1wire bus <id> Print the temperature value (°C) read from 1-Wire device <id>
1wire ttl<n> Print temperature (°C) and humidity (%) values read from the
MaxDetect 1-Wire sensor on TTL<n> (<n>=1..4)
wiegand <n> Wait for data to be available on Wiegand interface <n> (<n>=1|2)
and print number of bits and value read
wiegand <n> -f Continuously print number of bits and value read from Wiegand
interface <n> whenever data is available
20
User Guide