ESP8266 as (MQTT) Gateway with I2C Sensors
-
I want to use an ESP8266 (nodemcu) as MQTT gateway but instead building a client for the same room use it as Client as well.
However after connecting NRF24 I do not know how to connect my I2C sensors because D2 is used by the NRF already.
I searched for it but did not find a clear or working information on this. So I really would appreciate someone can give me a working solution to build a gateway including I2C support with one chip (nodemcu, Wemos, ???).
Staub as below but need WiFi for Gateway function tying to use a nodemcu.
Room sensor:
Board - Arduino Nano with Shield to provide proper power and PINs
Radio - NRF24
I2C - BME280 (Temp, Hum, Pres)
I2C - tsl2561 (Lux)
PIN - Mosfet (Nightlight with little LED)
PIN - MH-SR602 (PIR/Motion)
-
@Sunseeker According to the Connecting the Radio page, D2 is the default pin for the CE signal for the NRF24. If you'd like to use this pin for I2C, you can free it up by assigning a different pin for the CE signal by adding this line to your sketch:
#define MY_RF24_CE_PIN pin
IIRC, all available pins should work for this purpose (D0, D3, D4). Just pick one and if it doesn't work, use one of the other pins. Please make sure to add that line before
#include <MySensors.h>
.
Suggested Topics
-
💬 Dual Channel 0-10V Dimmer
OpenHardware.io • 2 Mar 2017, 21:51 • openhardware.io 12 Dec 2021, 10:32 -
Does MySensors require Arduino Timer 2?
Hardware • 6 Jan 2024, 19:39 • OldSurferDude 11 Jan 2024, 04:39 -
Orientation Actuator (pan/tilt)
OpenHardware.io • 23 Mar 2016, 11:25 • openhardware.io 23 Mar 2016, 11:25 -
RGBW LED Controller
OpenHardware.io • 26 Jan 2016, 14:35 • openhardware.io 20 Mar 2016, 16:51 -
💬 NRF51822 Livolo 2 channel 1 way EU switch(VL-C700X-1_Ver_C2)
OpenHardware.io • 11 Oct 2017, 13:40 • openhardware.io 12 Oct 2017, 07:38 -
Can't get ESP8266 gateway to work anymore
My Project • 8 Aug 2021, 22:17 • Zwer2k 12 Aug 2021, 09:05 -
💬 nRF24L01 Adapter Board (AH)
OpenHardware.io • 22 Jun 2022, 05:35 • openhardware.io 22 Jun 2022, 05:35 -
Home Automation
OpenHardware.io • 23 Mar 2016, 16:50 • openhardware.io 17 May 2018, 11:17