Any idea ? raspberry4 with node-red-contrib-i2c gets different values on some registers

Hey Guys,

maybe some one has an idea. I have some commands i send send out (2 of 20) and get the correct value from. If i use i2cget i get the correct value for all commands. Example :slight_smile:

The buffer is 0, 0 is this wrong:

Welcome to the forum!

Can you tell us which sensor you are reading, and also post your flow?

1 Like

im reading from an Battery Managementsystem over i2c (sm-bus) here is the flow:

this is the same for all commands: in the node on the left thier is the command which goes in this code msg.command

if i use it on i2cget it works. but in node red only the top two, Temperature and Voltage gives me numbers which are correct

If the trigger nodes are all set to the same period you are probably getting conflicting requests on the i2c bus. Try querying the sensors one after the other, not in parallel.

1 Like

i did turn the interval off before, that didnt help. but i will restart the raspi and try without again.

You could also try deleting all the inject nodes except the first and connect the output of the first
i2c node to the input of the second and so on so that the i2c nodes read in series.

okay, good idea. But my problem stays the same, i remove the interval and clicked on the RSOC buttom, then i get 0,0. after that tryed temp buttom that worked. but on shell i get all the correct values

Is the i2c node connected to the RSOC inject node configured properly?

Yes, they all the same:
they get msg.command from the injects

i created an new flow with only one inject and one i2c. but still the same :confused:

Instead if the i2c node try an exec node and send the command as you do from the command line using i2cget, see what you get back.

use -y

Disable interactive mode.

yeah i had the same idea but its an ugly workaround isnt? But its working see here:

i want to read 10-15 values per second :smiley: not sure if its good to exec that much prosecces with node red

I very much doubt that the sensor will react that quickly at all! Even not using node-red.

i think i will raise a report issue on github, looks like the problem is in the i2c module / nodejs and not an i2c problem

1 Like

Good, the exec node workaround will probably keep you going, but not at the speeds you quoted I suspect.

Yeah, it works. By the way, if anyone has also these problems here is my bugreport:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.