Description

head

Frequently Asked Questions (FAQ)

1. How do I add UniPi UART extension device to a Neuron running EVOK?

You will need to connect to your Neuron via SSH, and edit the file /etc/evok.conf. Therein you will find a commented-out section (prepended with the ; character) which demonstrates how to add extension devices to Neuron; we are specifically interested in the following section:

1) ;[EXTENSION_1]
2) ;global_id = 2                            ; Mandatory, REQUIRED TO BE UNIQUE
3) ;device_name = xS10                        ; Mandatory
4) ;modbus_uart_port = /dev/extcomm/0/0     ; Mandatory
5) ;neuron_uart_circuit = 1_01                ; Optional, allows associating extensions with specific Neuron UART-over-Modbus ports (not possible for non-Modbus UART ports, e.g. /dev/ttyUSB0 or /dev/ttyS0)
6) ;allow_register_access = True             ; Optional, False default, is mandatory with third-party devices
7) ;address = 1                             ; Optional, 1 default
8) ;scan_frequency = 10                     ; Optional, 10 default
9) ;scan_enabled = True                     ; Optional, True default
10) ;!!Do not uncomment this line!! ; Note that the following settings will be inherited by other devices sharing the same port, i.e. /dev/extcomm/0/0
11) ;baud_rate = 19200                        ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
12) ;parity = N                                ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
13) ;stop_bits = 1                            ; Optional, NEEDS UNIPI IMAGE TO WORK! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN

In order to create a simple extension setup you should uncomment lines 1), 2), 3), 4), 5); as well as fill in the name of your device into 3). Following device names are possible:

  1. xS10
  2. xS30
  3. xS40
  4. xS50

You can find the name of your extension by looking at the lettering on the top of your device, or on the label on its side.

You will also need to setup the dip switches on the device, such that the device is set into UART mode 8N1 19200 address 1. The procedure for doing so differs between the devices, but should be easy to discern by looking at the laser-etched legend on top of the device. Note that for the xS50 there are no dip switches for setting speed or parity, only address.

To setup more devices simply create a copy of the section below the first one. You will have to change the bracketed name, global_id and use a different port or address.

2. How do I add a third-party UART Modbus device to a Neuron running EVOK?

There are two separate files which need to be changed for a custom Modbus device to function - the hardware definition and the EVOK configuration file.

You can find an example hardware configuration file in /etc/hw_definitions/CUSTOM MODBUS DEVICE.yaml The definitions are stored in YAML format, with two sections - Modbus register definitions and device definitions. Both must be filled in correctly for the device to function. The example file has comments describing the structure of the file.

The second part of the configuration is in the /etc/evok.conf file. There are commented-out sections (prepended with the ; character) which demonstrate how the custom modbus device should be added to EVOK.

Note that third-party device support is available purely as direct Modbus register access. While conceptually it is possible that a device which matches exactly the implementation of one of our internal devices may function in a non-purely-Modbus mode (the ULEDs in particular have the most potential in this regard), it is very unlikely.

3. Can I use EVOK with operating system/platform X?

Currently we officially support the following Linux distributions with EVOK: Raspbian Jessie and Raspbian Wheezy. In the near future we also plan to release official UniPi Debian packages and a UniPi distribution containing EVOK.

EVOK must also be executed on a UniPi device to function; but, as it is an API, you can connect to it from any of the number of systems which support one of the EVOK communication protocols.

4. Can I use EVOK purely as a Modbus API?

While EVOK is designed to function as an interpretative interface to Modbus, it is possible to use in purely Modbus mode.

To activate Modbus register access you will need to change the allow_register_access key in the device section of the EVOK configuration file. See the Confguration documentation section for more informations regarding the file and the options within.

If you wish to remove the internal representations entirely, you may do so by editing the hardware configuration file directly. Follow the advice in point 1. of this FAQ to see how it's done.

head

Configuration

If you wish to manually change the default evok configuration, you can do so by editing the "/etc/evok.conf" and "/etc/evok-nginx.conf" files.

