This is a sample application for IoT SDK: ebisu running on Raspberry Pi. This sample updates temperature from sensor to kii cloud, and waiting command to turn on/off led.
- Raspberry Pi Zero W Rev 1.1 (confirmed)
- One Wire Digital Temperature Sensor - DS18B20
- full color RGB LED
Note: You should be already installed linux OS image to SD card of your Raspberry Pi. It is not the scope of this README about how to prepare a SD card.
- prepared a SD card for raspberry pi with installed linux OS (refer: Installing Images)
- installed driver on host pac for Use serial console (for mac: Software Installation Mac
Note that you can connect to Pi with other ways, like usb keyboard and monitor.
Use serial console is convenient.
Please check the manual about how to do it, Using A Console Cable to Troubleshoot
Additionaly, you need to add the following line to Raspbian boot image /boot/config.txt
enable_uart=1
The connected Pins is like the following 2 images:

In your ternimal console of PC:
# In mac with 115200 communication bit rate
screen /dev/cu.SLAB_USBtoUART 115200
-
install build-essential
sudo apt-get install build-essential -
install libssl
sudo apt-get install libssl-dev -
install cmake
sudo apt-get install cmakethe version of
cmakeis required to be at least3.5. So if the version of cmake in your OS is lower than it. You should consider to build cmake from source. You can try the following script to build cmake from source:sudo apt-get remove cmake wget https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.sh sudo bash cmake-3.10.2-Linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local -
install wiringpi, library for gpio control
sudo apt-get purge wiringpi
GPIO BCM Pi number is used. Please check this official document about gpio of Raspberry Pi
You can simply refer the GPIO number from the following image:

Please check this tutorial to setup Pi.
- Make sure signal pin of sensor connect to GPIO BCM 4 pin of Pi
- Make sure GROUND pin of sensor connect to any GROUND pins of Pi
- Make sure VCC pin of sensor connect to any 5V pins of Pi
Once 1-wire temperature sensor detected by Pi, there is a directory created to present this sensor. You can check by
ls /sys/bus/w1/devices
results like:
28-0416925607ff w1_bus_master1
As above output, there is 28-***. It is connceted DS18B20 sensor. Change W1_FILE_NAME in pi_control.h with the actual value in your Pi.
Please note that, if there are more than one DS18B20 sensors connected to Pi. There are more than one that kind of folder existing.
- Connect GROUND pin of led to any GROUND pin of Pi.
- Connect RED/GREEN/BLUE pins to any GPIO BCM pin of pi. In the sample, BLUE pin connect to GPIO BCM 13, RED pin connect to 19, and GREEN pin connect to 26
If you connect RED/GREEN/BLUE to different pins, you need to change the following defines in pi_control.h.
- BLUE_LED
- RED_LED
- GREEN_LED
make exampleapThis requires tio already generated by last step.
- setup
LD_LIBRARY_PATHto findtioexport LD_LIBRARY_PATH=./build-sdk/usr/local/lib
Onboard with the following values:
- thing-type: AirConditioner
- firmware-version: 1.0
./exampleapp onboard --vendor-thing-id={vendor-thing-id} --password={password}