evok service fails to start after a reboot



  • Hello,

    My Neuron system was working perfectly for the last 2 weeks.
    Today, the PLC was turned off and on again (power outage), and now the evok service is not starting:

    pi@L203-sn250:~ $ sudo systemctl status evok
    ● evok.service - EVOK ModBus/WebSocket/RPC Server
       Loaded: loaded (/lib/systemd/system/evok.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Tue 2019-09-17 12:34:24 EEST; 1min 27s ago
      Process: 1522 ExecStopPost=/bin/rm -f /etc/nginx/sites-enabled/evok (code=exited, status=0/SUCCESS)
      Process: 1519 ExecStopPost=/bin/cp -f /etc/nginx/sites-available/mervis /etc/nginx/sites-enabled/ (code=exited, status=1/FAILURE)
      Process: 1516 ExecStopPost=/bin/mv -f /etc/nginx/sites-enabled/evok /etc/nginx/sites-available/ (code=exited, status=0/SUCCESS)
      Process: 1513 ExecStopPost=/bin/rm -f /etc/evok-nginx.conf (code=exited, status=0/SUCCESS)
      Process: 1509 ExecStart=/opt/evok/bin/python /opt/evok/lib/python2.7/site-packages/evok/evok.py (code=exited, status=255)
      Process: 1506 ExecStartPre=/bin/ln -sf /etc/nginx/sites-enabled/evok /etc/evok-nginx.conf (code=exited, status=0/SUCCESS)
      Process: 1503 ExecStartPre=/bin/rm -f /etc/nginx/sites-enabled/mervis (code=exited, status=0/SUCCESS)
      Process: 1500 ExecStartPre=/bin/mv -f /etc/nginx/sites-enabled/mervis /etc/nginx/sites-available/ (code=exited, status=1/FAILURE)
      Process: 1497 ExecStartPre=/bin/cp -f /etc/nginx/sites-available/evok /etc/nginx/sites-enabled/ (code=exited, status=0/SUCCESS)
     Main PID: 1509 (code=exited, status=255)
    
    Sep 17 12:34:24 L203-sn250 systemd[1]: evok.service: Service hold-off time over, scheduling restart.
    Sep 17 12:34:24 L203-sn250 systemd[1]: Stopped EVOK ModBus/WebSocket/RPC Server.
    Sep 17 12:34:24 L203-sn250 systemd[1]: evok.service: Start request repeated too quickly.
    Sep 17 12:34:24 L203-sn250 systemd[1]: Failed to start EVOK ModBus/WebSocket/RPC Server.
    Sep 17 12:34:24 L203-sn250 systemd[1]: evok.service: Unit entered failed state.
    Sep 17 12:34:24 L203-sn250 systemd[1]: evok.service: Failed with result 'exit-code'.
    
    
    pi@L203-sn250:~ $ cat /etc/evok.conf
    #!!! Do not use '#' for comments !!!
    
    [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
    
    [EXTENSION_1]
    global_id = 4
    device_name = xS50
    modbus_uart_port = /dev/extcomm/0/0
    address = 2
    baud_rate = 19200
    parity = N
    stop_bits = 1
    
    [EXTENSION_2]
    global_id = 5
    device_name = xS40
    modbus_uart_port = /dev/extcomm/0/0
    address = 3
    
    [EXTENSION_3]
    global_id = 6
    device_name = xS40
    modbus_uart_port = /dev/extcomm/0/0
    address = 4
    
    ;[OWBUS_1]
    ;owbus = /dev/i2c-1 --i2c=/dev/i2c-1:ALL        ; Mandatory, scanned bus (--i2c=/dev/i2c-1:ALL or localhost:2122 or 'u' for USB dongle)
    ;interval = 3                                           ; Mandatory, [s] length of sensor reading
    ;scan_interval = 300                                            ; Mandatory, [s] How often the scanning is done
    
    pi@L203-sn250:~ $ sudo /opt/evok/bin/python /opt/evok/lib/python2.7/site-packages/evok/evok.py
    [I 190917 13:25:19 evok:1664] Starting using config file /etc/evok.conf
    /opt/evok/lib/python2.7/site-packages/evok/config.py:86: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
      self.definitions += [yaml.load(yfile)]
    [I 190917 13:25:19 config:87] YAML Definition loaded: CUSTOM MODBUS DEVICE.yaml, type: 3, definition count 0
    [I 190917 13:25:19 config:87] YAML Definition loaded: xS10.yaml, type: 3, definition count 1
    [I 190917 13:25:19 config:87] YAML Definition loaded: xS30.yaml, type: 3, definition count 2
    [I 190917 13:25:20 config:87] YAML Definition loaded: xS40.yaml, type: 3, definition count 3
    [I 190917 13:25:20 config:87] YAML Definition loaded: xS50.yaml, type: 3, definition count 4
    [I 190917 13:25:20 config:87] YAML Definition loaded: evok-alias.yaml, type: 2, definition count 0
    [I 190917 13:25:20 evok:1731] HTTP server listening on port: 8080
    [I 190917 13:25:20 modbusclient_tornado:128] SPI client started
    [I 190917 13:25:20 modbusclient_rs485:347] UART client started
    [I 190917 13:25:20 neuron:334] Reading the UART board on Modbus address 3
    [I 190917 13:25:20 modbusclient_rs485:347] UART client started
    [I 190917 13:25:20 neuron:334] Reading the UART board on Modbus address 2
    [I 190917 13:25:20 modbusclient_rs485:347] UART client started
    [I 190917 13:25:20 neuron:334] Reading the UART board on Modbus address 4
    [I 190917 13:25:20 neuron:215] Reading SPI boards
    [I 190917 13:25:20 neuron:886] NO NEURON EEPROM DATA DETECTED, EXITING
    [I 190917 13:25:20 neuron:887] PLEASE USE A FRESH EVOK IMAGE, OR ENABLE I2C, I2C-DEV AND THE EEPROM OVERLAY
    


  • This post is deleted!


  • And of course, this system is used in a production environment, and now nothing is working anymore.
    Could it be that the EEPROM was fried by turning the Neuron off and on?



  • Looks like an apt upgrade was issued without a reboot.
    Same thing happened to me after an apt upgrade reboot.
    Now your os runs on kernel 4.19 and evok can't access the modules.
    I think the kernel modules are incompatible with the new kernel.

    Only fresh install of unipian was the easiest way to get the os working again without issuing apt upgrade....
    Clean install also fails from a clean raspbian stretch with github install instructions.


  • administrators

    @christian Should be fixed in the recent update.


  • administrators

    Hello @stephane-clavel,

    it seems you have not some kernel modules loaded. Try lsmod command - you should see unipi, at24 and i2c_dev modules loaded. If not, follow the steps below.

    As the first step, try to reinstall appropriate package (assuming you have the unipi repository already sourced):

    sudo su
    apt-get install unipi-kernel-modules
    

    As the second step, reboot the controller.