Berto Web Server

The Berto Web Server driver provides a simple HTTP server that can serve requests to interrogate your system and also update variables to trigger events. The driver allows you to create a set of variables defined in properties which in turn can be set using simple GET requests. You can also run other C4 driverworks commands using using GET and POST requests which allow parameters to be specified. A request with no command specified will return all available commands that can be executed. With GET requests command parameters are passed on the URL line separated by & after the first ?. With POST requests parameters are passed on the body in JSON fomrat using the args field.

The Web Serever is started on port 10080 on the IP address of the controller and can be protected with a username and password but this is only using Basic HTTP authentication. The server is only available over HTTP and not secure HTTPS therefore should never be exposed outside you local network. Secure requests can be made by proxying the HTTP connections through an external web server such as Nginx or Apache. An installed IOT Hub has HTTPS proxying configured automatically. Requests can be made using GET and POST HTTP methods and results are returned in a JSON format.

When a request is received the request variables will be updated and a request event is fired. Requests can also be sent from programming and the response received will update response variables and fire a response event.

Examples.

To update variables created in properties you can use the Set command eg.

The server will also accept Websocket client connections. Clients can connect to the controller IP address on any path that can then be used to send and receive data from within the driver under programming. The /echo path is a special path that provides an Echo back service to test websocket clients. The server does not send any keepalive pings therefore the client should be configured to send pings at the approproate interval. Testing can be done using a websocat eg.

There is a limit of receiving 100 requests per day with the Basic subscription level.

Properties

Variables

Release Notes

v1.00 - 2020-03-15

v1.10 - 2020-03-29

v1.11 - 2020-04-17

v1.12 - 2020-06-15

Licence

DM