The configuration files use the standard Python ini format, with comments indicated by semicolons (i.e. in order to activate a commented-out section remove the semicolon comment marks from the beginning of each line).

/etc/evok.conf

This is the primary evok configuration file. It consists of two parts - the main section and the device section.

Main section

The main section (delimited by empty lines and beginning with a line consisting of [MAIN]) contains general EVOK settings which do not pertain to specific devices. The section contains the following keys:

  • config_version = X.Y
  • This key specifies the minor (X) and major (Y) version of the configuration format; there shouls be no need to manually change this variable and it is in fact recommended not to do so.
  • use_schema_verification = [False|True]
  • This key enables verification of input and output according to a strict JSON schema, based on which the main part of this documentation was generated.
  • Enabling output verification results in an order of magnitude higher latency than normal, and should only be used for testing purposes.
  • log_level = [INFO|DEBUG|WARNING|ERROR|CRITICAL]
  • This key determines the minimum severity of messages to be stored in the EVOK system log.
  • The log can be retrieved via a POST request to Complete State (see the endpoint documentation on the left for more details).
  • log_file = XYZ [DEFAULT: /var/log/evok.log]
  • This key points to the location of the EVOK log file.
  • EVOK uses automatic timestamps and file rotation to allow multiple logs to be saved.
  • It is recommended that the log file location is kept somewhere within the /var/ top-level folder.
  • port = XYZX [DEFAULT: 8080]
  • This is the primary port used by the EVOK API
  • Changing this value without changing all the other occurences of it in /etc/evok-nginx.conf will stop the web interface from working
  • The SOAP interface uses separate port, as does the sample web interface
  • webhook_enabled = [False|True]
  • This key enables webhook notification, which sends either a POST or GET request whenever device state changes (this is further confgurable by the keys below) to a specified address
  • Capturing webhook requires a custom server implementation to listen to the messages, see what's webhook (external link) for more details
  • webhook_address = http://XYZ.XY/xyz
  • The consumer endpoint for the webhook. The address should point to a properly-configured webserver which can recieve GET (and optionally POST) requests
  • webhook_device_mask = [DEFAULT: ["input", "wd"]]
  • This is a mask encoded as a JSON array, which contains the REST paths of devices which should be sent via WebHook.
  • It may be helpful to omit AO,AI and REGISTER, as values these devices may fluctuate
  • webhook_comple_events = [False|True]
  • This key causes EVOK to send POST rather than GET messages to the webhook endpoint specified above. The POST messages will contain device state of the devices changes in the body of the request.
  • wifi_control_enabled = [False|True]
  • This key allows EVOK to control the internal WiFi adapter within Neuron.
  • In order to work properly, the UniPiAP system needs to be installed as well (the installation scripts asks the user whether it should or should not be installed)
  • This key enables the "WiFi Adapter" endpoints and devices
  • soap_server_enabled = [False|True]
  • This key enables the internal EVOK SOAP server.
  • The server contains two services, which are described in more detail in the appropriate endpoints in the section on the left, as well as the SOAP Basics section of the documentation
  • SOAP cannot run on the same port as the primary API!
  • soap_server_port = [DEFAULT: 8081]
  • This key specifies which port the SOAP server should run on
  • This port cannot be the same as the main API port or the web interface port
  • If the soap_server_enabled key above is False, then this port will not be used and will be left free.

Device sections

The device sections are each delimited by empty lines at the beginning and the end, with the first line denoting the section name in square brackets.

The section names consist of a device type name written in ALL CAPS, along with an undescore and a unique device index, e.g. [NEURON_1].

The default configuration files should contain an explanation as to the device section format. It should only be necessary to change the device sections in the case of the following:

  • New UART Modbus extensions/devices have been added
  • New 1Wire relays or inputs have been added
  • UNIPI 1.1 only: an i2c extension board has been added

/etc/evok-nginx.conf

This file is used to configure the sample EVOK-consuming web server running on Nginx. The configuration will be generated by the installation script, and should only be changed if necessary. One particular time when the file needs to be changed is if the primary EVOK API port changed as well (the port is listed above). This can be easily accomplished by replacing all the instances of the previous API port number with the desired new API port number.

