I2c help with baby steps please

Hi - new to everything (raspberry pi, python, node-red) but some experience with i2c
I have built a board for my Pi that has a number of i2c devices (RTC, ADC, DAC and I/O expansion) - I have all of these working in python via thonny

I'm working on getting them working (specifically the I/O, ADC and DAC) with Node-Red

I ran i2cdetect -y 1 straight after a reboot and can clearly see 4 i2c parts (0x0c, 0x20, 0x4d and 0x68 in the table (0x20 (decimal 32) is the PCF8574 I/O expansion chip I'm working on for the moment) - (I can confirm that this part works fine in Python on this address)

I've installed

npm install --unsafe-perm node-red-contrib-i2c

In ~/.node-red of my pi - as instructed here

I have this flow to start with

[{"id":"78223869.732038","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"d2a792fc.0850c","type":"debug","z":"78223869.732038","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":100,"wires":[]},{"id":"e72af964.8aa9c8","type":"inject","z":"78223869.732038","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":80,"y":140,"wires":[["8d06713c.e47d4"]]},{"id":"bbf568e2.860b78","type":"debug","z":"78223869.732038","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":180,"wires":[]},{"id":"8d06713c.e47d4","type":"i2c scan","z":"78223869.732038","name":"","busno":"1","x":240,"y":140,"wires":[["d2a792fc.0850c"],["bbf568e2.860b78"]]}]

My debug output appears to show nothing of value like this

Once I run that - if I try i2cdetect -y 1 again, I see this (which is puzzling)

It seems quite hard to find any clear instruction about how to use the i2c nodes (but I am a newbie and a bit thick - so that could just be me)

If anyone could help me make any sens of this I would be really grateful. Thanks in advance

BTW - what is the correct term for a board on which the Pi is fitted (as opposed to a HAT which is fitted to the Pi)? I've built my own development board and I'm not sure if that would be called a boot, sole, foot or some other equally odd name?

1 Like

I don't think the NR i2c node is multimaster, so you can only have one master in the bus.
Or NR or shell.
Looks like the bus is working, so now you can build your flows.

? I only have 1 master, the other parts are all slaves. As shown i2cdetect gives a sensible result when run the first time, but nonsense when run again after starting node red.

Part of my problem seems to be not being able to find any deep dive documentation on the subject.

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