Git Product home page Git Product logo

Comments (2)

e-abdi avatar e-abdi commented on July 18, 2024 1

@Paraphraser thank you so much for the response!
That worked!
Sorry for not mentioning anything about my project.
This is a for my campervan which has IOTstack running on a raspberry and a bunch of other ESP32 and 8266 in various spots to control different relays/sensors. I just had one of these raspberry relay hats (https://wiki.52pi.com/index.php/EP-0099) laying around so I thought I use it instead of adding another esp8266.
I am using the node-red-contrib-i2c add-on as you mentioned. Just needed to map the i2c devices to the container as suggested, then used the "i2c scan" node to find the address and "i2c out" node to control the relays.

from iotstack.

Paraphraser avatar Paraphraser commented on July 18, 2024

Please read #194 because this repo (gcgarner) is dormant. That issue explains what you should do to migrate to the active repo (SensorsIot).


I have never tried to use any of the GPIO pins on a Raspberry Pi for an actual project so I can only suggest things to try.

I tackle I2C problems with ESP32 or ESP8266 development boards. There are good libraries for both I2C and MQTT (for the command-and-control comms), and plenty of examples to follow.

You haven't said anything about your project so I'm a bit in the dark. There's a node-red-contrib-i2c add-on node which might do the trick. It seems to want devices in the form /dev/i2c-n where n is in the range 0…7.

My Raspberry Pi 4 appears to have I2C devices at /dev/i2c-20 and -21. If you're also using a Pi4, you could try mapping those into the container by adding these lines to the nodered service definition:

    devices:
      - "/dev/i2c-20:/dev/i2c-1"
      - "/dev/i2c-21:/dev/i2c-2"

If you're using something like a Zero2W, it seems to have a different set of I2C devices:

/dev/i2c-0  /dev/i2c-10  /dev/i2c-11  /dev/i2c-2

I have no idea how any of those devices (either the Pi4 or the Zero2W) map to pins so you'll have to figure out that part for yourself.

Hope this helps.

from iotstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.