In order to deactivate the EVOK NGINX web interface, delete the file which this file (actually a symlink) points to; /etc/nginx/sites-enabled/evok.

Hardware definitions

For details on the hardware definition files, please see the Extensions section of this documentation.

head

Internal devices controlled via EVOK

EVOK allows users to retrieve data from, and manipulate with, the following internal devices:

  • Analog inputs

Analog inputs are used to read control signals transmitted via varying low amounts of output current, voltage or resistance. Resistance measurement is available only on Neuron.

The capabilities of the Analog inputs vary between our models; the modes and tolerances supported can be retrieved via a GET request to the device, described in the Get Analog Input State endpoint on the left.

To configure the analog inputs, send a POST request to the device instead; the available commands can be seen in the Change Analog Input State endpoint on the left.

On the UniPi 1.1 these are implemented via PWM, which can additionally be manually controlled using UniPi 1.1-specific arguments.

  • Analog outputs

    Analog outputs are used to generate control signals by varying output voltage or current. On Neuron some of the analog outputs can also be used for measuring resistance.

The capabilities of the Analog outputs vary between our models; the modes and tolerances supported can be retrieved via a GET request to the device, described in the Get Analog Input State endpoint on the left.

To configure the analog outputs, send a POST request to the device instead; the available commands can be seen in the Change Analog Output State endpoint on the left.

  • Digital inputs

    Digital inputs are used to to read control signals transmitted via digital logic. On Neuron they can also be used to trigger DirectSwitch (i.e. very-low-latency switching) behaviour.

The capabilities of the Digital inputs vary between our models; supported counter modes, DirectSwitch modes and debounce settings (the suppression of harmonics from edge events) can be retrieved via a GET request to the device, described in the Get Input State endpoint on the left.

To configure the configurable properties of digital inputs, send a POST request to the device; the commands available can be seen in the Change Input State endpoint on the left.

  • Relay-based and Transistor-based (digital) outputs

    Digital outputs are used to generate control signals and interrupt small amounts of current via circuit interruption. For this reason they have to be connectod to an external power source to operate. On Neuron, some of the transistor-based digital outputs can also be used for PWM modulation

The capabilities of the Digital outputs vary between our models; the transistor type (physical - i.e. a relay, or digital - i.e. transistor-based), timing modes and available PWM settings can be retrieved via a GET request to the device, described in the Get Output State endpoint on the left.

To configure the configurable properties of digital outputs, send a POST request to the device; the commands available can be seen in the Change Output State endpoint on the left.

  • UART ports

    UART port devices are used to configure serial port properties for Neuron. Serial ports allow for 2-way communication with external systems, though an important caveat is that only one protocol may be used on a single link. Our Neuron extensions are accessed via serial ports, via the oft-used Modbus protocol.

Only ports which are directly implemented in Neuron hardware are represented (not external ones made available through e.g. USB devices). Regardless of this, however, Modbus extensions/devices can still be connected to external UARTS and will be visible in EVOK.

The capabilities of the UART ports may vary between our models, mainly in terms of the transmission modes and timings supported. The UART settings available can be retrieved via a GET request to the device, described in the Get UART State endpoint on the left.

To configure the configurable properties of UART ports, send a POST request to the device; the commands available can be seen in the Change UART State endpoint on the left.

  • User-configurable LEDs

    User-configurables LEDs (henceforth referred to as ULEDs) are light-based indicators, which can be used to signal important information from your application to the user. They are controlled in a manner similar to the digital outputs and marked with letters "X1" up to "X[n]" (for [n] LEDs) on your Neuron device.

To configure the configurable properties of ULEDs, send a POST request to the device; the commands available can be seen in the Change User LED State endpoint on the left.

  • Board Watchdog

    The Board Watchdog (henceforth referred to as Watchdog) is used to ensure the continous operation of the device. It works by restarting parts of the device if they become unresponsive; this is then indicated to the user by the "value" flag of the Watchdog device changing to "1". The Watchdog feature is only available on Neuron

