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

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?

  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
  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:
[{"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":[]}]

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?

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

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 to do the upgrade, then test again and see what is happening.

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?

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.

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?

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

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.

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

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

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

To download the script:

cd ~
whoami
pwd

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

And to run it

bash ./nrinstall --node16

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

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.

pi

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:~ $

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

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

failed node:missing npm:missing
log file in attachment
nodered-install.log (21.0 KB)