-
-
Notifications
You must be signed in to change notification settings - Fork 14
WebApp
Mozilla's IoT Gateway is providing a UI (using SVG widgets), it's pretty usable on any modern devices, but nothing prevent to create other webapps to control webthings.
Users can also install and use a standalone webapp (disconnected from the internet), check repo's README for up to date info:
- https://github.com/rzr/webthings-webapp
- https://s-opensource.org/2018/06/21/webthing-iotjs/
Originally designed as Tizen app (wgt) using Tizen Advanced UI Framework (TAU)
It was tested on Tizen:5 on TM1, WiFi needs to be enabled again, it's not trivial but I shared some hints on Tizen's wiki:
Some patches are still under review:
Earlier Tizen's version might not work because mozilla's gateway UI is expecting recent browsers.
Technically, While online app can rely on Oauth flow, for locally loaded pages it will not work due to security restrictions, so some fallack options can be used:
- Parse token page using a XPATH query
- https://github.com/mozilla-iot/gateway/pull/1149# (Status: Released in 0.8.0)
Then the application was then "ported" to Android using Progressive Web App (PWA) for Samsung Internet browser, just open those links:
Since PWA was supported in Tizen, so I should worth a try on updated version.
Used repository:
- https://github.com/rzr/webthings-webapp
- https://github.com/tizenteam/webthings-webapp
It should be configured to allow third party application:
app_url="https://$username.mozilla-iot.org/"
token_name="$username.mozilla-iot.org"
secrect="$token_name"
tail /home/pi/mozilla-iot/gateway/src/models/oauthclients.ts
// (...)
oauthClients.register(
new ClientRegistry(new URL('$appurl'),
'$tokenname',
'WebApp Token Service',
'$secret',
'/things:readwrite'));
export default oauthClients;
For example:
Resources:
Check XR page
Apply this patch for passing token when application is loaded from filesystem (file:// scheme)
curl https://github.com/TizenTeam/gateway/commit/a0fbcdcc7a62d23d7b3430d4e8d5007a0d71133e.patch | patch -p1
#| patching file src/views/local-token-service.handlebars
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