Package: sense-hat-webthing
SENSE-HAT WEBTHINGABOUTAddon adapter for WebThings Gateway
using python module to handle I2C sensors and GPIOs
of Raspberry Pi's extension board "SenseHat".USAGEPREREQUISITESInstall WebThings Gateway on RaspberryPI (It was made forhttps://github.com/WebThingsIO/gateway/releases/download/0.12.0/gateway-0.12.0.img.zip)Connect to device's wifi "WebThings Gateway FFFF" and then openhttp://gateway.local/,  Setup WiFi SetupConnect back to LAN Wifi openhttp://gateway.local/thingsagainINSTALLFrom "Settings" add-on menu:Add "and enable add-onThen add "SenseHat" from the things dashboard.CALIBRATEFor using Inertial measurement unit (IMU sensors),
calibration will help to get more accurate measurements.sudoapt-getinstalllibrtimulib-utilscd~/.config/sense_hat/
mv-fRTIMULib.iniRTIMULib.ini.orig
RTIMULibCal#| RTIMULibCal - using RTIMULib.ini#| Settings file not found. Using defaults and creating settings file#| Detected LSM9DS1 at standard/standard address#| Using fusion algorithm RTQF#| min/max compass calibration not in use#| Ellipsoid compass calibration not in use#| Accel calibration not in use#| LSM9DS1 init complete#| Options are:#| m - calibrate magnetometer with min/max#| e - calibrate magnetometer with ellipsoid (do min/max first)#| a - calibrate accelerometers#| (...)grep'='RTIMULib.iniIf done correctly north should be indicated by edge where power LED is located
the compass value is actually the "yaw" value, while "pitch" is around this same edge.
Remaining "roll" value can be changed by rotating on longest middle axis of board.AUTOMATEOnce added in gateway, it can be used along the rule engine:DEVELOP# From Settings / Developer / Enable SSH# https://sensehat.mozilla-iot.org/settings/developersshpi@gateway.local# password=raspberrysudosystemctlstopmozilla-iot-gateway
rm-rf~/.mozilla-iot/addons/sense-hat-*cd~/.mozilla-iot/addons/
gitclonehttps://github.com/rzr/sense-hat-webthingsense-hat-adapter
make-Csense-hat-adapterhelpprepstart# unprep # to restoresudosystemctlrestartmozilla-iot-gateway
sudojournalctl-f-xumozilla-iot-gateway.serviceFrom "/things" webpage "SenseHat" can be added (+, Add, Done)Note that instead of restarting gateway,
from Web UI, any addon can disabled and enabled again.EXTRA: EXAMPLESMore examples can be also used as standone webthing server:cdexample# If on debian, it will be faster:sudoapt-getinstallpython3-sense-hatpip3installwebthing# Or if not on debian:# pip3 install -r requirements.txt./sense-hat-single-thing.pyThen add thing using "URL" adapter it should be discovered as (http://localhost:8888)Same procedure for other exampl, like multiple things which is handling orientation sensor.MOREFor reference the following items are supported:https://www.st.com/resource/en/datasheet/hts221.pdfhttps://www.st.com/resource/en/datasheet/lps25hb.pdfhttps://www.st.com/resource/en/datasheet/lsm9ds1.pdfThanks to Geof Cohler (@gcohler) for support.RESOURCEShttps://libraries.io/pypi/sense-hat-webthinghttps://pypi.org/project/sense-hat-webthing/https://mastodon.social/@rzr/104052909544715058#LavalVirtual2020https://github.com/WebThingsIO/addon-list/pull/822https://discourse.mozilla.org/t/is-there-an-add-on-for-pi-sense-hat/58024/5https://www.openhub.net/p/sense-hat-webthinghttps://github.com/rzr/mozilla-iot-generic-sensors-adapter/issues/13https://github.com/WebThingsIO/wiki/wiki#general-1https://github.com/WebThingsIO/gateway-addon-pythonhttps://hacks.mozilla.org/2018/02/creating-an-add-on-for-the-project-things-gateway/https://libraries.io/pypi/sense-hathttps://www.raspberrypi.org/products/sense-hat/https://www.raspberrypi.org/documentation/hardware/sense-hat/https://github.com/astro-pi/python-sense-hathttps://pythonhosted.org/sense-hat/api/https://github.com/raspberrypi/rpi-sense/https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hathttps://iot.mozilla.org/schemas/https://github.com/WebThingsIO/webthing-python/https://github.com/WebThingsIO/tplink-adapterhttps://github.com/WebThingsIO/eufy-adapter