Multiple 8-Relay Addon EMO-R8



  • Hi,,

    I have a UniPi 1.1 with 2 x 8-Relay Addon EMO-R8 attached to it.
    In the /etc/evok.conf i've uncommented the extension example below. That didn't work directly, but after reading this: viewtopic.php?f=9&t=123#p307 I've got it working with 1 extension now.

    But now, I've added the params for the second extension, but I cant seem to get those working. Both the extensions are switching together.

    I guess it's a buss address thing, but i don't have any info about those. How should it be then? I've seen this video on youtube: https://www.youtube.com/watch?v=ouRjLepp2SM so I think you guys can help me quickly with this.
    Sharing the evok.conf file in that video would also be nice to have as a refference.

    I'm trying:

    [MCP_3]
    i2cbus = 1
    address = 0x22
    
    [RELAY_17]
    mcp = 3
    pin = 7 
    
    etc.. etc..
    
    


  • Hi,,

    I have a UniPi 1.1 with 2 x 8-Relay Addon EMO-R8 attached to it.
    In the /etc/evok.conf i've uncommented the extension example below. That didn't work directly, but after reading this: viewtopic.php?f=9&t=123#p307 I've got it working with 1 extension now.

    But now, I've added the params for the second extension, but I cant seem to get those working. Both the extensions are switching together.

    I guess it's a buss address thing, but i don't have any info about those. How should it be then? I've seen this video on youtube: https://www.youtube.com/watch?v=ouRjLepp2SM so I think you guys can help me quickly with this.
    Sharing the evok.conf file in that video would also be nice to have as a refference.

    I'm trying:

    [MCP_3]
    i2cbus = 1
    address = 0x22
    
    [RELAY_17]
    mcp = 3
    pin = 7 
    
    etc.. etc..
    
    


  • Could you paste the whole config?

    Br,
    Tomas



  • I got the params for the first extension from: viewtopic.php?f=9&t=123#p307

    @23wxgjd9:

    #!! don't use # for inline comments

    [MAIN]
    webname = unipi-001
    staticfiles = /var/www/evok
    ;password = test
    ;rpcpassword = test
    secret = ut5kB3hhf6VmZCujXGQ5ZHb1EAfiXHcy
    ;port = 80
    ;enable_cors = False
    ;cors_domains = "www.test.domain"

    [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 ; ~~default sensor reading
    scan_interval = 300 ; ~~how often is made searching

    #[SENSOR_1] ; onewire thermometer
    #bus = 1 ; link to I2CBUS_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

    [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

    ;Extension module EMO-R8 nr 1
    [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

    ;Extension module EMO-R8 nr 2
    [MCP_3]
    i2cbus = 1
    address = 0x22

    [RELAY_17]
    mcp = 3
    pin = 7

    [RELAY_18]
    mcp = 3
    pin = 6

    [RELAY_19]
    mcp = 3
    pin = 5

    [RELAY_20]
    mcp = 3
    pin = 4

    [RELAY_21]
    mcp = 3
    pin = 3

    [RELAY_22]
    mcp = 3
    pin = 2

    [RELAY_23]
    mcp = 3
    pin = 1

    [RELAY_24]
    mcp = 3
    pin = 0~~~~



  • Have you switched the address pins on the second extension module to 0x22 according to the table between relay and power connector?



  • @tomas_hora:s68igpb0:

    Have you switched the address pins on the second extension module to 0x22 according to the table between relay and power connector?

    No I didn't. Where can I find this table? And what should that configuration be then?



  • Found it..

    First extension at 0x21 (bus 1) -> address pin: A0=1, A1=0 , A2=0
    Second extension at 0x22 (bus 1) -> address pin: A0=0, A1=1 , A2=0

    But still the table for reference would be nice..