You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](mailto:[email protected])[](https://discord.com/users/1178428338746966066)
9
+
[](mailto:[email protected])[](https://hololinked.dev/contact)
10
10
11
11
### To Install
12
12
@@ -105,7 +105,7 @@ class OceanOpticsSpectrometer(Thing):
105
105
106
106
In this case, instead of generating a data container with an internal name, the setter method is called when `integration_time` property is set/written. One might add the hardware device driver (say, supplied by the manufacturer) logic here to apply the property onto the device. In the above example, there is not a way provided by lower level library to read the value from the device, so we store it in a variable after applying it and supply the variable back to the getter method. Normally, one would also want the getter to read from the device directly.
107
107
108
-
Those familiar with Web of Things (WoT) terminology may note that these properties generate the property affordance schema to become accessible by the [node-wot](https://github.com/eclipse-thingweb/node-wot) HTTP(s) client. An example of autogenerated property affordance for `integration_time` is as follows:
108
+
Those familiar with Web of Things (WoT) terminology may note that these properties generate the property affordance schema. An example of autogenerated property affordance for `integration_time` is as follows:
109
109
110
110
```JSON
111
111
"integration_time": {
@@ -127,9 +127,9 @@ Those familiar with Web of Things (WoT) terminology may note that these properti
127
127
"minimum": 0.001
128
128
},
129
129
```
130
-
If you are not familiar with Web of Things or the term "property affordance", consider the above JSON as a description of
130
+
If you are <spanstyle="text-decoration: underline">not familiar</span> with Web of Things or the term "property affordance", consider the above JSON as a description of
131
131
what the property represents and how to interact with it from somewhere else. Such a JSON is both human-readable, yet consumable
132
-
by a client provider to create a client object to interact with the property.
132
+
by a client provider to create a client object to interact with the property. For example, the Eclipse ThingWeb [node-wot](https://github.com/eclipse-thingweb/node-wot) supports this feature to produce a HTTP(s) client that can issue `readProperty("integration_time")` and `writeProperty("integration_time", 1000)` to read and write this property.
133
133
134
134
The URL path segment `../spectrometer/..` in href field is taken from the `instance_name` which was specified in the `__init__`.
135
135
This is a mandatory key word argument to the parent class `Thing` to generate a unique name/id for the instance. One should use URI compatible strings.
@@ -305,14 +305,14 @@ See a list of currently supported possibilities while using this package [below]
305
305
306
306
> You may use a script deployment/automation tool to remote stop and start servers, in an attempt to remotely control your hardware scripts.
307
307
308
-
One may use the HTTP API according to one's beliefs (including letting the package auto-generate it), but it is mainly intended for web development and cross platform clients like the [node-wot](https://github.com/eclipse-thingweb/node-wot) HTTP(s) client. If your plan is to develop a truly networked system, it is recommended to learn more and use [Thing Descriptions](https://www.w3.org/TR/wot-thing-description11) to describe your hardware. A Thing Description will be automatically generated if absent as shown in JSON examples above or can be supplied manually. The node-wot HTTP(s) client will be able to consume such a description, validate it and abstract away the protocol level details so that one can invoke actions, read & write properties or subscribe to events in a technology agnostic manner. In this way, one can plugin code developed from this package to the rest of the IoT/data-acquisition tools, protocols & standardizations. To know more about client side scripting with node-wot, please look into the documentation [How-To](https://hololinked.readthedocs.io/en/latest/howto/clients.html#using-node-wot-http-s-client) section.
308
+
One may use the HTTP API according to one's beliefs (including letting the package auto-generate it), but it is mainly intended for web development and cross platform clients like the [node-wot](https://github.com/eclipse-thingweb/node-wot) HTTP(s) client. If your plan is to develop a truly networked system, it is recommended to learn more and use [Thing Descriptions](https://www.w3.org/TR/wot-thing-description11) to describe your hardware. A Thing Description will be automatically generated if absent as shown in JSON examples above or can be supplied manually.
309
309
310
310
### Currently Supported
311
311
312
312
- control method execution and property write with a custom finite state machine.
313
313
- database (Postgres, MySQL, SQLite - based on SQLAlchemy) support for storing and loading properties when the object dies and restarts.
314
314
- auto-generate Thing Description for Web of Things applications.
315
-
- use serializer of your choice (except for HTTP) - MessagePack, JSON, pickle etc. & extend serialization to suit your requirement. HTTP Server will support only JSON serializer to maintain compatibility with node-wot. Default is JSON serializer based on msgspec.
315
+
- use serializer of your choice (except for HTTP) - MessagePack, JSON, pickle etc. & extend serialization to suit your requirement. HTTP Server will support only JSON serializer to maintain comptibility with Javascript (MessagePack may be added later). Default is JSON serializer based on msgspec.
316
316
- asyncio compatible - async RPC server event-loop and async HTTP Server - write methods in async
317
317
- choose from multiple ZeroMQ transport methods which offers some possibilities like the following without changing the code:
318
318
- run HTTP Server & python object in separate processes or the same process
@@ -325,14 +325,12 @@ Again, please check examples or the code for explanations. Documentation is bein
325
325
### Currently being worked
326
326
327
327
- improving accuracy of Thing Descriptions
328
-
- cookie credentials for authentication - as a workaround until credentials are supported, use `allowed_clients` argument on HTTP server which restricts access based on remote IP supplied with the HTTP headers.
328
+
- separation of HTTP protocol specification like URL path and HTTP verbs from the API of properties, actions and events and move their customization completely to the HTTP server
329
+
- unit tests coverage
330
+
- cookie credentials for authentication - as a workaround until credentials are supported, use `allowed_clients` argument on HTTP server which restricts access based on remote IP supplied with the HTTP headers. This wont still help you in public networks or modified/non-standard HTTP clients.
329
331
330
332
### Internals
331
333
332
334
This package is an implementation of a ZeroMQ-based Object Oriented RPC with customizable HTTP end-points. A dual transport in both ZMQ and HTTP is provided to maximize flexibility in data type, serialization and speed, although HTTP is preferred for networked applications. If one is looking for an object oriented approach towards creating components within a control or data acquisition system, or an IoT device, one may consider this package.
0 commit comments