Serial connection required to receive RF (D1 mini / v0.8.1)

Hi there, I hope somone can help…
Problem: RF to MQTT only works when serial port is connected.

Compile and upload ok
connect to mqtt and broadcast version ok.
(I am not using and have not tested transmit)

To Reproduce
program D1 from Arduino studio 1.8.8

  1. power D1 / OpenMQTTgateway from USB
  2. open serial terminal (I use TeraTerm) 115200/N/8/1
  3. Monitor MQTT broker (I use mqtt.fx)
  4. Generate a compatible RF-signal (I have tried various different products)
    Verify that the RF signal is received on the serial console AND on the mqtt broker.
  5. Close the serial terminal
  6. Generate a compatible RF-signal (I have tried various different products)
    Verify that the RF-signal is not received in the mqtt broker.

Hardware: D1 mini (module is ESP-12N)
OpenMQTTgateway version: 0.8.1
RCSwitch library version: 2.6.2
Board package version: 2.5.0-beta2 (also tested with 2.4.0, 2.4.2 with same result)

Hello,

Maybe try to connect your RF receiver to another pin like D2 and set 4 into config_rf.h, more info there:

1 Like

Ok - that fixed it… such a simple solution…
Maybe this should be added to the troubleshooting guide…?

Thanks for quick help!

For others in the same boat finding this thread…

Changing receiver pin to D2 means setting RF_RECEIVER_PIN to 4:

#ifdef ESP8266
#define RF_RECEIVER_PIN 4 // D3=0 D2=4 on nodemcu
#define RF_EMITTER_PIN 3 // RX on nodemcu
#elif defined(ESP32)

From 8266 pin definition in arduino:
https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h

static const uint8_t D0 = 16;
static const uint8_t D1 = 5;
static const uint8_t D2 = 4;
static const uint8_t D3 = 0;
static const uint8_t D4 = 2;
static const uint8_t D5 = 14;
static const uint8_t D6 = 12;
static const uint8_t D7 = 13;
static const uint8_t D8 = 15;
static const uint8_t D9 = 3;
static const uint8_t D10 = 1;

/th

Glad you got it working!
don’t hesitate to update the troubleshooting guide, it can be modified by anybody.

1 Like

Troubleshooting guide updated!

Great thanks for the next !

how do you actually flash the D1mini?

With the nodemcuv2 relevant environments.

Is that what you were asking?