Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errno 121 : Remote I/O error #86

Open
jamesjohnson82 opened this issue Oct 23, 2021 · 27 comments
Open

Errno 121 : Remote I/O error #86

jamesjohnson82 opened this issue Oct 23, 2021 · 27 comments

Comments

@jamesjohnson82
Copy link

I have been trying everything to get my RPi4B to communicate with the USP Plus but I continually get this error

pi@ImpactRemote:~/upsplus $ python3 OTA_firmware_upgrade.py
Traceback (most recent call last):
  File "OTA_firmware_upgrade.py", line 23, in <module>
    aReceiveBuf.append(bus.read_byte_data(DEVICE_ADDR, i))
  File "/usr/local/lib/python3.7/dist-packages/smbus2/smbus2.py", line 433, in read_byte_data
    ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error
pi@ImpactRemote:~/upsplus $ 

Remote I/O error.

I have been unable to find any information on what this error means and how to troubleshoot it. as you can see below its stopping the install of the UPS Plus and failing

pi@ImpactRemote:~/upsplus $ sudo ./install.sh
[info] Welcome to 52Pi Technology UPS Plus auto-install Program!.
[info] More information please visit here:.
[info] -----------------------------------------------------.
[info] https://wiki.52pi.com/index.php/UPS_Plus_SKU:_EP-0136.
[info] -----------------------------------------------------.
[info] Start the configuration environment check....
[ ok ] Network status is ok....
[info] Start the software check....
[ ok ] git has been installed..
[ ok ] pi-ina219 library has been installed.
[info] Installing smbus2 library....
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: smbus in /usr/local/lib/python3.7/dist-packages (1.1.post2)
Requirement already satisfied: smbus2 in /usr/local/lib/python3.7/dist-packages (0.4.1)
[ ok ] smbus2 Installation successful..
[info] create /root/bin directory....
[info] Create python3 script in location: /root/bin/upsPlus.py Successful.
[ ok ] Create UPS Plus IoT customer service python script successful.
[info] Add into general crontab list..
[info] crontab has been created successful!.
------------------------------------------------------------
------Current information of the detected Raspberry Pi------
------------------------------------------------------------
Raspberry Pi Supply Voltage: 5.152 V
Raspberry Pi Current Current Consumption: 7029.773 mA
Raspberry Pi Current Power Consumption: 36245.585 mW
------------------------------------------------------------
Traceback (most recent call last):
  File "/root/bin/upsPlus.py", line 38, in <module>
    ina_batt.configure()
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 175, in configure
    self._max_expected_amps)
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 310, in _calibrate
    self._calibration_register(calibration)
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 356, in _calibration_register
    self.__write_register(self.__REG_CALIBRATION, register_value)
  File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 388, in __write_register
    self._i2c.writeList(register, register_bytes)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 127, in writeList
    self._bus.write_i2c_block_data(self._address, register, data)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 368, in write_i2c_block_data
    self._device.write(data)
OSError: [Errno 121] Remote I/O error
[FAIL] UPS Plus Installation is Incomplete! ... failed!
[info] Please visit wiki for more information:.
[info] -----------------------------------------------------.
[info] https://wiki.52pi.com/index.php/UPS_Plus_SKU:_EP-0136.
[info] -----------------------------------------------------.
pi@ImpactRemote:~/upsplus $ 

Thanks for the assistance.

@frtz13
Copy link

frtz13 commented Oct 23, 2021

i2c communications on the RPi, and communication with the other INA219 sensor (ina_supply) look ok. I'd guess this is a hardware failure of the ina_batt sensor (i2c address 0x45) on the board.

@jamesjohnson82
Copy link
Author

is there a way to confirm that that is the issue, or should I reach out to the manufacture for a replacement? I would like to fix the issue if at all possible.

@frtz13
Copy link

frtz13 commented Oct 23, 2021

I think you did the necessary. I suggest you contact the manufacturer with reference of this issue on github.

@jamesjohnson82
Copy link
Author

