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

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.
</s>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<e>
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!

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.

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]#!/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)
[/code]

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.

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?

Helloooooo…!?

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… :?

@paul.fleer Are you using Grove.py? If you paste in your test code and method, maybe I can help you

Hi,
I’ve got a similar problem.
I test the provided test script seeed_relay_test.py
After a few times, sometimes 1, sometimes 2, sometimes 5 times an error pops up and the script stops.

Here the commands and output of a test, here the script results the error after two successful commands :

pi@RaspberryPi2:~ $ python /home/pi/RelayBoard/seeed_relay_test.py
input: 2on
ON_2…
input: 2off
OFF_2…
input: 3on
ON_3…
Traceback (most recent call last):
File “/home/pi/RelayBoard/seeed_relay_test.py”, line 90, in
relay.ON_3()
File “/home/pi/RelayBoard/seeed_relay_test.py”, line 34, in ON_3
bus.write_byte_data(self.DEVICE_ADDRESS, self.DEVICE_REG_MODE1, self.DEVICE_REG_DATA)
IOError: [Errno 121] Remote I/O error
pi@RaspberryPi2:~ $

After the error the script keeps on returning the same error.
The command ‘sudo i2cdetect -y -r 1’ shows that the connected device is no longer available
Only a complete shutdown and restart helps to return to a script that works.

My Raspberry is a Raspberry PI 2 model B 1GB, no other devices are connected
The software is an unchanged last Raspbian image (3 days ago) provided by the Raspberry platform.

As this is a very standard situation could the cause be a faulty relay shield?

Best regards
Erik

I’m having the same issue.

It seems like when I connect lights to the relays they work great. I can can run them all day. When I connect something higher current draw (less than the 15A ability of these relays) like a pump it will turn on fine. When I turn it off the board seems to shut down. My Pi will continue to function but the board is completely off. It doesn’t show up when running the “i2cdetect” function in terminal.

Do I have a faulty board? Is there anything that can be done without replacing it? Any insight into this would be great.

@pifarm @erik.v We confirm that this is due to a design problem, and here is the solution.

  1. A 10uF capacitor with a withstand voltage of more than 10V can be added between 5V and GND on the back of the header;For example:
  2. Add a 10uF capacitor above 6.3V withstand voltage between 3V3 and GND;For example:

Hi, I have a lot of units that currently have this problem.
Is the new unit(2021-02-08) have this problem fixed?

Yes, already fixed. @dlafontaine

thanks for your quick reply!!