Unable to get xS30 extension working on the Neuron M103



  • Running Evok release v2.0.7h
    On a fairly recent version of Debian Stretch from the Raspberry Pi website.

    uname -a
    Linux M103-sn25 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
    

    Main modules inputs/outputs are working just fine within the Evok HTTP interface.

    Following the setup instructions by @TomasKnot here https://forum.unipi.technology/topic/652/how-to-add-xs40-to-neuron-l203-using-custom-software/12 I now have the following:

    /etc/evok.conf

    [MAIN]									; !!! ALL MAIN SECTION OPTIONS ARE MANDATORY !!!
    config_version = 2.5					; Configuration file version, DO NOT CHANGE!
    use_schema_verification = False			; Enabling this will deny any requests that do not match the JSON Schema; NOTE THAT THIS RESULTS IN A SIGNIFICANT INCREASE IN LATENCY AND SHOULD NOT BE USED EXCEPT FOR TESTING
    log_level = ERROR   					; Minimum severity of messages to be logged; one of INFO, DEBUG, WARNING, ERROR, CRITICAL
    log_file = /var/log/evok.log			; Log file to use; will be cleared on boot
    port = 8080								; !!! Internal API port - only change if you are certain you know what you are doing; FOR OUR WEB INTERFACE THE PORT SHOULD BE CHANGED IN "/etc/evok-nginx.conf" INSTEAD !!!
    webhook_enabled = False					; Enables webhook notification - see e.g. https://sendgrid.com/blog/whats-webhook/
    webhook_address = http://127.0.0.1:80   ; Put your server endpoint address here (e.g. http://123.123.123.123:/wh )
    webhook_device_mask = ["input","wd"]	; List of device types to notify on (written as a JSON list) - adding AI will generate a large amount of messages!
    webhook_complex_events = False			; EVOK will send POST requests with the same data as WebSocket, rather than an empty GET request
    wifi_control_enabled = False			; !!! REQUIRES THE UNIPIAP WIFI CONTROLLER TO BE INSTALLED !!! Will allow evok to control the internal Neuron wifi
    soap_server_enabled = False				; Enables the simple SOAP server; use only if you need the functionality
    soap_server_port = 8081					; !!! IF SOAP SERVER IS ENABLED, THIS PORT NEEDS TO BE UNIQUE (i.e. different from the port setting above) !!!
    
    [NEURON_1]
    global_id = 1							; Mandatory, REQUIRED TO BE UNIQUE
    allow_register_access = False 			; Optional, False default
    scan_frequency = 10						; Optional, 10 default, scanning frequency in [Hz]
    scan_enabled = True 					; Optional, True default
    
    ; Below you can find examples for connecting devices over UART; first example is a Neuron extension while the second is a custom third-party device
    ; Devices sharing a port use the port settings of the first device on that port (baud rate, parity, stop bits)
    ; !!! Note that device_name has to match a filename in the /etc/hw_definitions directory !!! See /etc/hw_definitions/CUSTOM MODBUS DEVICE.yaml for an example
    
    [EXTENSION_1]
    global_id = 2							; Mandatory, REQUIRED TO BE UNIQUE
    device_name = xS30						; Mandatory
    modbus_uart_port = /dev/extcomm/0/0 	; Mandatory
    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)
    ;allow_register_access = True 			; Optional, False default, is mandatory with third-party devices
    address = 1							; Optional, 1 default
    scan_frequency = 10 					; Optional, 10 default, scanning frequency in [Hz]
    ;scan_enabled = True 					; Optional, True default
    ; Note that the following settings will be inherited by other devices sharing the same port, i.e. /dev/extcomm/0/0
    baud_rate = 19200						; Optional, NEEDS UNIPI IMAGE TO WORK WITH UNIPI SERIAL PORTS! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
    parity = N								; Optional, NEEDS UNIPI IMAGE TO WORK WITH UNIPI SERIAL PORTS! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
    stop_bits = 1							; Optional, NEEDS UNIPI IMAGE TO WORK WITH UNIPI SERIAL PORTS! USE API TO CONFIGURE UART MANUALLY IF USING STANDARD RASPBIAN
    

    Wiring

    RS485-A connects to RS485-A
    RS485-B connects to RS485-B

    1_1557583566515_IMG_0624.jpg 0_1557583566514_IMG_0623.jpg

    Rebooted everything and the TX light on the UniPi occasionally flashes but nothing on the extension.

    No additional devices available in the HTTP interface.

    Tried to run the debug here:

    /usr/bin/python /opt/evok/evok.py --path1=/etc/evok.conf --path2=/etc/evok-neuron.conf
    /usr/bin/python: can't open file '/opt/evok/evok.py': [Errno 2] No such file or directory
    

    Found this under /opt/evok/lib/python2.7/site-packages/evok/evok.py and adjusted the command to

    /usr/bin/python /opt/evok/lib/python2.7/site-packages/evok/evok.py --path1=/etc/evok.conf
    Traceback (most recent call last):
      File "/opt/evok/lib/python2.7/site-packages/evok/evok.py", line 5, in <module>
        import tornado.httpserver
    ImportError: No module named tornado.httpserver
    

    Anyone got any ideas on what I can try to debug this further? :)