Connecting a Wovyn sensor to the Internet of Things using a Pico and KRL.
Opening up the sensor, we can see model, serial, and version numbers. Besides its internal sensors, this device has an external temperature probe on a nine foot cable.
Turning over the plastic-shielded printed circuit board, and pulling out the battery pack gives us access to everything we need to proceed.
Configuring the sensor to send its event:
Of course the pico identified by the ECI will need a ruleset to receive the event. This is the KRL code that we used initially.
ruleset post_test { meta { shares __testing } global { __testing = { "queries": [ { "name": "__testing" } ], "events": [ { "domain": "post", "type": "test", "attrs": [ "temp", "baro" ] } ] } } rule post_test { select when post test pre { never_used = event:attrs().klog("attrs") } } } |
The rule selected does nothing but log the event attributes. Notice that the ruleset shares a test harness which allows us to easily send a test event from the "Testing" tab of the "My Picos" page.
We used the "Logging" tab to see what happens when the device sends an event.
Notice that several attributes are sent by the device. The first of these are "version", "eventDomain", "eventName", and "emitterGUID". The horizontal scrollbar indicates that there is much more. Capturing and re-formatting all of it, we see that the remaining attributes are named "genericThing", "specificThing", and "property".
{ "version": 2, "eventDomain": "wovyn.emitter", "eventName": "sensorHeartbeat", "emitterGUID": "5CCF7F0EC86F", "genericThing": { "typeId": "2.2.1", "typeName": "generic.compound.array", "healthPercent": 52.57, "heartbeatSeconds": 600, "data": { "temperature": [ { "name": "probe temperature", "transducerGUID": "5CCF7F0EC86F.1.1", "units": "degrees", "temperatureF": 72.72, "temperatureC": 22.62 }, { "name": "ambient temperature", "transducerGUID": "5CCF7F0EC86F.1.2", "units": "degrees", "temperatureF": 75.67, "temperatureC": 24.26 } ], "humidity": [ { "name": "ambient humidity", "transducerGUID": "5CCF7F0EC86F.1.3", "units": "percent", "humidity": 22.59 } ], "pressure": [ { "name": "ambient pressure", "transducerGUID": "5CCF7F0EC86F.1.4", "units": "mmHg", "pressure": 854.27 } ] } }, "specificThing": { "make": "Wovyn ESProto", "model": "WTemp2001", "typeId": "1.1.2.1.2001", "typeName": "enterprise.wovyn.esproto.wtemp.2001", "thingGUID": "5CCF7F0EC86F.1", "firmwareVersion": "Wovyn-WTEMP2001-1.7", "transducer": [ { "name": "Maxim DS18B20 Digital Thermometer", "transducerGUID": "5CCF7F0EC86F.1.1", "transducerType": "Maxim Integrated.DS18B20", "units": "degrees", "temperatureC": 22.62 }, { "name": "Bosch Sensortec BME280 Digital Humidity, Pressure, and Temperature Sensor", "transducerGUID": "5CCF7F0EC86F.1.2", "transducerType": "temperature.Bosche Sensortec.BME280", "units": "degrees", "temperatureC": 24.26 }, { "name": "Bosch Sensortec BME280 Digital Humidity, Pressure, and Temperature Sensor", "transducerGUID": "5CCF7F0EC86F.1.3", "transducerType": "humidity.Bosche Sensortec.BME280", "units": "percent", "humidity": 22.59 }, { "name": "Bosch Sensortec BME280 Digital Humidity, Pressure, and Temperature Sensor", "transducerGUID": "5CCF7F0EC86F.1.4", "transducerType": "pressure.Bosche Sensortec.BME280", "units": "mmHg", "pressure": 854.27 } ], "battery": { "maximumVoltage": 3.4, "minimumVoltage": 2.7, "currentVoltage": 3.07 } }, "property": { "name": "Wovyn WTEMP2001: 5CCF7F0EC86F", "description": "WTEMP2001", "location": { "description": "Timbuktu", "imageURL": "http://www.wovyn.com/assets/img/wovyn-logo-small.png", "latitude": 16.77078, "longitude": -3.00819 } } } |
We also tried out the "Reset" option, which apparently forgets only the WiFi hotspot the device uses to send its heartbeat events, but retains the endpoint information.
You may also want to use visual panels to communicate related information, tips or things users need to be aware of. |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.
|