The Watchdog can also be used to set up a default state for the device. This is done by configuring the device into the desired state, and then setting the "nv_save" property to 1.

To configure the configurable properties of board watchdogs, send a POST request to the device; the commands available can be seen in the Change Watchdog State endpoint on the left.

  • WiFi Adapter (optional)

    Provided that the WiFi Adapter device support is installed and enabled within the EVOK configuration file, this device can be used to create an access point for access over local wireless. It is turned off by default; as is the routing of packets via Masquerade to the ethernet connection. The latter can be turned on via the "eth0_masq" property, while the adapter itself is turned on via the "ap_state" property

Note that any WiFi operations may take some time to perform; orders of magnitude more than other EVOK operations.

The SSID and key are intentionally set to predefined values, as the device is not intended to act as a secure access point/router! The values are SSID: UNIPICONFIG and wpa_passphrase: unipi.technology. The values can be changed in /opt/unipiap/etc/hostapd.conf

To configure the configurable properties of the WiFi Adapter, send a POST request to the device; the commands available can be seen in the Change WiFi Adapter State endpoint on the left.

  • Lighting Controller (on the M603)

    Allows sending commands to a standard digital lighting bus, with broadcast commands exported to the web GUI.

Light detection is only rudimentary, and requires re-addressing devices from scratch every time.

head

Using UniPi REST Endpoints

In order to make use of our REST Endpoints POST methods, one has to pass a body encoded with "x-www-form-urlencoded". This body has the following format:

key1=value1&key2=value2&key3=value3

That is to say, the format is the same as for encoding arguments as they would be passed inside the URL.

Here is an example for sending a POST request to change digital output state via CURL:

curl --request POST --url 'http://localhost:8080/rest/output/1_01/' --data 'value=1'
head

Sample Web Interface

EVOK includes a simple web interface which can be used to issue commands to your Neuron and UniPi device and to read the current state of the various device sensors. While it is intended to act primarily as a way of demonstrating how to implement a web interface for communicating with EVOK, it is capable of of performing and configuring all the functionality of Neuron devices.

We offer a number of ways to control your Neuron and UniPi devices, the simplest of which is using a web browser to visit:

http://your.pi.ip.address:web-interface-port

If EVOK came pre-installed with your image it will be available on port 88.

The sample web interface is using websocket to receive all events from the UniPi and controls the UniPi device via the REST api.

head

SOAP Basics

SOAP is an XML-based communication protocol which features strict data format specification. It's primary advantage is ease of use given appropriate tools, and strict format verification for inputs and outputs. Among the disadvantages is a relatively higher latency than REST/JSON/WebSocket and the need for external libraries and/or tools to provide access to it. The SOAP ecosystem is very large however, and as such there are libraries available for a wide variety of systems and programming languages.

SOAP must be enabled in the EVOK configuration file and needs to use a separate port, as it does not use the HTTP protocol in the same manner as the rest of EVOK.

The specification (WSDL file) for any given service can be obtained by visiting the web service URI with the ?wsdl query parameter, e.g. "127.0.0.1:8081/UniPiQueryService?wsdl".

There is a large number of SOAP clients which you can use to try SOAP out, e.g. SoapUI by SmartBear.

Device types come from the following list (and otherwise correspond to the device path in the Rest API):

'relay', 'input', 'ai', 'ao', 'ee', 'sensor', 'i2cbus', 'adchip', 'owbus', 'mcp', 'gpiobus', 'pca9685', 'ds2408', 'unipi2', 'uart', 'neuron', 'board', 'misc_output', 'led', 'watchdog', 'register', 'wifi', 'light_channel', 'light_device'

and the "circuit" is the device name as specified in the configuration file.

