-
-
Notifications
You must be signed in to change notification settings - Fork 14
Extra
Developing webthing on Arduino APIs or compatible platforms such as Espressif ESP8266 or ESP32
Once your have setup build tool, Developing is pretty straight forward, and it has been covered earlier:
"Smart Orchid Demo" showed a light controller and arduino moisture sensor:
The RGB Lamp code is upstreamed at:
Since I shared a slightly more advanced example that handle ADC port, it was used to monitor the moisture of the ground of a plant.
Hardware side, I used an Arduino mega with Ethernet Shield (same one in this IoTivity 1.2 "arduino switch" demo)
A moisture sensor is just plugged on analog pin (and +5v GND, the digital pin was not used here, but it can be used for other boards without analog like RaspberryPi and use potentiometer as "hardware threshold").
-
TODO: refactor to handle Arduino's WiFi shield too
-
TODO: port iotjs to arduino and compare perfs
For reference code was developed in this repo: (but most of it is upstreamed)
For the "Smart Orchid" notification service, it's relying on W3C Activity Pub and Mastodon FLOSS.
To try IoT.js, I made a simple command line client to the mastodon network, it's also compatible with node, check related infos to use and setup account:
Then I implemented a thing (works with node or iotjs):
- https://github.com/TizenTeam/webthing-node/blob/sandbox/rzr/devel/artik/master/example/actuator-mastodon.js
- https://github.com/TizenTeam/webthing-node/blob/sandbox/rzr/devel/artik/master/example/mastodon-thing.js
Note, If you want to use earlier GNU social instance it should work same or be easy to adapt.
- TODO: Create adapter for gateway
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