Rapid IoT Prototyping with Tizen on Raspberry PiLeon [email protected]@anavi.org
Agenda
Tizen
Raspberry Pi
Sensors and peripherals
Building Tizen for Raspberry Pi
Communication between IoT
Open source hardware HAT
Tizen
Open source Linux-based software platform
Project of the Linux foundation
Compatible with ARM, MIPS and Intel architectures
Excellent HTML5 and web apps support
Suitable of all device areas: mobile, wearable, embedded, TV, IVI, IoT, etc.
Tizen Milestones
2011 - Start of the project
2012 - Initial release
2013 - First Tizen devices (Samsung NX200 & NX300 cameras)
2014 - First Tizen smartwatches (Samsung Gear 2 & Gear 2 Neo)
2015 - Samsung Z1 - the first Tizen smarthone
2015 - Tizen ported to Raspberry Pi
Tizen Architecture
Web applications
Web framework Native framework
Core components
Linux kernel and device drivers
Native applications
Raspberry Pi
Low cost single board computer
Broadcom ARM SoC
Huge community
Most popular programming languages: Python, C, C++, etc.
Raspberry Pi Milestones
2009 - Raspberry Pi Foundation
2012 - The 1st Raspberry Pi
2014 - Raspberry Pi B+
2015 - Tizen ported to Raspberry Pi
2016 - Raspberry Pi Zero
2017 – Raspberry Pi Zero W
Raspberry Pi Flavors
Major changes since B+
Raspberry Pi B (2011) Raspberry Pi B+ (2014)
26 pins40 pins
Major changes since B+
GPIO
I2C
UART
SPI
Other interfaces
Official Peripherals
Raspberry Pi official 7” touch screen display
Raspberry Pi 5MP/8MP camera
Sense HAT
I2C
Inter-integrated Circuit (I2C) Protocol
Full-duplex bidirectional two-wire serial bus for communication of multiple slave devices with one or more master devices
Raspberry Pi B+ and newer models have two I2C buses
SCL
SDA
MasterRaspberry Pi
(pins: 3, 5) Slave 1 Slave 2 Slave N...
Popular I2C Sensors
HTU21D – temperature and humidity
BME280 - temperature, barometric pressure and humidity
BMP280/BMP180/BMP085 – temperature and barometric pressure
HMC5883L - compass
TSL2561 – light
BH1750 - light
1-Wire
Single-wire communication protocol
Half-duplex bidirectional communication (master-slave)
Slower data transfer but longer range than I2C
DS18B20 temperature sensor
SPI
Serial Peripheral Interface (SPI) bus
Synchronous serial communication in master-slave architecture
Popular SPI peripheral devices such as sensors, displays, NFC/RFID readers/writers
Analog sensors
Raspberry Pi does NOT have a built-in A/D converter
Popular external A/D converters:
● Microchip MCP3002 dual channel A/D converter
● Microchip MCP3008 8 channel A/D converter
Tizen for Raspberry Pi
Samsung Open Source Group (OSG) initially ported Tizen 3.0 to Raspberry Pi 2 Model B using the Yocto Project and OpenEmbedded (OE)
Tizen on Yocto/OE aims at building Tizen images using the tools provided by the Yocto Project
Tizen on Yocto/OE provides Tizen distribution layer meta-tizen
Tizen for Raspberry Pi uses BSP layer meta-raspberrypi
Craftroom with Tizen 4.0 and Raspberry Pi support
announced at TDC2017
What is in Tizen 3.0 for Raspberry Pi?
Linux kernel
Smack
RPM Package Manager
systemd
GCC
Crosswalk
Cynara
SQLite
PulseAudio
Wayland & Weston
GNU C Library
EFL
The Yocto Project
Open source collaborative project for creating custom Linux-based systems for embedded devices
Based on the OpenEmbedded build framework
Project of the Linux Foundation
Used for building Poky, Automotive Grade Linux (AGL), GENIVI Development Platform (GDP), Tizen, Reference Design Kit (RDK), Ångström, Arago, Ostro, AsteroidOS, etc.
Getting started:
https://www.yoctoproject.org/
https://www.yoctoproject.org/documentation
Raspberry Pi Yocto/OE BSP
Yocto/OE BSP layer for Raspberry Pi: meta-raspberrypi
Upstream of meta-raspberrypi:
http://git.yoctoproject.org/cgit.cgi/meta-raspberrypi/
Fork of meta-raspberrypi from Samsung Open Source Group (OSG) with enabled 3D hardware acceleration for Wayland/Weston:
http://git.s-osg.org/meta-raspberrypi.git/
Building Tizen for Raspberry Pi
Download tizen-distro
Download meta layers with additional board support packages (BSP)
Configure conf/local.conf and conf/bblayers.conf
Launch a build of a Tizen image... get a cup of tea while waiting...
Grab the generated image from tmp-glibc/deploy/images/${MACHINE}
Details:
https://wiki.tizen.org/Raspberry_Pi#Build_using_Tizen_Yocto
Adding Packages
Append packages, for example vim, to image by adding the following command to conf/local.conf or the image's recipe:
IMAGE_INSTALL_append = " vim "
Customize the Tizen image by adding or removing packages
Bitbake Cheat Sheet Check value of a variable in a recipe
bitbake tizen-common-core-image-crosswalk -e | grep ^ROOTFS_PKGMANAGE
Check recipe version
bitbake -s | grep crosswalk
Build a package or an image
bitbake foo
Clean up
bitbake -c clean foo
Recompile if the source has been changed
bitbake -f -c compile foo
Output dependency tree in graphviz format
bitbake -g tizen-common-core-image-crosswalk
Contributing to Tizen on Yocto
Tizen-distro uses combo-layer script git://git.tizen.org/scm/bb/tizen-distro
Tizen-distro layers:
openembedded-core, meta-openembedded, meta-qt5, meta-tizen
Meta-tizen git://git.tizen.org/scm/bb/meta-tizen
Step by step instructions for contributing through Git and Gerrit
https://wiki.tizen.org/How_to_contribute_to_Tizen_on_Yocto_Project
Communication between IoT
HTTP/HTTPS
MQTT
CoAP
IoTivity
Other
Putting the Pieces Together
Customize Tizen image for Raspberry Pi using Yocto/OE
Pick up the right peripherals
Design custom add-on board for Raspberry Pi
Consider using the free and open source software tool KiCAD for designing open source hardware add-on boards
Create prototypes using the services of OSHPark, Chinese companies or your local PCB manufacturer
Open Source Hardware
Design specifications of a PCB or another physical object which are licensed in such a way that said object can be studied, modified, created, and distributed by anyone
Popular open source hardware devices:
Arduino, OLinuXino, Beaglebone, MinnowBoard
Open Source Hardware Association (OSHW)
https://www.oshwa.org/
Making Raspberry Pi HAT
Form factor and dimensions (65x56mm)
40 pin header compatible with Raspberry Pi B+ and the newer models
EEPROM with device tree fragment
Details:
https://www.raspberrypi.org/blog/introducing-raspberry-pi-hats/
https://github.com/raspberrypi/hats
Making Raspberry Pi pHAT
Form factor suitable for Raspberry Pi Zero with 4 mount holes
Dimensions 65x30mm
40 pin through-hole header
EEPROM not mandatory
*Not an official standard of the Raspberry Pi Foundation
Showcase 1: Bringing Life in Retro Devices
ANAVI Infrared pHAT (open source hardware)
Linux Infrared Remote Control (LIRC)
Replacing IR remote controls of old TV, HiFi, air conditioners and making them IoT
Showcase 2: Raspberry Pi Gardening
ANAVI Gardening pHAT with MCP3002 A/D Converter
Analog soil moisture sensors
1-wire DS18B20 waterproof sensor
I2C sensors for light, temperature and humidity
Join the Tizen Community!
Mailing lists: https://www.tizen.org/community/mailing-lists
IRC: #tizen channel on freenode
Forums: https://developer.tizen.org/forums
Wiki: https://wiki.tizen.org/Main_Page
Useful resources:
https://www.raspberrypi.org/
https://www.tizen.org/
https://wiki.tizen.org/Raspberry_Pi
https://blogs.s-osg.org/tizen-on-rpi2/
https://wiki.tizen.org/Tizen_on_Yocto_Project
https://wiki.tizen.org/wiki/Build_Tizen_with_Yocto_Project
https://wiki.tizen.org/How_to_contribute_to_Tizen_on_Yocto_Project
Thank you!