Simple read from i2c device?

I think I am missing some thing basic here, I have si7021 sensor, the various node js modules are all very old and can't be used with NR, or so has been my experience. So, I figure why not try using i2c-bus?

This sensor needs the following sequence, reset sent, data request send, data read. I believe I can reset the sensor, simple i2c bus out sequence. I believe I can do the request humidity data of sensor, simple i2c bus out sequence. Then I need to read 3 bytes from the sensor. This is where I get a device IO error, i.e. "Error: EREMOTEIO: remote I/O error, read" response.

[{"id":"37a35c81.84b9cc","type":"inject","z":"654b54e5.8fec74","name":"Invoke","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":90,"y":260,"wires":[["a4d73c05.fda898"]]},{"id":"a4d73c05.fda898","type":"i2c out","z":"654b54e5.8fec74","name":"Reset","busno":"1","address":"64","command":"254","payload":"payload","payloadType":"msg","count":"1","x":230,"y":260,"wires":[["28b67399.15aa0c","d17664b8.7c2338"]]},{"id":"d17664b8.7c2338","type":"debug","z":"654b54e5.8fec74","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":380,"y":300,"wires":[]},{"id":"28b67399.15aa0c","type":"delay","z":"654b54e5.8fec74","name":"Wait (100ms)","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":390,"y":260,"wires":[["2b4d6353.d30684"]]},{"id":"2b4d6353.d30684","type":"i2c out","z":"654b54e5.8fec74","name":"Write Humidity","busno":"1","address":"64","command":"245","payload":"0","payloadType":"num","count":"1","x":580,"y":260,"wires":[["2ec88e15.2ad202","34c2ec23.825c34"]]},{"id":"41ce9e59.e1fa18","type":"i2c in","z":"654b54e5.8fec74","name":"Read Humidity","busno":"1","address":"64","command":"","count":"3","x":960,"y":260,"wires":[["a2b0887a.35f4f8"]]},{"id":"2ec88e15.2ad202","type":"debug","z":"654b54e5.8fec74","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":300,"wires":[]},{"id":"34c2ec23.825c34","type":"delay","z":"654b54e5.8fec74","name":"Wait (100ms)","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":770,"y":260,"wires":[["41ce9e59.e1fa18"]]},{"id":"a2b0887a.35f4f8","type":"debug","z":"654b54e5.8fec74","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1140,"y":300,"wires":[]}]

I was thinking if I use a i2c read node, requesting 3 bytes, to the right device address, I should get 3 bytes back, there is not applicable command, because it is just a simple buffer read?

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