As an example for UniPi 1.1:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:unip="http://192.168.1.146:8081/UniPiQueryService">
 <soapenv:Header/>
 <soapenv:Body>
    <unip1:SoapQueryInputList xmlns:unip1="http://127.0.1.1:8081/UniPiQueryService">
       <!--1 or more repetitions:-->
       <single_query>
          <device_circuit>1</device_circuit>
          <device_type>relay</device_type>
       </single_query>
    </unip1:SoapQueryInputList>
 </soapenv:Body>
</soapenv:Envelope>

An example for setting relays:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:unip="http://127.0.1.1:8081/UniPiCommandService">
 <soapenv:Header/>
 <soapenv:Body>
    <unip:SoapCommandInputList>
       <!--1 or more repetitions:-->
       <single_command>
          <device_circuit>1</device_circuit>
          <device_type>relay</device_type>
          <!--1 or more repetitions:-->
          <property_item>
             <property_name>value</property_name>
             <property_value>"0"</property_value>
          </property_item>
       </single_command>
       <single_command>
          <device_circuit>2</device_circuit>
          <device_type>relay</device_type>
          <!--1 or more repetitions:-->
          <property_item>
             <property_name>value</property_name>
             <property_value>"1"</property_value>
          </property_item>
       </single_command>
       <single_command>
          <device_circuit>3</device_circuit>
          <device_type>relay</device_type>
          <!--1 or more repetitions:-->
          <property_item>
             <property_name>value</property_name>
             <property_value>"1"</property_value>
          </property_item>
       </single_command>
    </unip:SoapCommandInputList>
 </soapenv:Body>
</soapenv:Envelope>
head

WebSocket

WebSocket is a duplex communication protocol for TCP. Our implementation is based on sending a stream of event messages to the server, which notify the user of status changes to the internal devices.

All EVOK messages over the websocket protocol are sent in standard JSON string format, e.g. one would send {"cmd":"set", "dev":"relay", "circuit":"1", "value":"1"} to set the Relay 1 to on.

There are three different 'commands' available over WebSocket: 'all', 'filter', 'set'

  • 'all', which has no arguments and will return a list of all devices in the same format as the Get Complete State endpoint;
  • 'filter', which has one argument ("devices" which is an array of device types to filter for, e.g. {"cmd":"filter", "devices":["ai", "input"]}) and will limit the list of devices which should send events;
  • 'set', which has three arguments ("dev" which is a device type string, "circuit", which is a device circuit string and "val" which is the desired value to set e.g. {"cmd":"set", "dev":"relay", "circuit": "1_01", "value":1}) and sets a specific device property to a specified value

To recieve the event messages register your client at the URL ws://your.unipi.ip.address/ws, (the Websocket Handshake/Upgrade endpoint). Once the connection is established you can send the commands specified above to your device.

Please look through the Sample Web Interface file 'wsbase.js' in the www/js/ folder for a more extensive example of WebSocket use.

Example Python application using WebSocket

import websocket
import json
import logging
logging.basicConfig()
# Replace this with your Neuron IP Address
url = "ws://127.0.0.1:8080/ws"
def on_message(ws, message):
    obj = json.loads(message)
    for single_obj in obj:
        dev = single_obj['dev']
        circuit = single_obj['circuit']
        value = single_obj['value']
        print "Value: " + str(value) + " Device: " + str(dev) + " Circuit: " + str(circuit)
    print message
def on_error(ws, error):
    print error
def on_close(ws):
    print "Connection closed"
def on_open(ws):
    # Turn on filtering
    ws.send(json.dumps({"cmd":"filter", "devices":["ai", "input"]}))
    # Turn on DO 1.01
    ws.send(json.dumps({"cmd":"set", "dev":"relay", "circuit": "1_01", "value":1}))
    # Query for complete status
    ws.send(json.dumps({"cmd":"all"}))
