Rapid IoT Prototyping with Tizen on Raspberry Pi
-
Upload
leon-anavi -
Category
Technology
-
view
722 -
download
2
Transcript of Rapid IoT Prototyping with Tizen on Raspberry Pi
![Page 1: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/1.jpg)
Rapid IoT Prototyping with Tizen on Raspberry PiLeon [email protected]@anavi.org
![Page 2: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/2.jpg)
Agenda
Tizen
Raspberry Pi
Sensors and peripherals
Building Tizen for Raspberry Pi
Communication between IoT
Open source hardware HAT
![Page 3: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/3.jpg)
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.
![Page 4: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/4.jpg)
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
![Page 5: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/5.jpg)
Tizen Architecture
Web applications
Web framework Native framework
Core components
Linux kernel and device drivers
Native applications
![Page 6: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/6.jpg)
Raspberry Pi
Low cost single board computer
Broadcom ARM SoC
Huge community
Most popular programming languages: Python, C, C++, etc.
![Page 7: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/7.jpg)
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
![Page 8: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/8.jpg)
Raspberry Pi Flavors
![Page 9: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/9.jpg)
Major changes since B+
Raspberry Pi B (2011) Raspberry Pi B+ (2014)
26 pins40 pins
![Page 10: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/10.jpg)
Major changes since B+
GPIO
I2C
UART
SPI
Other interfaces
![Page 11: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/11.jpg)
Official Peripherals
Raspberry Pi official 7” touch screen display
Raspberry Pi 5MP/8MP camera
Sense HAT
![Page 12: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/12.jpg)
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...
![Page 13: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/13.jpg)
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
![Page 14: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/14.jpg)
1-Wire
Single-wire communication protocol
Half-duplex bidirectional communication (master-slave)
Slower data transfer but longer range than I2C
DS18B20 temperature sensor
![Page 15: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/15.jpg)
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
![Page 16: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/16.jpg)
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
![Page 17: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/17.jpg)
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
![Page 18: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/18.jpg)
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
![Page 19: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/19.jpg)
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
![Page 20: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/20.jpg)
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/
![Page 21: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/21.jpg)
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
![Page 22: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/22.jpg)
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
![Page 23: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/23.jpg)
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
![Page 24: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/24.jpg)
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
![Page 25: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/25.jpg)
Communication between IoT
HTTP/HTTPS
MQTT
CoAP
IoTivity
Other
![Page 26: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/26.jpg)
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
![Page 27: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/27.jpg)
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/
![Page 28: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/28.jpg)
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
![Page 29: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/29.jpg)
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
![Page 30: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/30.jpg)
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
![Page 31: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/31.jpg)
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
![Page 32: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/32.jpg)
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
![Page 33: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/33.jpg)
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
![Page 34: Rapid IoT Prototyping with Tizen on Raspberry Pi](https://reader031.fdocuments.net/reader031/viewer/2022021421/5a6d415d7f8b9ab3418b64b1/html5/thumbnails/34.jpg)
Thank you!