I have Mpu6000 which is connected to I2C shield mounted on Raspberry Pi 3 B+.
I have installed the node-red and I2C node in raspberry pi, but to scan the I2C data, do I have to write the code or is there any other way to scan I2C register?
Like In Raspberry Pi command shell I am using the cmd - 'i2cdetect -y 1'
I just start with this node still not able to find anything useful
You have to set the device address, the command to get the data you want and set the number of bytes that will be returned in the I2C node. The node will return a buffer that you have to extract the data from. Show us a little more of what you are trying to do.
i2cdetect -y 1 will only give you the address of the device.
If you really do want to scan it from within node-red, which seems an odd thing to do, you can execute the detect command using an Exec node.
Just a footnote... Just this morning I hit a case of i2c scan failing to see a device on the i2c bus, that i2cdetect -y 1 found just fine. I even tested the sensor via python3 just fine as well. It was a HTUD21 sensor at address 0x40. The i2c scan node reported and empty array of devices on output 1, and absolutely nothing came out of output 2 when the issue occurred I swapped in a BME280, and i2c scan node worked fine. So it might be an issue specific to only some sensors? I tested with BMP280, BME, MCP9808, etc., no issues. But i2c scan still can't seem to see an HTU21D or SI7021 sensors, at least on my setup that is. They use the same command set, so the same python3 script can read either, interesting that the i2c scan node fails to see either of them so something about the address being 0x40 or that they have the same command set maybe part of the issue?