WEATHER-BOARD with shifter shield on ODROID-XU4

The WEATHER-BOARD can use one of three I2C buses on the SHIFTER-SHIELD.

Directly connecting WEATHER-BOARD to ODROID-XU4


H/W I2C(I2C-A) on CON10

Kernel 3.10.y
(node name)
Kernel 4.14.y
(node name)
Net Name Export Number Description
/dev/i2c-4 /dev/i2c-1 GPB3[2](I2C_1.SDA) 209 SDA
GPB3[3](I2C_1.SCL) 210 SCL

H/W I2C(I2C-B : HS-I2C) on CON11

Kernel 3.10.y
(node name)
Kernel 4.14.y
(node name)
Net Name Export Number Description
/dev/i2c-1 /dev/i2c-5 GPA2[2](I2C_5.SDA) 187 SDA
GPA2[3](I2C_5.SCL) 188 SCL

This instruction was tested on Ubuntu 18.04 Install package

sudo apt install i2c-tools

Find your device's address with “i2cdetect”.

sudo i2cdetect -y -r [1 or 5]

If you wired your device to pin #14 and #16 on CON10, then you can find the device's address with the following command.

odroid@odroid:~$ sudo i2cdetect -y -r 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- 76 --                         
odroid@odroid:~$

Otherwise, if you connect to pin #4 and #6 on CON11, you can find the address with this command.
Note that this I2C channel-B is a SMBUS type and you have to add '-r' option mandatory.

odroid@odroid:~$ sudo i2cdetect -y -r 5
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- 76 --                         
odroid@odroid:~$
H/W I2C(I2C-B : HS-I2C) doesn't work with i2cdetect command on Kernel 3.10

Weather board rev 0.1 output

odroid@odroid:~$ sudo i2cdetect -y -r 1

    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f                             
00:          -- -- -- -- -- -- -- -- -- -- -- -- --                             
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --                             
70: -- -- -- -- -- -- -- 77

This guide is tested on Ubuntu 16.04(kernel XU4-4.9.27).

Install git package

$ sudo apt-get install git

Get the WEATHER-BOARD source code.

$ mkdir work
$ cd work
$ git clone https://github.com/hardkernel/WEATHER-BOARD.git
$ cd WEATHER-BOARD/c_weather
$ make

Check your I2C node first and run the program.

$ sudo ./weather_board [i2c node name(default /dev/i2c-1)]

If weather board is connected to I2C Channel-A (Kernel 4.9.y)

$ sudo ./weather_board /dev/i2c-1

If you want to get the WEATHER-BOARD source code using wiringPi library.

$ git clone https://github.com/hardkernel/wiringPi
$ cd wiringPi
$ ./build
 
$ git clone https://github.com/hardkernel/WEATHER-BOARD.git
$ cd WEATHER-BOARD/c_weather/wiringPi
$ make
 
$ sudo ./weather_board [/dev/i2c-number]
$ sudo apt install python-smbus
$ git clone https://github.com/hardkernel/WEATHER-BOARD.git
$ cd WEATHER-BOARD/python_weather
$ python weather_board.py [/dev/i2c-number]

Change the permissions for /dev/i2c-1 node.

shell@odroidxu3:/ $ su
root@odroidxu3:/ # mount -o rw,remount /
[ 2147.583574] [c6] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
root@odroidxu3:/ # vi /uevent.odroidxu3.rc

Add behind line to /uevent.odroidxu3.rc and you have to reboot the ODROID-XU4.

/dev/i2c-1                0666   system     system

Please download the project by behind's commands. And then build and test the project.
We recommend to use Android Studio.

$ git clone https://github.com/codewalkerster/weatherboard

If you success running the project, you can see the screen like the screenshot.