-
-
Notifications
You must be signed in to change notification settings - Fork 14
TizenRT
While Tizen GNU/Linux based Operating System is powering high end devices like TV, Wearables and most devices with rich rendering, it's not designed to target low end IoT devices or baterry powered small appliances.
Tizen:RT wants to address more devices and reusing API or concepts deployed in his older brother.
If you are interested for a summary overview check this short presentation of TizenRT:
- https://www.slideshare.net/SamsungOSG/tizen-rt-a-lightweight-rtos-platform-for-lowend-iot-devices
- https://archive.fosdem.org/2018/schedule/event/tizen_rt/
For deeper understanding the following link might be useful too:
IoT.js is part of Tizen:RT, and the current master branch provides some facilities to use an older IoT.js version, but it can be upgraded.
To replicate WEBTHING-IOTJS ON ARTIK05Xs demo, please jump to the ARTIK chapter, this automates all tasks on the development branch.
But if you need/want to work on your master TizenRT branch, you'll have to manually do the extra following steps:
If in a hurry you can skip this step and rely on helper scripts explained later in the ARTIK chapter.
Or follow the supported documentation, to install tools and build and deploy sample image.
Again, if in a hurry you can rely on helper scripts and skip this chapter.
Currently webthing-iotjs is not supporting the version of IoT.js shipped into Tizen:RT, so it should be upgraded, by just applying this changes set:
- https://github.com/Samsung/TizenRT/pull/2018# (Status: under review)
- https://github.com/TizenTeam/TizenRT
- https://github.com/TizenTeam/libtuv
Again, this chapter can be skipped if using helper config made for ARTIK05X, (but you'll have to configure WiFi anyway).
To rebuild Tizen:RT with IoT.js my upstreamed launcher app should be enabled, ROMfs enabled, WiFi configured as explained:
Or start on existing "iotjs" configuration for ARTIK05x
Finally javascripts should be placed in the contents subdir, as explained upstream:
More information about building IoT.js master branch:
Status: Merged
- https://github.com/Samsung/TizenRT/pull/1982# (Status: Merged)
- https://github.com/Samsung/TizenRT/pull/2009# (Status: Merged)
There are some helper scripts to setup and rebuild it all with a single make command.
project="tizenrt"
url="https://github.com/tizenteam/tizenrt"
branch="sandbox/rzr/devel/webthing/master"
git clone --recursive --depth 1 -b "$branch" "$url" ; cd "$project"
make setup # Will install tools (on debian based OS) # ToDo adapt for others
make menuconfig # Configure WiFi to connect your hotspot (HowToUseIoTjs.md)
make demo # Add tty=/dev/ttyUSB1 # Add this if not detected properly
It was tested on ARTIK055s and ARTIK053s but should be also working on ARTIK053, just override machine variable in any make calls like
ie:
make menuconfig demo machine=artik053s tty=/dev/ttyUSB1
Default configuration connecting to "public" hotspot might not work, so you'll have to change settings to set your WiFi router credentials For that you need to run menuconfig again and edit credentials, (typically for WPA2: Auth=4 and Enc=5 or 4)
Then on reboot, if connecting, note IP from terminal's log:
U-Boot 2017.01-g59977f7 (Nov 23 2017 - 16:09:52 +0900)
CPU: Exynos200 @ 320 MHz
Model: ARTIK-053 based on Exynos T20
DRAM: 946 KiB
WARNING: Caches not enabled
BL1 released at 2017-3-13 15:00
SSS released at 2017-09-12
WLAN released at 2017-09-15
Flash: 8 MiB
*** Warning - bad CRC, using default environment
In: serial@80180000
Out: serial@80180000
Err: serial@80180000
Hit any key to stop autoboot: 0
gpio: pin gpg16 (gpio 46) value is 1
## Starting application at 0x040C�020 ...
s5j_sflash_init: FLASH Quad Enabled
uart_register: Registering /dev/console
uart_register: Registering /dev/ttyS0
uart_register: Registering /dev/ttyS1
uart_register: Registering /dev/ttyS2
uart_register: Registering /dev/ttyS3
uart_register: Registering /dev/ttyS4
System Information:
Version: 1.1
Commit Hash: 4fa524ccfbb5d76da971e219353bf642e811535b
Build User: philippe@wsf1127
Build Time: 2018-08-28 15:15:03
System Time: 01 Jan 2010, 00:00:01 [s] UTC Hardware RTC Support
TASH>>log: iotjs_startup_wifi_connect
log: Connecting to SSID "35honeypot" (4+5)
log: Wait (1/3) sec...
i2c_uioregister: Registering /dev/i2c-0
i2c_uioregister: Registering /dev/i2c-1
log: Wait (2/3) sec...
log: Wait (3/3) sec...
[WM] T7 _handle_request:1317 state(0) evt(0)
[WM] T7 _handler_on_uninitialized_state:870 state(0) evt(0)
Starting supplicant in foreground...
1262304004.153364: Successfully initialized wpa_supplicant
1262304007.236875: wl1: callling L2_packet_init:
1262304007.236875: wl1: Own MAC address: 28:6d:FF:FF:FF:FF
[WM] T7 <-- _handle_request
[WM] T7 _handle_request:1317 state(1) evt(4)
[WM] T7 _handler_on_disconnected_state:920 state(1) evt(4)
[WM] T7 _wifimgr_connect_ap:727
[WM] T7 _wifimgr_save_connected_config:716
[WM] T7 <-- _handle_request
1262304009.302528: wl1: Associated with e4:9e:FF:FF:FF:FF
1262304009.312507: wl1: WPA: Key negotiation completed with e4:9e:FF:FF:FF:FF [PTK=CCMP GTK=CCMP]
1262304009.312507: wl1: CTRL-EVENT-CONNECTED
[WM] T12 _wifi_utils_connect_event:817
[WM] T12 _handle_request:1317 state(3) evt(9)
[WM] T12 _handler_on_connecting_state:988 state(3) evt(9)
#|==> [WM] IP address : 192.168.1.42 ---- <==|# This is your IP please note this for later
[WM] T12 _handle_user_cb:1252
[WM] call sta connect success event
log: iotjs_startup_wifi_sta_connected status=0x0
Then device can be then added to Gateway from the Web dashboard:
- Got to settings page of Gateway
- Check that adapter is loaded in "adapter page"
- It not then add "Web Thing : Native web thing support" plugin listed on "addon page"
- Then in the thing menu press the (+) button to add thing, at bottom of page click "add by URL"
- Enter http://$ip:$port and save and add, it should be displayed minimized on main screen or expended form:
- Status: Devel (Snapshot)
Check and fix I2C, ADC, SPI support:
Check Concept page for overview, Gateway to get started, IotJs page to install runtime to build webthing as explained in Home page.
For further experiments check Social and Sensor, or Extra parts like WebApp (for Tizen or PWA) or MCU info about running on other microcontrollers not supported by TizenRT.
While Home focus mostly on using iotjs to build webthings (on GNU/Linux or TizenRT for ARTIK05X devices).
This document is still in draft state, but reviews are always welcome, if you try to replicate it and stuck on missing instructions I would appreciate that you file issues or even better make pull request (just edit in github) that insert "TODO marks" in following chapters, like:
- TODO: please explain more this chapter and then remove this TODO line
Community contributions are welcome at:
Support is also possible, ask in:
- https://github.com/rzr/webthing-iotjs
- irc://irc.mozilla.org/#iot
WARNING: Developement branches could break over time.
Instead of maintaining "quick and dirty" demo code, I decided to split demo in smaller independents parts (which can reused) and I am upstreaming the most I can.
Then support can be done on mainline branches (or released versions).
Note that, Upstreaming can be a slow process, so snapshots links will remain until 100% of code is upstreamed.
Licence:
Reference documentation is at:
-
Concept:
- Demo Concept and Architecture
-
Gateway:
- Getting started with Mozilla IoT gateway
-
IotJs:
- Install IoT.js needed to run webthings
-
Home:
- Welcome page to build WebThings using IotJs
-
Social:
- Notification service using Mastodon FLOSS
-
TizenRT:
- webthing-iotjs on ARTIK05x
-
Sensor: and Actuator
- Physical interactions
-
Extra hints:
- Docker: About running in container
- MCU: About microcontrollers (not supported by TizenRT)
- WebApp: Alternate browser (Tizen and PWA)
- GnuLinux: Article about Edison and other
- Raspbian: Article about RaspberryPi
- Arduino: Alt For atmel or Esprissif boards
- DigitalTwins : WiP experiments
- TODO: Work in progress