-
-
Notifications
You must be signed in to change notification settings - Fork 14
TODO
Work in progress to be documented in separate pages.
Check XR page
Compare performance to python and uPy
- https://github.com/mozilla-iot/webthing-python
- https://pypi.org/project/webthing/
- https://github.com/mozilla-iot/webthing-upy
Or if using docker-compose:
docker-compose --verbose run start/board/artik530
Recreating webthingnode_web_1
Attaching to webthingnode_web_1
web_1 | log: Loading platform: artik710
web_1 | Usage:
web_1 | /usr/bin/iotjs example/platform/index.js [port]
web_1 | Try:
web_1 | curl -H "Accept: application/json" http://localhost:8888
web_1 |
web_1 | log: SW404 ready:null
web_1 | log: SW403 ready:null
web_1 | log: gpio: RedLed: ready? (null expected): null
web_1 | log: gpio: BlueLed: ready? (null expected): null
web_1 | log: gpio: SW404: update: true
(...)
web_1 | log: gpio: BlueLed: writing: true
(...)
(... user hit Ctrl+C ...)
Gracefully stopping... (press Ctrl+C again to force)
Stopping webthingnode_web_1 ...
Stopping webthingnode_web_1 ... done
- Use docker on windows or try WSL:
- https://github.com/xoseperez/espurna/issues/1506 (Open)
- https://github.com/xoseperez/espurna/wiki/RESTAPI
- https://www.amazon.com/WINGONEER-Voltage-Detector-Terminal-Arduino/dp/B06XHKZCD4/ref=rzr-21#
- http://qqtrading.com.my/voltage-sensor-module#
- http://www.instructables.com/id/Arduino-Voltage-Sensor-0-25V/#
- https://www.npmjs.com/package/pwm#
- https://github.com/djdeath/pwm#
- https://www.npmjs.com/package/raspi-pwm#
- https://www.npmjs.com/package/raspi-soft-pwm#
- https://www.npmjs.com/package/rpio-pwm#
- https://www.thingful.net/?lat=48.1326&lng=-1.6554&z=20
- https://maps.luftdaten.info/#14/48.1326/-1.6554#
- https://maps.luftdaten.info/grafana/d-solo/000000004/single-sensor-view?orgId=1&panelId=2&var-node=27752#
Alternatively:
. /etc/os-release
image="${NAME,,}:${VERSION_ID}" # or debian:latest ...
sed -e "s|^FROM [^ ]*|FROM $image|g" -i Dockerfile
script
time $sudo docker build -t webthings-gateway-deb .
Sending build context to Docker daemon 562.2kB
Step 1/18 : FROM ubuntu:18.04 as webthings-gateway-builder
18.04: Pulling from library/ubuntu
(...)
time $sudo docker build -t webthings-gateway-deb .
(...)
dpkg-buildpackage: info: full upload (original source is included)
+ cd ..
++ ls webthings-gateway_0.11.0-1_armhf.deb
+ _deb=webthings-gateway_0.11.0-1_armhf.deb
++ lsb_release -is
++ tr '[A-Z]' '[a-z]'
++ lsb_release -cs
++ tr '[A-Z]' '[a-z]'
+ _renamed=webthings-gateway_0.11.0-1_armhf-ubuntu-bionic.deb
+ mv webthings-gateway_0.11.0-1_armhf.deb webthings-gateway_0.11.0-1_armhf-ubuntu-bionic.deb
+ ln -s webthings-gateway_0.11.0-1_armhf-ubuntu-bionic.deb webthings-gateway.deb
+ echo ''
+ echo 'Done building: webthings-gateway_0.11.0-1_armhf-ubuntu-bionic.deb'
Done building: webthings-gateway_0.11.0-1_armhf-ubuntu-bionic.deb
+ sync
Removing intermediate container a08e79d08892
---> 95c126961d48
Successfully built 95c126961d48
Successfully tagged gateway-deb:latest # TODO
real 76m18.885s
user 0m4.366s
sys 0m1.483s
docker image ls
gatewaydeb_default latest 32e5bdf8321c 8 hours ago 843MB
project=webthings-gateway
dir=/usr/local/opt/${project}/dist
repository=webthings-gateway-deb
tag="latest"
image="$repository:$tag"
#docker commit "$image" "$repository"
container=$(docker create "$image")
# ad10b93f6b19801a958021ee60808eca376c15b25d4036a9ce52ea8cae88180c
mkdir -p tmp/output
docker cp "$container:$dir/" ../
sudo apt-get install docker-compose # 1.21.0-3
time docker-compose up
#| Creating network "gatewaydeb_default" with the default driver
#| Building default
#| Step 1/18 : FROM ubuntu:18.04 as webthings-gateway-builder
#| 18.04: Pulling from library/ubuntu
#| (...)
#|
apt-get remove webthings-gateway docker.io
sudo apt install --install-recommends ./dist/webthings-gateway_*.deb
sudo chmod -Rv 700 /var/cache/apt/archives/partial/
reboot
https://odroid.com/dokuwiki/doku.php?id=en:xu4_hardware#expansion_connectors
remote.sh [email protected]
apt-get install alsa-utils
https://github.com/mozilla-iot/gateway-deb/pull/9
some are adapting
Let's check
Add radio
http://odroidxu4.local:8080/things
Radio
Save
Done
https://github.com/flatsiedatsie/internet-radio/blob/master/pkg/internet_radio.py
install -d -o webthings /var/run/webthings-gateway/.mozilla-iot/data/internet-radio
chmod a+rwX -R /var/run/webthings-gateway/.mozilla-iot/data/internet-radio
root@odroidxu4:/etc/webthings-gateway/addons/internet-radio# ffplay -nodisp /usr/share/sounds/alsa/Front_Center.wav
root@odroidxu4:/etc/webthings-gateway/addons/internet-radio# addgroup webthings audio
## MISC ##
* <https://gitlab.com/webthings/all-webthings/tree/master/webthings/system-resources#>
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