Evok / rasp jessie / no relay in web ui + rest



  • Hello,

    We have a jessie raspberry using UniPi with evok to control some relays. Unfortunately there are no relays shown in the web interface nor the REST api. Please find attached a screenshot and detailed information about config and the output of evok.py.

    Does this help to identify my mistake?

    Have a great day,
    Tobias

    => Output of evok.py

    Listening on port: 80
    Error in config section EPROM_1 - "can't open I2C device"
    Error in config section MCP_1 - "can't open I2C device"
    Error in config section RELAY_1 - Invalid device circuit number 1
    Error in config section RELAY_2 - Invalid device circuit number 1
    Error in config section RELAY_3 - Invalid device circuit number 1
    Error in config section RELAY_4 - Invalid device circuit number 1
    Error in config section RELAY_5 - Invalid device circuit number 1
    Error in config section RELAY_6 - Invalid device circuit number 1
    Error in config section RELAY_7 - Invalid device circuit number 1
    Error in config section RELAY_8 - Invalid device circuit number 1
    Error in config section AICHIP_1 - "can't open I2C device"
    Error in config section AI_1 - Invalid device circuit number 1
    Error in config section AI_2 - Invalid device circuit number 1
    Process OwBusDriver-1:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
        self.run()
      File "/opt/evok/owclient.py", line 341, in run
        ow.init(self.bus)
      File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
        raise exNoController
    exNoController
    New WebSocket client connected
    [I 160114 14:12:48 web:1946] 200 GET /rest/all/ (192.168.121.20) 5.85ms
    New WebSocket client connected
    [I 160114 14:12:48 web:1946] 200 GET /rest/all/ (192.168.121.46) 4.50ms
    
    

    Config file:

    #!! don't use # for inline comments
    
    [MAIN]
    webname = unipi
    staticfiles = /var/www/evok
    ;password = test
    ;rpcpassword = test
    secret = 123456
    port = 80
    enable_cors = False
    cors_domains = *
    
    [OWBUS_1]
    owbus = --i2c=/dev/i2c-1:ALL     ; scanned bus (--i2c=/dev/i2c-1:ALL or localhost:2122 or 'u' for USB dongle)
    interval = 3          ; [s] default sensor reading
    scan_interval = 300    ; [s] how often is made searching
    
    #[SENSOR_1]          ; onewire thermometer
    #bus = 1                     ; link to OWBUS_X
    #address = 28527B930500001F
    #type = DS18B20
    #interval = 1
    
    [I2CBUS_1]
    busid = 1               ;[integer] id of bus /dev/i2c-X
    
    [EPROM_1]
    i2cbus = 1
    address = 0x50
    size = 256
    
    [MCP_1]
    i2cbus = 1              ; link to I2CBUS_X
    address = 0x20          ; i2c address
    
    [RELAY_1]
    mcp = 1                 ; link to MCP_X
    pin = 7
    
    [RELAY_2]
    mcp = 1                 ; link to MCP_X
    pin = 6
    
    [RELAY_3]
    mcp = 1
    pin = 5
    
    [RELAY_4]
    mcp = 1
    pin = 4
    
    [RELAY_5]
    mcp = 1
    pin = 3
    
    [RELAY_6]
    mcp = 1
    pin = 2
    
    [RELAY_7]
    mcp = 1
    pin = 1
    
    [RELAY_8]
    mcp = 1
    pin = 0
    
    [AICHIP_1]
    i2cbus =1
    address = 0x68
    
    [AI_1]
    chip=1
    channel=0
    bits=18
    gain=1
    ;correction = 5.558737622
    ;correction = 5.564920867
    corr_rom = 1
    corr_addr = 0xf0
    interval=2
    
    [AI_2]
    chip=1
    channel=1
    bits=18
    gain=1
    ;correction = 5.558737622
    ;correction = 5.564920867
    corr_rom = 1
    corr_addr = 0xf4
    interval=1
    
    [GPIOBUS_1]
    
    [AO_1]
    gpiobus = 1
    frequency = 100
    
    [DI_1]
    gpiobus = 1
    pin=4
    debounce = 0
    #Enable counting on rising/falling edge or disable it
    #By default(or parameter not present) this function is disabled
    #Can be turned on on all on-board digital inputs (not inputs on 1Wire or other extensions)
    #counter_mode = rising
    #counter_mode = falling
    #counter_mode = disabled
    
    [DI_2]
    gpiobus = 1
    pin=17
    debounce = 0
    
    [DI_3]
    gpiobus = 1
    pin=27
    debounce = 0
    
    [DI_4]
    gpiobus = 1
    pin=23
    debounce = 0
    
    [DI_5]
    gpiobus = 1
    pin=22
    debounce = 0
    
    [DI_6]
    gpiobus = 1
    pin=24
    debounce = 0
    
    [DI_7]
    gpiobus = 1
    pin=11
    debounce = 0
    
    [DI_8]
    gpiobus = 1
    pin=7
    debounce = 0
    
    [DI_9]
    gpiobus = 1
    pin=8
    debounce = 0
    
    [DI_10]
    gpiobus = 1
    pin=9
    debounce = 0
    
    [DI_11]
    gpiobus = 1
    pin=25
    debounce = 0
    
    [DI_12]
    gpiobus = 1
    pin=10
    debounce = 0
    
    ;[DI_13]
    ;gpiobus = 1
    ;pin=31
    ;debounce = 0
    
    ;[DI_14]
    ;gpiobus = 1
    ;pin=30
    ;debounce = 0
    
    ;
    ;Example of 8xRelay extension module addon (EMO-R8) on address 0x21
    ;
    ;[MCP_2]
    ;i2cbus = 1
    ;address = 0x21
    
    ;[RELAY_9]
    ;mcp = 2
    ;pin = 7
    
    ;[RELAY_10]
    ;mcp = 2
    ;pin = 6
    
    ;[RELAY_11]
    ;mcp = 2
    ;pin = 5
    
    ;[RELAY_12]
    ;mcp = 2
    ;pin = 4
    
    ;[RELAY_13]
    ;mcp = 2
    ;pin = 3
    
    ;[RELAY_14]
    ;mcp = 2
    ;pin = 2
    
    ;[RELAY_15]
    ;mcp = 2
    ;pin = 1
    
    ;[RELAY_16]
    ;mcp = 2
    ;pin = 0
    
    ;
    ;Example of Analog Output extension module EMO-Ao4/12
    ;
    ;[PCA9685_1]
    ;i2cbus = 1
    ;address = 0x40
    ;frequency = 400
    ;
    ;[AO_2]
    ;pca = 1
    ;channel = 0
    ;
    ;[AO_3]
    ;pca = 1
    ;channel = 1
    ;
    ;[AO_4]
    ;pca = 1
    ;channel = 2
    ;
    ;[AO_5]
    ;pca = 1
    ;channel = 3
    
    ;Example of 1W-4R/4DI extension module, 1W-8R is almost the same just replace inputs with relays
    ;
    ; -first of all map a new 1Wire sensor with appropriate address, type, and interval
    ; -can be used both SENSOR or 1WDEVICE syntax
    ; -reading interval is crucial to achieve requested performance, default interval is 15s
    ;
    ;[1WDEVICE_2]
    ;bus = 1
    ;address = 29F39A17000000BC
    ;type = DS2408
    ;interval = 1
    ;
    ;[1WRELAY_10]
    ;sensor = 2
    ;pin = 0
    ;
    ;[1WRELAY_11]
    ;sensor = 2
    ;pin = 1
    ;
    ;[1WRELAY_12]
    ;sensor = 2
    ;pin = 2
    ;
    ;[1WRELAY_13]
    ;sensor = 2
    ;pin = 3
    ;
    ;[1WINPUT_20]
    ;sensor = 2
    ;pin = 4
    ;
    ;[1WINPUT_21]
    ;sensor = 2
    ;pin = 5
    ;
    ;[1WINPUT_22]
    ;sensor = 2
    ;pin = 6
    ;
    ;[1WINPUT_23]
    ;sensor = 2
    ;pin = 7
    
    


  • Hello,

    We have a jessie raspberry using UniPi with evok to control some relays. Unfortunately there are no relays shown in the web interface nor the REST api. Please find attached a screenshot and detailed information about config and the output of evok.py.

    Does this help to identify my mistake?

    Have a great day,
    Tobias

    => Output of evok.py

    Listening on port: 80
    Error in config section EPROM_1 - "can't open I2C device"
    Error in config section MCP_1 - "can't open I2C device"
    Error in config section RELAY_1 - Invalid device circuit number 1
    Error in config section RELAY_2 - Invalid device circuit number 1
    Error in config section RELAY_3 - Invalid device circuit number 1
    Error in config section RELAY_4 - Invalid device circuit number 1
    Error in config section RELAY_5 - Invalid device circuit number 1
    Error in config section RELAY_6 - Invalid device circuit number 1
    Error in config section RELAY_7 - Invalid device circuit number 1
    Error in config section RELAY_8 - Invalid device circuit number 1
    Error in config section AICHIP_1 - "can't open I2C device"
    Error in config section AI_1 - Invalid device circuit number 1
    Error in config section AI_2 - Invalid device circuit number 1
    Process OwBusDriver-1:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
        self.run()
      File "/opt/evok/owclient.py", line 341, in run
        ow.init(self.bus)
      File "/usr/lib/python2.7/dist-packages/ow/__init__.py", line 224, in init
        raise exNoController
    exNoController
    New WebSocket client connected
    [I 160114 14:12:48 web:1946] 200 GET /rest/all/ (192.168.121.20) 5.85ms
    New WebSocket client connected
    [I 160114 14:12:48 web:1946] 200 GET /rest/all/ (192.168.121.46) 4.50ms
    
    

    Config file:

    #!! don't use # for inline comments
    
    [MAIN]
    webname = unipi
    staticfiles = /var/www/evok
    ;password = test
    ;rpcpassword = test
    secret = 123456
    port = 80
    enable_cors = False
    cors_domains = *
    
    [OWBUS_1]
    owbus = --i2c=/dev/i2c-1:ALL     ; scanned bus (--i2c=/dev/i2c-1:ALL or localhost:2122 or 'u' for USB dongle)
    interval = 3          ; [s] default sensor reading
    scan_interval = 300    ; [s] how often is made searching
    
    #[SENSOR_1]          ; onewire thermometer
    #bus = 1                     ; link to OWBUS_X
    #address = 28527B930500001F
    #type = DS18B20
    #interval = 1
    
    [I2CBUS_1]
    busid = 1               ;[integer] id of bus /dev/i2c-X
    
    [EPROM_1]
    i2cbus = 1
    address = 0x50
    size = 256
    
    [MCP_1]
    i2cbus = 1              ; link to I2CBUS_X
    address = 0x20          ; i2c address
    
    [RELAY_1]
    mcp = 1                 ; link to MCP_X
    pin = 7
    
    [RELAY_2]
    mcp = 1                 ; link to MCP_X
    pin = 6
    
    [RELAY_3]
    mcp = 1
    pin = 5
    
    [RELAY_4]
    mcp = 1
    pin = 4
    
    [RELAY_5]
    mcp = 1
    pin = 3
    
    [RELAY_6]
    mcp = 1
    pin = 2
    
    [RELAY_7]
    mcp = 1
    pin = 1
    
    [RELAY_8]
    mcp = 1
    pin = 0
    
    [AICHIP_1]
    i2cbus =1
    address = 0x68
    
    [AI_1]
    chip=1
    channel=0
    bits=18
    gain=1
    ;correction = 5.558737622
    ;correction = 5.564920867
    corr_rom = 1
    corr_addr = 0xf0
    interval=2
    
    [AI_2]
    chip=1
    channel=1
    bits=18
    gain=1
    ;correction = 5.558737622
    ;correction = 5.564920867
    corr_rom = 1
    corr_addr = 0xf4
    interval=1
    
    [GPIOBUS_1]
    
    [AO_1]
    gpiobus = 1
    frequency = 100
    
    [DI_1]
    gpiobus = 1
    pin=4
    debounce = 0
    #Enable counting on rising/falling edge or disable it
    #By default(or parameter not present) this function is disabled
    #Can be turned on on all on-board digital inputs (not inputs on 1Wire or other extensions)
    #counter_mode = rising
    #counter_mode = falling
    #counter_mode = disabled
    
    [DI_2]
    gpiobus = 1
    pin=17
    debounce = 0
    
    [DI_3]
    gpiobus = 1
    pin=27
    debounce = 0
    
    [DI_4]
    gpiobus = 1
    pin=23
    debounce = 0
    
    [DI_5]
    gpiobus = 1
    pin=22
    debounce = 0
    
    [DI_6]
    gpiobus = 1
    pin=24
    debounce = 0
    
    [DI_7]
    gpiobus = 1
    pin=11
    debounce = 0
    
    [DI_8]
    gpiobus = 1
    pin=7
    debounce = 0
    
    [DI_9]
    gpiobus = 1
    pin=8
    debounce = 0
    
    [DI_10]
    gpiobus = 1
    pin=9
    debounce = 0
    
    [DI_11]
    gpiobus = 1
    pin=25
    debounce = 0
    
    [DI_12]
    gpiobus = 1
    pin=10
    debounce = 0
    
    ;[DI_13]
    ;gpiobus = 1
    ;pin=31
    ;debounce = 0
    
    ;[DI_14]
    ;gpiobus = 1
    ;pin=30
    ;debounce = 0
    
    ;
    ;Example of 8xRelay extension module addon (EMO-R8) on address 0x21
    ;
    ;[MCP_2]
    ;i2cbus = 1
    ;address = 0x21
    
    ;[RELAY_9]
    ;mcp = 2
    ;pin = 7
    
    ;[RELAY_10]
    ;mcp = 2
    ;pin = 6
    
    ;[RELAY_11]
    ;mcp = 2
    ;pin = 5
    
    ;[RELAY_12]
    ;mcp = 2
    ;pin = 4
    
    ;[RELAY_13]
    ;mcp = 2
    ;pin = 3
    
    ;[RELAY_14]
    ;mcp = 2
    ;pin = 2
    
    ;[RELAY_15]
    ;mcp = 2
    ;pin = 1
    
    ;[RELAY_16]
    ;mcp = 2
    ;pin = 0
    
    ;
    ;Example of Analog Output extension module EMO-Ao4/12
    ;
    ;[PCA9685_1]
    ;i2cbus = 1
    ;address = 0x40
    ;frequency = 400
    ;
    ;[AO_2]
    ;pca = 1
    ;channel = 0
    ;
    ;[AO_3]
    ;pca = 1
    ;channel = 1
    ;
    ;[AO_4]
    ;pca = 1
    ;channel = 2
    ;
    ;[AO_5]
    ;pca = 1
    ;channel = 3
    
    ;Example of 1W-4R/4DI extension module, 1W-8R is almost the same just replace inputs with relays
    ;
    ; -first of all map a new 1Wire sensor with appropriate address, type, and interval
    ; -can be used both SENSOR or 1WDEVICE syntax
    ; -reading interval is crucial to achieve requested performance, default interval is 15s
    ;
    ;[1WDEVICE_2]
    ;bus = 1
    ;address = 29F39A17000000BC
    ;type = DS2408
    ;interval = 1
    ;
    ;[1WRELAY_10]
    ;sensor = 2
    ;pin = 0
    ;
    ;[1WRELAY_11]
    ;sensor = 2
    ;pin = 1
    ;
    ;[1WRELAY_12]
    ;sensor = 2
    ;pin = 2
    ;
    ;[1WRELAY_13]
    ;sensor = 2
    ;pin = 3
    ;
    ;[1WINPUT_20]
    ;sensor = 2
    ;pin = 4
    ;
    ;[1WINPUT_21]
    ;sensor = 2
    ;pin = 5
    ;
    ;[1WINPUT_22]
    ;sensor = 2
    ;pin = 6
    ;
    ;[1WINPUT_23]
    ;sensor = 2
    ;pin = 7
    
    


  • i'm very newbe at this so i can't help too much. What i can say is that i have the same raspberry pi with jessy installed and my browser does give 8 relays that can be switched. also the rest api works directly from within the lxterminal.

    i'll be happy to forward you some of my files if you like to compare, maybe this will help you a bit further

    kind regards
    Garjet



  • It looks the I2C devices cannot be acessed byt the service. Did you installed the evok properly using the install script? If so please make sure that the i2cbus is accessible. You can do that by```
    i2cdetect -y 1



  • Thanks a lot for your help. You've been right. The i2c support was not enabled for this raspi. I didn't know that this is necessary for the relays. To be honest, I am not really a hardware guy. To make it short, its working now. Thanks a lot for your hint.

    Maybe this could be added to your install script - check if ic2 is enabled and raise an error (or even better enable it automatically).



  • I have not tested the install script with the latest jessie but of course the I2C is enabled during the installation… Thanks for the info, I will check it