We've heard plenty of customers asking if the IRI toolkit can be used on Raspberry Pi, so we decided to put together a blog post about it. The answer is, of course, "Yes it can!" The IRI toolkit has already been ported to the Linux operating system, and this Linux port also works on the Raspberry Pi hardware, with no modifications.
This writeup describes using the RS500 and its development kit, but this would work just as easily on any other Indy reader that uses the IRI host library.
The following figure shows the overall hardware arrangement. Not shown is the power supply for the Indy Module development board. For more complex diagrams, see below.
Figure 1: Example Simple Block Diagram
Example Hardware Setup
There are two ways to connect communication between the RS500 and the Raspberry Pi: USB and 3.3V UART. They are shown below.
Using the USB connection utilizes the USB-UART IC on the RS500 development kit.
Note: In both configurations, power must be supplied externally, as the Raspberry Pi cannot provide enough power from its USB ports.
Make sure to swap the power jumper(J12 on the RS500 Dev Board) to the appropriate position for your power supply.
Figure 2: Hardware Block Diagram - USB-UART
Figure 3: Hardware Block Diagram - 3.3 Volt UART
Example Software Setup
The Raspberry Pi should be configured with the standard Raspbian image. You can find simple instructions here. Setting up an FTP server and remote SSH access can make some of these steps a lot easier, especially if you are running it headless.
The ITK software should be run as follows:
Download the ITK release(here) and unzip it on your Raspberry Pi. You can do this easily using an FTP server, VNC remote desktop, or operating the Pi locally.
Make the ITK release examples by opening a shell, navigating to the folder containing the examples(by default this is
/ITK_C/Examples/), and running the "make" command:
After successfully making the examples, run the IRI_Intro example with the appropriate communication device in
/dev/. Below, see examples for using the built in Pi UART 0("
serial0" on the 3 B+ and Zero models, and "
ttyAMA0" on older hardware), and USB port 0("
$ output/IRI_Intro /dev/serial0
$ output/IRI_Intro /dev/ttyAMA0
$ output/IRI_Intro /dev/ttyUSB0
At this point, the Pi should communicate with the Indy reader module, and print EPCs of seen tags in the console for 1 second.
Note: On the Raspberry Pi 3 B+ and Zero, the UART attached to GPIO14 and 15 is connected to the Bluetooth module by default, and must be reconfigured to be used as described above. Without enabling the UART, attempting to run the examples as shown above will result in error code 0x02000002, "API_SERIAL_PORT_ERROR". To enable it, in the console, enter "
sudo raspi-config", select "option 5 - Interfacing options", and under "option P6 - Serial", disable serial port login, and enable the serial port hardware. Reboot the Raspberry Pi to complete the reconfiguration. There are more details on this topic here: https://www.raspberrypi.org/documentation/configuration/uart.md