Unipi + 1W-8R



  • hi all,
    i got my unipi working thanks to @mwittig Marcus!!
    now that the main board is fully working i tried to connect a 1w-8r v1.0 but with no luck.

    here is my config file: https://www.dropbox.com/s/bbe7rvf7cj8zg ... f.txt?dl=0
    my 1w-8r is connected to the unipi using i2c and the jumpers untouched (factory default)

    any help will be great thank you.



  • hi all,
    i got my unipi working thanks to @mwittig Marcus!!
    now that the main board is fully working i tried to connect a 1w-8r v1.0 but with no luck.

    here is my config file: https://www.dropbox.com/s/bbe7rvf7cj8zg ... f.txt?dl=0
    my 1w-8r is connected to the unipi using i2c and the jumpers untouched (factory default)

    any help will be great thank you.



  • Hello,

    if yoy really have the 1Wire extension 1W-8R than it must be connected to the 1Wire bus, not i2c (The middle black connector on UniPi - RJ45). But I guess you did that because you have changed the 1Wire address, right?

    By the jumpers do you mean the jumpers on the UnipI?



  • hi, thank you for your answer, yes i have tried multiple combinations giving my zero experience with unipi and 1-wire and no visuals on the site.
    the jumpers are in the unipi, i any advice on what to do cos i tried the 1-wire bus and still no luck.
    where can i find 1-wire addresses ?

    thank you.



  • OK now I am lost of what you succeeded and where you got stuck.

    If you connect any 1wire device to the bus it will appear in some time on the web page, The other way of detecting its address is to stop the evok service (service evok stop) and run it manually by /opt/evok/evok.py



  • thanks for your reply,

    the Unipi board is fully working with Evok.
    the 1W-8R is still not working.

    thanks



  • ok,
    thi is what happend:

    pi@raspberry ~ $ sudo python /opt/evok/evok.py
    Listening on port: 81
    UniPi version:1.1
    Entering measure loop
    Entering 1wire loop
    New WebSocket client connected
    [I 151126 08:05:14 web:1946] 200 GET /rest/all (192.168.1.11) 8.04ms
    New WebSocket client connected
    [I 151126 08:05:14 web:1946] 200 GET /rest/all/ (192.168.1.8) 4.97ms
    Skipping WS message:  
    Skipping WS message:  
    Skipping WS message:  
    New sensor DS2408 - 290F63180000007C
    
    ```and this is my 1w-8R configuration:
    

    [1WDEVICE_2]
    bus = 1
    address = 290F63180000007C
    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

    [1WRELAY_14]
    sensor = 2
    pin = 4

    [1WRELAY_15]
    sensor = 2
    pin = 5

    [1WRELAY_16]
    sensor = 2
    pin = 6

    [1WRELAY_17]
    sensor = 2
    pin = 7

    still not working.
    thank you.


  • Could you paste the whole config please? Silly question but have you resterted the evok service after modyfing the conf fiele? Because everything here looks ok so you should see the relays in the output section of the webpage



  • yes i always do "service stop" before i edit and "service start" after file is saved.

    here is the config file:

    #!! don't use # for inline comments
    
    [MAIN]
    webname = unipi
    staticfiles = /var/www/evok
    ;password = test
    ;rpcpassword = test
    secret = ut5kB3hhf6VmZCujXGQ5ZHb1EAfiXHcy
    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 = 290F63180000007C
    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
    
    [1WRELAY_14]
    sensor = 2
    pin = 4
    
    [1WRELAY_15]
    sensor = 2
    pin = 5
    
    [1WRELAY_16]
    sensor = 2
    pin = 6
    
    [1WRELAY_17]
    sensor = 2
    pin = 7
    


  • So you see the relays on the web but they does not switch? If you have the 5V power connected to the 1W-8R does the LEDs near the relays blink?

    It looks that everything is ok and we fully test all devices before even put it in stock



  • I can only see the relays of the main unipi not the 1w-r8 is possible the rj45 cable has something to do with this ?

    I can switch only 1 to 8 relays but not the other board, I cannot see it and yes it is connected to the power supply that I ordered with it. But nothing yet.



  • That is just weird. The output of the evok.py is after the 1wdevice is configured? Because if the device is properly configured, the message about a new device should not appear. Are you sure you are editing /etc/evok.conf file?



  • Yes I am positive about that it's the same config file I used all the time



  • hi,
    sorry i just came back from a trip, i made a new RJ45 cable and still no luck.
    i have also changed the unipi board (i have 2) but still the same, i cannot see the 1W-8R
    any suggestions ?



  • Hello,

    your cable is OK (because the output of /opt/evok/evok.py shows that it detects the sensor and prints its address). But your /etc/evok.conf file is not read correctly (or not modified as you said).

    Try adding 'print address' to /opt/evok/config.py to the end of this section elif devclass == 'SENSOR' or devclass == '1WDEVICE': (cca line 84)

    and send here the output of /opt/evok/evok.py (and please use the```
    syntax



  • hi, i have reinstalled everything fresh, and this is the new config file, i have also added the 'Print address' and i run 'sudo python /opt/evok/evok.py' amd this is the config and the results:

    #!! don't use # for inline comments
    
    [MAIN]
    webname = unipi
    staticfiles = /var/www/evok
    ;password = test
    ;rpcpassword = test
    secret = ut5kB3hhf6VmZCujXGQ5ZHb1EAfiXHcy
    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 = 290F63180000007C
    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
    
    

    This is the results of running the above command:

    pi@raspberrypi /home/evok $ sudo python /opt/evok/evok.py
    Listening on port: 80
    UniPi version:1.1
    Entering measure loop
    Entering 1wire loop
    New sensor DS2408 - 290F63180000007C
    New WebSocket client connected
    [I 151206 07:13:15 web:1946] 200 GET /rest/all/ (192.168.1.8) 7.69ms
    

    i hope this helps.



  • Any other change in the config file (eg removing relay 8 on unipi or changing the number of relay eg from 8 to 9 works)?



  • @tomas_hora:3c7karnk:

    Any other change in the config file (eg removing relay 8 on unipi or changing the number of relay eg from 8 to 9 works)?

    it tired it did not work, any idea why this is happening ?
    to be honest i am starting to give up.

    thanks Tomas.



  • The thing is that you are not editing the same file as evok is reading (/etc/evok.conf) or you do not have the permissions solved. Evok tries to open /etc/evok.conf but if it does not succeed it tries to open evok.conf file in the same directory as it is running in (e.g. /opt/evok/evok.conf - this does not exist by default).

    I have one last tip for you, try editing /opt/evok/evok.py - add this right after line 437 ( before the line containing Config.read(path)):

    print path
    with open(path, 'r') as fin:
        print fin.read()
    
    

    And send me the output of the evok when you run int manually.



  • Hi Tomas,

    just to be clear there are 2 Evok.conf
    1- /etc/evok.conf
    2- evok's main installation directory: /home/evok/etc/evok.conf

    when you say 'The thing is that you are not editing the same file as evok is reading (/etc/evok.conf) ' you mean the first path right ?
    thanks.