B4R Question nodeMCU and rRCSwitch library

giggetto71

Member
Licensed User
Hi,
does any one have any experience of the rRCSwith library with NodeMCU? I have installed the lib without problems and compiled the RCSwitch-receive module from the example but cannot get the Sub rcs_Available fired. maybe I am connecting the wrong pin? Which one should I use on the NodeMCU and how should I configure it the enable receiver. I have tried:

rcs.enableReceive("rcs_Available",pp.D6)

but it does not work.
any idea?
thanks
 

giggetto71

Member
Licensed User
I forgot to paste the code...sorry
B4X:
#Region Project Attributes
    #AutoFlushLogs: True
    #CheckArrayBounds: True
    #StackBufferSize: 300
#End Region

Sub Process_Globals
    Public Serial1 As Serial
    Public rcs As RCSwitch
    Public pp As D1Pins
End Sub

Private Sub AppStart
    Serial1.Initialize(115200)
    Delay(1000)
    Log("AppStart")
    rcs.Initialize
    rcs.enableReceive("rcs_Available",pp.D6)
End Sub

private Sub rcs_Available()
    Log("Code: ", rcs.ReceivedCode)
    Log("Protocol: ", rcs.ReceivedProtocol)
    Log("Bit length: ", rcs.ReceivedBitLength)
    Log("Delay: ", rcs.ReceivedDelay)
    Log(" ")
    rcs.ResetAvailable
End Sub
 

thetahsk

Active Member
Licensed User
I forgot to paste the code...sorry
B4X:
// check your receive pin
// from the header file
//Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_1)
           //</code>
           static const int WEMOS_Receivepin_1   = 5;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_2)
           //</code>
           static const int WEMOS_Receivepin_2   = 4;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_3)
           //</code>
           static const int WEMOS_Receivepin_3   = 0;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_4)
           //</code>
           static const int WEMOS_Receivepin_4   = 2;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_5)
           //</code>
           static const int WEMOS_Receivepin_5   = 14;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_6)
           //</code>
           static const int WEMOS_Receivepin_6   = 12;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_7)
           //</code>
           static const int WEMOS_Receivepin_7   = 13;

           //Example: <code>
           //rcs.enableReceive("rcs_Available", rcs.WEMOS_Receivepin_8)
           //</code>
           static const int WEMOS_Receivepin_8   = 15;
and check the arduino example if they are working.
https://github.com/sui77/rc-switch
 

giggetto71

Member
Licensed User
thanks...had no luck..
I have set
B4X:
rcs.enableReceive("rcs_Available",rcs.WEMOS_Receivepin_3)
and connected the receiver data pin to pin D3 but still nothing...
any clue?
 

giggetto71

Member
Licensed User
it works now..at least it can read the transmitter driven by the same nodemcu. I would say it's ok now. probably I was just guessing there were some othere devices transmitting using 433 Mhz but maybe I was wrong..thanks
 
Top