jamesjohnson82 commented Oct 23, 2021

Thanks @frtz13. Ill post again when i talk with the manufacturer.

@hellresistor
Copy link
Contributor

what os are you using and arch ?

@frtz13
Copy link

frtz13 commented Oct 23, 2021

@jamesjohnson82 one more thing you could try is this command: i2cdetect -y 1
this should normally show you a reply on 0x17, 0x40 (ina_supply), 0x45 (ina_batt) and 0x68 (real time clock on the UPS board)

@hellresistor
Copy link
Contributor

try use -y 2 or 3 if you are using an aarch64 debian 10

@jamesjohnson82
Copy link
Author

pi@ImpactRemote:~ $
pi@ImpactRemote:~ $
pi@ImpactRemote:~ $
pi@ImpactRemote:~ $ cat /etc/debian_version
10.11
pi@ImpactRemote:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@ImpactRemote:~ $ uname -a
Linux ImpactRemote 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l GNU/Linux
pi@ImpactRemote:~ $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 1
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 2
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 3
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

Hardware        : BCM2711
Revision        : d03114
Serial          : 10000000a2abc0fa
Model           : Raspberry Pi 4 Model B Rev 1.4

@jamesjohnson82
Copy link
Author

jamesjohnson82 commented Oct 24, 2021

pi@ImpactRemote:~ $ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@ImpactRemote:~ $

i2cdetect -y 0,2,or 3 do not result in anything. there is only one i2c bus on RPi4B

@hellresistor
Copy link
Contributor

hellresistor commented Oct 24, 2021

