I’ve been playing with fiz1962’s ESP-adapter and the accompanying espThing sketch for the Arduino IDE:
https://github.com/fiz1962/ESP-adapter
I’ve gotten the adapter’s javascript code and the accompanying sketch for the ESP8266 working to the point that the gateway can find the thing on the network, and add it to its list of things. However, the thing described in the sketch is of type “thing”, and the gateway doesn’t know what to do with it. The gateway simply displays an icon labeled by the name of the thing that provides no control over the device whatsoever.
It strikes me that the sketch programs the device to be three different things, although two of them are of similar types. Unfortunately, the JSON specification in the sketch doesn’t reflect the actual nature of the device, which is composed of three “things”:
-
An object named “led”, with a boolean property that reflects its current state, and an on-off switch action that can change its state.
-
An object named “clock”, which returns an integer giving the “short” time in milliseconds.
-
An object name “anotherclock”, which returns an integer representing the “long” time.
I have two questions:
-
What thing types are functionally supported in the current version of the gateway software, and
-
Where can I find documentation that describes how to properly describe a device to the Mozilla IoT gateway which is, in actuality, multiple things. (This goes beyond the specification at https://iot.mozilla.org/wot/ to actual programming requirements for this implementation of the specification.)
[UPDATE:] Kathy Giori told me that the “splat” symbol used to represent Things of type “thing” can be clicked, and, if the gateway software can figure out what a “thing” is from the object type of objects within a thing, it will provide it’s own styled representation of that thing.
This leads me to believe that including a specification in the standard for everything that will eventually become part of the Web of Things will result in the complete mental breakdown of anyone who spends much time trying to do it. I’m becoming convinced that defining the things that can be represented in the standard is not a great idea. There are simply too many things in the universe, and a standard like this must be abstract and general. It should specify only how to tell implementing systems where to look for the definition of a particular thing.
Require the person who invented the thing to tell the system what it is and what functionality it has. Specifying thing types in a standard that must accommodate a practically infinite number of things of an as-yet-to-be imagined number of types is, in my humble opinion, a good way to end up mumbling in a dark corner of a mental hospital.