#receiving messages
ws = websocket.WebSocketApp(url, on_open = on_open, on_message = on_message, on_error = on_error, on_close = on_close)
ws.run_forever()
```python
head

1Wire Devices

1Wire is a universal protocol for communication with a variety of standardised devices. Unfortunately, the individual devices do not have a common data framework, and require individual handling to behave correctly. For this reason EVOK supports only the following 1Wire devices:

  • DS18B20
  • DS18S20
  • DS2438
  • DS2408
  • DS2406
  • DS2404
  • DS2413

Some of these device (2408, 2406, 2404 and 2413) are only control chips for additional hardware (relays, digital inputs) and as such require individual configuration. You can find more details regarding this in the Configuration section.

head

Extensions and custom ModBus devices

EVOK is able to communicate over serial lines with external slave devices which support the Modbus RTU protocol. Modbus is a popular protocol for mid-latency device control, particularly in the building automation sector.

For Neuron Extensions this means their internal devices will be available much the same as they would if they were included in the control unit, albeit with lower latency. The device circuits will be prefixed with UART_[UART_ADDRESS]_[DEVICE_ID].

Hardware Definition Files

Hardware definitions files specify the Modbus devices supported by EVOK. Notably, this does not include 1Wire devices and the UniPi 1.1 boards. The files can be found in the '/etc/hw_definitions' folder, and use the YAML data format.

The files consist of two sections "modbus_register_blocks" and "modbus_features". Each device also has a specified "type", which is the name it's referred by in other parts of EVOK.

modbus_register_blocks

The modbus_register_blocks top-level-key is an array of objects representing groups of Modbus registers. Each group is then read in a single Modbus message and cached by EVOK. The fewer groups are defined the less the communication bus will be congested. Modbus groups have the following properties:

  • board_index
  • This key is used primarily for SPI communication. In SPI it serves as the chipselect value, and specifies which internal device group/PCB the register group refers to. Use value of 1 for UART devices
  • start_reg
  • The first register of the Modbus group, e.g. for a device with a group of registers 0-20 one would use 0, as that is the first register of the group.
  • count
  • The number of registers within the group. Each group is sequential; it is not possible to "skip" a register within a single group. To read the the registers 0-20 one would use the value of 21 (as Modbus register addresses are 0-indexed).
  • frequency
  • This key defines how many cache read cycles must pass before the group is read. The value of 1 means that the group is read every cycle; higher values of n mean that the group will be read every nth cycle.
  • type (optional, new from v.2.0.7b)
  • This key determines whether the register block exists in the "input" or "holding" register namespace. As such it can have the following values "input" and "holding". In its absence the value of holding is assumed.

modbus_features

The modbus_features top-level-key is an array of objects representing internal devices which are contained within the modbus groups above.

There are several device types, however the only type that can be safely used in custom hardware definitions is the REGISTER type, which is described further below. The other device types each have a specific format, which can be inferred from the hardware definitions which are supplied with EVOK, however we do not support the use of these device types in custom definitions.

REGISTER internal devices act in a manner similar to the modbus_register_blocks above. Each Modbus register group should ideally have a corresponding REGISTER internal device. The REGISTER internal devices have the following format:

  • type
  • This key is used to determine the internal device type. Use the value of REGISTER here.
  • major_group
  • This key should be the same as the corresponding board_index key above. Use the value of 1 for UART devices.
  • count
  • The number of registers within the group. This key should be the same as the corresponding count key above.
  • start_reg
  • The first register of the Modbus group. This key should be the same as the corresponding start_reg key above.
  • reg_type (optional, new from v.2.0.7b)
  • This key determines whether the register exists in the "input" or "holding" namespace. As such it can have the following values "input" and "holding". In its absence the value of holding is assumed.
head

External websites

Neuron datasheets

Neuron datasheets can be found on our corporate file server.

Where can I buy a Neuron?

You can purchase Neuron devices from our e-shop, or from any of our numerous retail partners.

Further documentation

You can find more details regarding Neuron and UniPi at our company website.

It includes a full-featured public forum, an e-shop where you can purchase more of our devices, and extensive documentation.

head

JSON Remote-Procedure Calls

Python using JsonRPC

You can also control the UniPi using the jsonrpclib Python library. See the list of all the available methods below.

  from jsonrpclib import Server
  s=Server("http://your.pi.ip.address/rpc")
  s.relay_set(1,1)
  s.relay_get(1)
  s.relay_set(1,0)
  s.relay_get(0)
  s.ai_get(1)

Perl using JsonRPC

A simple example of controlling the UniPi via RPC:

  use JSON::RPC::Client;
  my $client = new JSON::RPC::Client;
  my $url    = 'http://your.pi.ip.address/rpc';
  $client->prepare($url, ['relay_set']);
  $client->relay_set(1,1);

There is also a websocket client library for Perl to get more control.

List of available devices:

  • relay - relay
  • input or di - digital input
  • ai - analog input
  • ao - analog output
  • ee - onboard eeprom
  • sensor - 1wire sensor
  • the rest can be found in devices.py

List of available methods:

  • Digital Inputs
    • input_get(circuit) - get all information of input by circuit number
    • input_get_value(circuit) - get actual state f input by circuit number, returns 0=off/1=on
    • input_set(circuit) - sets the debounce timeout
  • Relays
    • relay_get(circuit) - get state of relay by circuit number
    • relay_set(circuit, value) - set relay by circuit number according value 0=off, 1=on
    • relay_set_for_time(circuit, value, timeout) - set relay by circuit number according value 0=off, 1=on for time(seconds) timeout
  • Analog Inputs
    • ai_get(circuit) - get value of analog input by circuit number
    • input_get
  • Analog Output
    • ao_set_value(circuit, value) - set the value(0-10) of Analog Output by circuit number
  • 1-Wire bus
    • owbus_scan(circuit) - force to scan 1Wire network for new devices
  • 1-Wire sensors
    • sensor_get(circuit) - returns all information in array [value, is_lost, timestamp_of_value, scan_interval] of sensor by given circuit or 1Wire address
    • sensor_get_value(circuit) - returns value of a circuit by given circuit or 1Wire address

More methods can be found in the source files evok.py and owclient.py.

json

get
post
post
get
post
get
post
get
post
get
post
get
get
post
post
get
post
get
get
post
post
get
post
get
get
post
get
post
post
get
get

This endpoint will return a polymorphic array of device states. The following state models are included:

  • 1Wire Device model
  • Analog Input state model
  • Analog Output state model
  • Input state model
  • Relay state model
  • Register state model
  • Neuron state model
  • UART state model
  • ULED state model
  • Watchdog state model
  • WiFi state model (if enabled)
get
post
get
post
get

rest

post
get
get
post
get
post
get
post
get
post
post
get
post
get
get
post
get
post
post
get
post
get
get
post
post
get
get
get
post
post
get
get
post
get
get
post

rpc

get

This endpoint is used by the JSON-RPC protocol. You can find more details regarding this method of accessing evok in the JSON Remote-Procedure Calls section at the beginning of this documentation.

UniPiQueryService

post

SOAP endpoints require the internal SOAP server to be enabled!

The internal SOAP server **must*** use it's own port, not the API port!*

get

SOAP endpoints require the internal SOAP server to be enabled!

The internal SOAP server **must*** use it's own port, not the API port!*

UniPiCommandService

get

SOAP endpoints require the internal SOAP server to be enabled!

The internal SOAP server **must*** use it's own port, not the API port!*

post

SOAP endpoints require the internal SOAP server to be enabled!

The internal SOAP server **must*** use it's own port, not the API port!*

bulk

post

The Bulk API is used for batch communication with EVOK using JSON objects. It should be used primarily for performing commands or queries on more than one subdevice, for which it will have considerably higher reaction time and lower latency than any other method exposed by EVOK.

For more details on how to use the bulk API please see the notes below, or the Bulk API section on the Introduction page.

ws

get

This endpoint is used to perform a handshake/upgrade websocket operation. For more details on how to acccess EVOK over websocket, including example code, please see the WebSocket section at the beginning of this documentation.

version

get

This endpoint will retrieve version information from EVOK. Only applicable from releases from 28/05/2018 and/or EVOK v.2.0.5f and/or commit (776348401064ec89edf38645b0b74e3cabad8e63).