Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By Marc R.K
#44523 Hello i'am Marc from Germany,
Nice to be a new Member in this Forum ;)

I have a little Problem and hope somebody can help me here

My setup is NodeMCU Lua Board and a simple 433 Mhz reciver :
I connect vcc from reciver to 3,3V from the NodeMcu.
I connect gnd from reciver to gnd from the NodeMcu.
I connect Data from the receiver to D1 from NodeMcu .

I test this very simple code:

Code: Select all

#include <ESP8266WiFi.h>
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(115200);
 
  mySwitch.enableReceive(5);  // This is D1
}

void loop() {
  if (mySwitch.available()) {
   
    int value = mySwitch.getReceivedValue();
   
    if (value == 0) {
      Serial.print("Unknown encoding");
    } else {
      Serial.print("Received ");
      Serial.print( mySwitch.getReceivedValue() );
      Serial.print(" / ");
      Serial.print( mySwitch.getReceivedBitlength() );
      Serial.print("bit ");
      Serial.print("Protocol: ");
      Serial.println( mySwitch.getReceivedProtocol() );
    }

    mySwitch.resetAvailable();
  }
}




The Problem is: it works but not every time and the range is very low...
I think it is a Problem with Interrupt because this setup without NodeMcu and with a Arduino Board works fine with a good Range.

Is it possible that the Problem is the pinsetup on the NodeMcu Lua ? Can i set the Gpio to a Interrupt Mode or similar ?!

I hope somebody can help me out

Regards from Germany ;)