I2C Relay Board v1.0: I/O Error 121

Applications/questions using Raspberry Pi with Seeed products, please post it here.

Moderators: lily.li, violet, salmanfarisvp

Post Reply
markus.straessle
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Aug 24, 2018 3:47 pm

I2C Relay Board v1.0: I/O Error 121

Post by markus.straessle » Fri Aug 24, 2018 4:00 pm

Hi all
I'm currently playing around with the Seeed Relay Board for Raspberry Pi. Unfortunately it does not really work and the seeed support seams not to be willing to assist that much.

I've connected the Relay Board to my I2C Bus. It's visible, if I i2cdetect -y 1 with address 0x22.

I've connected:
SDA - GPIO 2 (PIN 3)
SCL - GPIO 3 (PIN 5)
3.3V - 3.3V (PIN 1)
5V - 5V (PIN 2)
GND - GND (PIN 6)


When I run any script, which is trying to communicate with the Relay Board, it does its job quite well, until some amount of time has passed. This time is sometimes about 2 seconds, sometimes about 5 minutes - quite random.

And then, the script fails. This is an example with the official example script from seeed. In this case, the error occoured after only 3 seconds.

Code: Select all

sudo python relais.py 
Turning all relays ON
Turning all relays OFF
Turning relay 1 ON
Traceback (most recent call last):
  File "relais.py", line 47, in <module>
    process_loop()
  File "relais.py", line 32, in process_loop
    relay_on(i)
  File "../modules/relayboard.py", line 36, in relay_on
    bus.write_byte_data(DEVICE_ADDRESS, DEVICE_REG_MODE1, DEVICE_REG_DATA)
IOError: [Errno 121] Remote I/O error
Once this happens, the device cannot be seen by i2cdetect anymore and even a reboot of the Raspberry Pi does not help. I have to completely unpower the whole thing and power it again to make it visible again.

Is there something I'm missing? Something which could explain this behaviour?
Thanks for any hint!

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: I2C Relay Board v1.0: I/O Error 121

Post by hong.jiang » Mon Aug 27, 2018 10:32 am

Hi:
Are you using your own script? I don't find any relais.py file in our github.If you don't mind if you can post the script that I can have a check. Here is our githubhttps://github.com/johnwargo/Seeed-Studio-Relay-Board.We have test these .py files and they work well.Please refer to these files.

markus.straessle
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Aug 24, 2018 3:47 pm

Re: I2C Relay Board v1.0: I/O Error 121

Post by markus.straessle » Mon Aug 27, 2018 2:32 pm

Hi and good morning. I did get this code from your support via E-Mail from Bill. See the code below. And also, I already mentioned, that it doesn't matter what code I use, the issue persists always. I also did try the scripts on your github page with the same results. Here is the code I got from Bill:

Code: Select all

#!/usr/bin/python
'''*****************************************************************************************************************
    Seeed Studio Relay Board Example
    By John M. Wargo
    www.johnwargo.com
********************************************************************************************************************'''
from __future__ import print_function

import sys
import time

from relay_lib_seeed import *


def process_loop():
    # turn all of the relays on
    relay_all_on()
    # wait a second
    time.sleep(1)
    # turn all of the relays off
    relay_all_off()
    # wait a second
    time.sleep(1)

    # now cycle each relay every second in an infinite loop
    while True:
        for i in range(1, 5):
            relay_on(i)
            time.sleep(1)
            relay_off(i)
        relay_all_on()
    # wait a second
        time.sleep(1)
    # turn all of the relays off
        relay_all_off()
    # wait a second
        time.sleep(1)
        

# Now see what we're supposed to do next
if __name__ == "__main__":
    try:
        process_loop()
    except KeyboardInterrupt:
        # tell the user what we're doing...
        print("\nExiting application")
        # turn off all of the relays
        relay_all_off()
        # exit the application
        sys.exit(0)
        

hong.jiang
Staff
Staff
Posts: 200
Joined: Tue Apr 17, 2018 11:03 am

Re: I2C Relay Board v1.0: I/O Error 121

Post by hong.jiang » Tue Aug 28, 2018 5:55 pm

Hi:
I have looked up you operation video. I think the probability of code's error is very low ( I test it again ). I think the IIC communication maybe not very stable. In your video, there are two other devices. Since the IIC interface adapts the Open-Drain mechanism, IIC bus needs pull-up resistors. But too many pull-up resistors will affect communication stability. So I recommend that you can remove the two other devices and have a test again.

markus.straessle
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Aug 24, 2018 3:47 pm

Re: I2C Relay Board v1.0: I/O Error 121

Post by markus.straessle » Wed Aug 29, 2018 3:09 am

Unfortunately I do have the same issue, if the Relay board is the only I2C-device connected. Do I maybe just have a damaged device?

markus.straessle
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Fri Aug 24, 2018 3:47 pm

Re: I2C Relay Board v1.0: I/O Error 121

Post by markus.straessle » Tue Sep 11, 2018 3:55 am

Helloooooo..!?

bill.yu
Junior-7
Junior-7
Posts: 735
Joined: Mon Apr 02, 2018 11:05 am

Re: I2C Relay Board v1.0: I/O Error 121

Post by bill.yu » Tue Sep 11, 2018 10:37 am

Hi there,

Please drop a new email to techsupport@seeed.cc. we will follow up with sales team and see the return policy. thanks.

Bill

paul.fleer
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Fri Jan 04, 2019 8:39 pm

Re: I2C Relay Board v1.0: I/O Error 121

Post by paul.fleer » Fri Jan 04, 2019 8:40 pm

Hi there,
Just wondering whether there was a solution, or whether this is caused by a faulty shield?
I'm suffering from the same issue... :?

Post Reply