Comments (2)
@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.
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)
- menu.sh error HOT 2
- unable to stop and remove Hassio containers in IOTstack HOT 1
- zigbee2mqtt
- menu.sh just checks for current version HOT 2
- Home Assistant Native keeps coming back after removal HOT 1
- Zigbee2MqttAssistant: Unable to connect to MQTT server mosquitto HOT 2
- chown -R 1883:1883 ./volumes/mosquitto does not accept "Y" HOT 1
- ImportError: No module named 'blessed' HOT 1
- running rtl_433 container problem HOT 7
- influxdb.conf ... changing the retention of data HOT 1
- how to retrive an old image HOT 5
- How Do I get rid of Pihole ? I tried everything. HOT 5
- IOT stack vs raspberry pi OS bullseye HOT 5
- installation script incorrectly prompting version types HOT 2
- Concerned about prerequisites HOT 3
- pi.hole only works intermittently. HOT 3
- Cannot start service nodered /dev/ttyAMA0 HOT 2
- can't install new nodes in Node-Red due to no connection of node-red container with internet HOT 1
- Integrating Telegram Nodes into Node-RED HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotstack.