# Remote I/O erro on reading data from I2C bus on Raspberry Pi

**URL:** https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817
**Category:** General
**Created:** [30 May 2023 14:48 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817 "2023-05-30T14:48:06Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [30 May 2023 14:48 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/1 "2023-05-30T14:48:06Z")

</div>

i've been using the i2c nodes to read data from the SHT21 sensor connected to Raspberry Pi. I can read the data using the Python script on the same board, so i was trying to replicate it on node-red. But with no luck. I scan using the scan node and get the output address = 64 which seems to be correct since i can get it from the python as 0x40, so until this is fine. after that i get stucked. There suppose to be an initialization command to softreset it, with the value = 0xFE, and i suppose to use the Output node, but when i try it with the value Bus address = 64, command =254, payload = 1 and send bytes=1 (or whatever other number i tryed) i keep getting Remote I/O error.  
Can u explain me what i'm doing wrong?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [31 May 2023 11:11 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/2 "2023-05-31T11:11:19Z")

</div>

1. What version of NR and node.js are you using? (you can get this from teh NR startup log)
2. which I2C node are you using i.e. node-red-contrib-???
3. please provide a small flow demonstrating the issue

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 07:46 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/3 "2023-06-06T07:46:01Z")

</div>

1. Node-RED version 3.0.2, node.js 16.20.0
2. i use the node-red-contrib-i2c version 0.9.0
3. it is really minimal:

```auto
[{"id":"a01ae621.1c4478","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"e91d8a63.52b4e8","type":"i2c scan","z":"a01ae621.1c4478","name":"","busno":"1","x":280,"y":160,"wires":[["5dcadecb.32e18"],[]]},{"id":"5a21f0f9.321c6","type":"inject","z":"a01ae621.1c4478","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":160,"wires":[["e91d8a63.52b4e8"]]},{"id":"d91a51db.bdd6d","type":"debug","z":"a01ae621.1c4478","name":"temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1090,"y":140,"wires":[]},{"id":"534357d3.ac6e78","type":"i2c out","z":"a01ae621.1c4478","name":"reset","busno":"1","address":"64","command":"254","payload":"1","payloadType":"num","count":"1","x":890,"y":140,"wires":[["d91a51db.bdd6d","3743aa6a.dff0e6"]]},{"id":"713f489a.e3d4d8","type":"inject","z":"a01ae621.1c4478","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":680,"y":140,"wires":[["534357d3.ac6e78"]]},{"id":"5dcadecb.32e18","type":"debug","z":"a01ae621.1c4478","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":430,"y":140,"wires":[]},{"id":"8e00c349.0cc13","type":"i2c out","z":"a01ae621.1c4478","name":"trigger temp","busno":"1","address":"64","command":"243","payload":"1","payloadType":"num","count":"1","x":930,"y":260,"wires":[["753fef2e.3e514","2b4eff6b.4413f"]]},{"id":"ce42c8db.ff46f8","type":"i2c in","z":"a01ae621.1c4478","name":"","busno":"1","address":"64","command":"1","count":"2","x":1250,"y":380,"wires":[["6ea3affa.4f397"]]},{"id":"753fef2e.3e514","type":"debug","z":"a01ae621.1c4478","name":"trigger","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1130,"y":240,"wires":[]},{"id":"3743aa6a.dff0e6","type":"delay","z":"a01ae621.1c4478","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":930,"y":200,"wires":[["8e00c349.0cc13"]]},{"id":"2b4eff6b.4413f","type":"delay","z":"a01ae621.1c4478","name":"","pauseType":"delay","timeout":"25","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1130,"y":300,"wires":[["ce42c8db.ff46f8"]]},{"id":"6ea3affa.4f397","type":"debug","z":"a01ae621.1c4478","name":"read","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1390,"y":380,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [6 June 2023 08:11 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/4 "2023-06-06T08:11:22Z")

</div>

Your'r running Node-RED V1.0.6?? The current version is 3.0.2!

Why haven't you updated NR? (do a backup of the device first)

What device are you running it on?

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 09:46 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/5 "2023-06-06T09:46:25Z")

</div>

Raspberry Pi 400. it was the version downloaded automatically for the Raspbian OS.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [6 June 2023 10:12 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/6 "2023-06-06T10:12:59Z")

</div>

Well that version is OLD and you should be able to upgrade it to the latest Node-RED version. BUT `backup the SD card first!`

Once you have a backup, follow the directions [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi) to do the upgrade, then test again and see what is happening.

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 13:15 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/7 "2023-06-06T13:15:57Z")

</div>

i made a back-up and trying to run the bash script suggested on the url provided by you, but it gives me a permission error. Is there any simple way just to upgrade the node-red?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 June 2023 13:34 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/8 "2023-06-06T13:34:48Z")

</div>

> [@Miliks](#):
>
> Is there any simple way just to upgrade the node-red?

Yes, just run the script linked to previously.

You can make a backup of the node red flows by copying everything from the .node-red folder except the node\_modules folder to your PC, just in case it goes wrong. Hopefully you do already have a backup, as SD cards do fail occasionally.

However, if you also have an ancient version of the Pi OS then you would be best to start with a new card and install the latest OS on it. Then install node-red using the script.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [6 June 2023 13:38 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/9 "2023-06-06T13:38:28Z")

</div>

What version of the OS are you running? (in a terminal run `lsb_release -c`)  
What user is the pi running with? (i.e. is it 'pi'?)  
You can find out by opening a terminal window and entering `whoami`  
Can you copy and paste the error you are seeing?

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 13:50 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/10 "2023-06-06T13:50:21Z")

</div>

lsb\_release returns me Codename: buster and i'm using the "pi" user  
the error is: bash: /dev/fd/63: PErmission denied

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 13:52 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/11 "2023-06-06T13:52:37Z")

</div>

what do u mean script linked to previously? The flow i have is very simple i already posted it in this chat and i do not have any other flows on this RPi yet, so i'm safe to update it. But script suggested on official page is not working for me.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [6 June 2023 13:58 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/12 "2023-06-06T13:58:34Z")

</div>

Just to make sure, the command you ran was this:  
`bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)`

At what point do you get the error message?

Also try running this command before the bash command:  
`sudo apt install build-essential git curl`

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 June 2023 14:06 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/13 "2023-06-06T14:06:11Z")

</div>

> [@Miliks](#):
>
> lsb\_release returns me Codename: buster

That is ok, it is good enough to run the latest node-red

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [6 June 2023 15:00 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/14 "2023-06-06T15:00:27Z")

</div>

> [@Miliks](#):
>
> But script suggested on official page is not working for me.

It is possible to seperate downloading and running the script. It's just possible this will resolve the problem.

To download the script:

```auto
cd ~
whoami
pwd

curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered >nrinstall

```

And to run it

```auto
bash ./nrinstall --node16

```

(The --node16 parameter should ensure that you get a current release of Nodejs too.)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 June 2023 15:14 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/15 "2023-06-06T15:14:21Z")

</div>

It would be good to know what the error is before resorting to downloading separately. Perhaps it was just the warning saying that it needed to upgrade nodejs.

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 16:07 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/16 "2023-06-06T16:07:43Z")

</div>

![pi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/ca8b5edde71481c29d14ed46decee9917253b301.png)

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 16:09 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/17 "2023-06-06T16:09:49Z")

</div>

```auto
pi@raspberrypi:~ $ curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered >nrinstall
pi@raspberrypi:~ $ ./nrinstall --node16
-bash: ./nrinstall: Permission denied
pi@raspberrypi:~ $

```

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [6 June 2023 16:10 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/18 "2023-06-06T16:10:44Z")

</div>

That's not how I suggested you run the script though.

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 16:15 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/19 "2023-06-06T16:15:04Z")

</div>

sorry, u r right, i didn't notice the first lines... upgrade in progress. Hope it will make a difference!

---

<div class="post-metadata">

### Author: ![Miliks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/miliks/32/7598_2.png) [@Miliks](https://discourse.nodered.org/u/Miliks)
#### Post date: [6 June 2023 16:18 UTC](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817/20 "2023-06-06T16:18:39Z")

</div>

failed node:missing npm:missing  
log file in attachment  
[nodered-install.log](https://discourse.nodered.org/uploads/short-url/sqEizvVUVtuiJcLHv2q3TPp8jKL.log) (21.0 KB)

[Next page](https://discourse.nodered.org/t/remote-i-o-erro-on-reading-data-from-i2c-bus-on-raspberry-pi/78817.md?page=2)
