HTML5: Best viewed in Mozilla Firefox.

This page will be moved to a new location: DCIUX

Header image

RPIsPLC.

Simple Raspberry Pi PLC.

Installation of PLµX software and I2C.

Installation of PLµX software and I2C.

Last modified: De Coninck Ivo

This is a step by step guide on installation of the I2C driver for the Raspberry Pi.
It is for the Raspberry Pi Linux distribution "Raspbian Wheezy".
Make sure your Raspberry Pi is connected to the internet when installing the drivers.
Then we start with the installation of the PLµX software.

Install the I2C drivers for Raspberry Pi (model b).

Last modified:

Example for Ubuntu user: ivo.
Log into 192.168.1.222 as 'pi' user from ubuntu user without password.
How to login passwordless.
ivo@aspireI7:~$ ssh pi@192.168.1.222

terminal.ssh.passwordless2.png
Fig1. - SSH login passwordless.


uname - print system information
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux

The I2C ports need to be enabled in Raspbian.
Edit the /etc/modules file, add 2 lines:
i2c-bcm2708
i2c-dev
pi@raspberrypi ~ $ sudo nano /etc/modules

terminal.nano.etc.modules.png
Fig2. - Edit /etc/mdoules.

Press CTRL X then y to save and exit.

Edit the /etc/modprobe.d/raspi-blacklist.conf file.
Comment out the line: blacklist i2c-bcm2708 to: #blacklist i2c-bcm2708
pi@raspberrypi ~ $ sudo nano /etc/modprobe.d/raspi-blacklist.conf

terminal.nano.blacklist.conf.png
Fig3. - Edit blacklist.conf.

Exit and save.

Update: update is used to resynchronize the package index files from their sources.
pi@raspberrypi ~ $ sudo apt-get update

Install the I2C utilities:
pi@raspberrypi ~ $ sudo apt-get install i2c-tools

Create device node.
pi@raspberrypi ~ $ sudo mknod /dev/i2c-1 c 89 1
chmod - change file mode bits
pi@raspberrypi ~ $ sudo chmod 664 /dev/i2c-1
chown - change file owner and group.
pi@raspberrypi ~ $ sudo chown root:i2c /dev/i2c-1

Add pi user to I2C group:
pi@raspberrypi ~ $ sudo adduser pi i2c

terminal.adduser.to.i2c.png
Fig4. - Add user to i2C.

Create device node for PCA9555.
Any device nodes you create in /lib/udev/devices will be copied into /dev/ at system start.
pi@raspberrypi ~/plux $ sudo mknod /lib/udev/devices/pca9555 c 89 1
chown - change file owner and group.
pi@raspberrypi ~/plux $ sudo chown root:i2c /lib/udev/devices/pca9555
chmod - change file mode bits
pi@raspberrypi ~/plux $ sudo chmod 664 /lib/udev/devices/pca9555
ls - list directory contents.
pi@raspberrypi ~/plux $ ls -sl /lib/udev/devices/pca*
0 crw-rw-r-- 1 root i2c 89, 1 Feb 27 22:55 /lib/udev/devices/pca9555

Reboot and make a new connection.
pi@raspberrypi ~ $ sudo reboot

Broadcast message from root@raspberrypi (pts/0) (Fri Feb 28 11:52:32 2014):
The system is going down for reboot NOW!
pi@raspberrypi ~ $ Connection to 192.168.1.222 closed by remote host.
Connection to 192.168.1.222 closed.
ivo@aspireI7:~$ ssh pi@192.168.1.222
Linux raspberrypi 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Feb 28 09:45:49 2014 from 192.168.1.101
pi@raspberrypi ~ $


After the reboot run i2cdetect.
pi@raspberrypi ~ $ sudo i2cdetect -y 1

terminal.i2cdetect.png
Fig5. - Run i2cdetect.

i2cdetect -y 1 returns the addresses of all connected and recognised I2C-Devices.
The PCA9555 Port-Expander (I2C/GPIO Digital 24 volt IO-interface) is located between 0x20 and 0x27.
The ADS7830 GNUBLIN Module-ADC is located between 0x48 and 0x4B.
Found a PCA9555 (address 0x20 and address 0x48).

Top

PLµX software installation.

Last modified:

Create a plux folder in the user directory.
Change to user directory:
pi@raspberrypi ~ $ cd ˜
Print name of current directory:
pi@raspberrypi ~/plux $ pwd
/home/pi/plux
Make directory:
pi@raspberrypi ~ $ mkdir plux
Change into the plux directory:
pi@raspberrypi ~ $ cd plux/
List directory contents:
pi@raspberrypi ~/plux $ ls -al
total 8
drwxr-xr-x 2 pi pi 4096 Mar 3 17:04 .
drwxr-xr-x 6 pi pi 4096 Mar 3 17:04 ..

terminal.cd.plux.png
Fig6. - Change to plux directory.


Using wget to download the PLµX zip files:
pi@raspberrypi ~/plux $ wget http://www.dcisite.be/download/plux.embedded.zip
Unzip 'plux.zip' to current directory:
pi@raspberrypi ~/plux $ unzip plux.embedded.zip -d ./

terminal.wget.plux.embedded.png
Fig6. - wget plux.embedded.zip.

< Previous - - - Next >

Top

Leave a Message.