understand, just alert you in situation (is not your situation!!), if you decide use aarch64 (armv8), on debian 10 (this: https://raspi.debian.net/tested-images/ ), the '-y 1' will not detect ...

I say that because I have got same "ERROR" type before....

On THIS MOMENT I am installing the Debian 11 . I can give feedback.

The proof.

root@fifuproject:~# uname -a
Linux fifuproject 5.10.0-9-arm64 #1 SMP Debian 5.10.70-1 (2021-09-30) aarch64 GNU/Linux
root@fifuproject:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@fifuproject:~# cat /etc/debian_version
11.1

root@fifuproject:~# sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
root@fifuproject:~# sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
root@fifuproject:~# sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@fifuproject:~# sudo i2cdetect -y 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

@frtz13
Copy link

frtz13 commented Oct 24, 2021

@jamesjohnson82 on a normally working board, you should have a response on 0x17 and 0x45, too. the response (like the response in hellresistor's comment (i2cdetect -y 3).

@jamesjohnson82
Copy link
Author

I have contacted the company, MakerHawk, and they are sending me a new unit. thank you to everyone on this thread. when I receive the new board, I will post an update.

@ceckles
Copy link

ceckles commented Oct 27, 2021

having same about the same issue, got a replacement and still having issues and idea?

disregard my comment, mine was not working because the amazon seller send me a EP -0118 and not the EP-0136 version I requested.

@vali103
Copy link

vali103 commented Nov 17, 2021

Hi, my problem was solved by upgrading the UPS firmware.

@mmaga
Copy link

mmaga commented Nov 18, 2021

Hi, my problem was solved by upgrading the UPS firmware.

That is what @jamesjohnson82 is trying to do.
Which firmware version did you get? Mine is version 10 and I still receive Errno 121 : Remote I/O error randomly.

@ArjenR49
Copy link

I had the same issue and the discussion can be found at:
frtz13/UPSPlus_mqtt#23

(The error message Gindse invoer-/uitvoerfout is dutch for Remote input/output error.)

@vali103
Copy link

vali103 commented Nov 18, 2021

Hi, my problem was solved by upgrading the UPS firmware.

That is what @jamesjohnson82 is trying to do. Which firmware version did you get? Mine is version 10 and I still receive Errno 121 : Remote I/O error randomly.

Now i have firmware v10 . But now other strange things started to happen:

  1. Randomly cut the power for raspberry, (no shut down sequence). And the same after 1 min if i unplug the power. Shuts down when AC pulled and cannot turn back on #71

  2. Randomly i got the error back ( Errno 121 : Remote I/O error) but is ok after 1 sec or so

  3. I never see the battery fully charged.
    pi@raspberrypi:~ $ i2cdetect -y 1
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
    40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

  4. I don't know what UU means :)) it suposed to be 68

@hellresistor
Copy link
Contributor

try run command with sudo ?

@mmaga
Copy link

mmaga commented Dec 9, 2021

Dear @vali103,

I got rid of UU after disabling SPI interface, which I was using for the OLED. Yes, that address is 68.

I disabled the Serial Port interface also and I setup the I2C baud rate for 400MHz in /boot/config.txt (dtparam=i2c_arm=on,i2c_arm_baudrate=400000). OLED is much faster :-)

I planned my scripts (python) to make only sequencial access to the I2C interface (UPS reading/writing; OLED writing on display; Fan control writing). I'm still getting the I/O error, and its frequency is much lower after setting time.sleep() when sending I2C read/write commands.

Random shutdown totally went away.

The battery is never fully charged also, and the fourth led is always blinking, even when the UPS is off but connected to the power source.

@hellresistor
Copy link
Contributor

hellresistor commented Dec 11, 2021

The battery is never fully charged also, and the fourth led is always blinking, even when the UPS is off but connected to the power source.

Friend that was the fact .. battery will keep charge and discharge.. not exist a 'by-pass to Direct current cable, after full batteries'.. take it in consideration the 4th led blink it just a information the power cable its connected!

@mmaga
Copy link

mmaga commented Dec 13, 2021

I had to set baud rate back to 115200 (best rate based on the OLED specs) or the unit would never be out of OTA Firmware Upgrade Mode (0x18).
Maybe some of you knows which is the recommended baud rate for the UPS Plus.

@mmaga
Copy link

mmaga commented Dec 13, 2021

The battery is never fully charged also, and the fourth led is always blinking, even when the UPS is off but connected to the power source.

Friend that was the fact .. battery will keep charge and discharge.. not exist a 'by-pass to Direct current cable, after full batteries'.. take it in consideration the 4th led blink it just a information the power cable its connected!

... and it looks like there is no way to use it connected to the power cable without batteries also. Is it true?

@hellresistor
Copy link
Contributor

... and it looks like there is no way to use it connected to the power cable without batteries also. Is it true?

what is a propose about UPS ?? ... :\

@mmaga
Copy link

mmaga commented Dec 13, 2021

... and it looks like there is no way to use it connected to the power cable without batteries also. Is it true?

what is a propose about UPS ?? ... :\

Just in case you run out of batteries and have no one around.

@hellresistor
Copy link
Contributor

on that situation.. umount UPS from PI put batteries in UPS and conect power cable in ups, if batteries not dead, will charge batteries. wait 20/30m , to charge a little , and you can assemble it again.
That was my workaround when need.

@ntahal
Copy link

ntahal commented Jan 22, 2022

I had a similar problem where my ups device EP-0136 using the OTA firmware update.
All my values were still showing up correctly when using the "Full-featured-demo-code.py" and "upsplus.py". but upgrading gave me the same error as:
pi@device:~/upsplus $ python3 OTA_firmware_upgrade.py
Traceback (most recent call last):
File "OTA_firmware_upgrade.py", line 23, in
aReceiveBuf.append(bus.read_byte_data(DEVICE_ADDR, i))
File "/usr/local/lib/python3.7/dist-packages/smbus2/smbus2.py", line 433, in read_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

I managed to upgrade the firmware by following the second way of upgrading using the EP-0136 wiki's Method 2. (https://wiki.52pi.com/index.php?title=EP-0136)

@hellresistor
Copy link
Contributor

have you run this i2cset -y 1 0x17 50 127 b and than shutdown rpi, REMOVE BATTERIES. and than put them again on ups... ?!?!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants