Table of Contents
WEATHER-BOARD with shifter shield on ODROID-XU4
Directly connecting WEATHER-BOARD to ODROID-XU4
H/W I2C(I2C-A)
Kernel 3.10.y (node name) | Kernel 4.9.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)
Kernel 3.10.y (node name) | Kernel 4.9.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 |
How to check WEATHER-BOARD with i2c-tools.
Install i2c-tools pakage.
sudo apt-get install i2c-tools
Weather board check command
odroid@odroid:~$ sudo i2cdetect -y -r [i2c-dev node number]
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 odroid@odroid:~$
Weather board rev 0.2 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: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 76 odroid@odroid:~$
Pure C code
Install git package
odroid@odroid:~$ sudo apt-get install git
Get the WEATHER-BOARD source code.
odroid@odroid:~$ mkdir work odroid@odroid:~$ cd work odroid@odroid:~/work$ git clone https://github.com/hardkernel/WEATHER-BOARD.git odroid@odroid:~/work$ cd WEATHER-BOARD/c_weather odroid@odroid:~/work/WEATHER-BOARD/c_weather$ make
Check your I2C node first and run the program.
odroid@odroid:~/work/WEATHER-BOARD/c_weather$ sudo ./weather_board [i2c node name(default /dev/i2c-1)]
If weather board is connected to I2C Channel-A (Kernel 4.9.y)
odroid@odroid:~/work/WEATHER-BOARD/c_weather$ sudo ./weather_board /dev/i2c-1
WiringPi
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/john1117/WEATHER-BOARD.git cd WEATHER-BOARD/c_weather/wiringPi make sudo ./weather_board [/dev/i2c-number]
for Android
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 this line and must reboot system.
/dev/i2c-1 0666 system system
source code
git clone https://github.com/codewalkerster/weatherboard