bremme / arduino-wireless-doorbell

Collection of my Arduino libraries and sketches
GNU General Public License v2.0
4 stars 1 forks source link

NodeMCU #1

Open Johnwillliam opened 6 years ago

Johnwillliam commented 6 years ago

I was wondering if you could help me using the select plus doorbell with a rf receiver on a NodeMCU. I tried using your library but i couldn't get it working....

bremme commented 6 years ago

It's been a while that I used the library myself, but in principle it should work. Maybe I can help a little, but perhaps you can give me some more information. Does your sketch compile without errors for example, or does it not even compile. Does sending a signal to the doorbel work? Receiving is a lot harder then sending, if you did not already try, you could try to place the doorbell knob closer to your rf receiver?

Johnwillliam commented 6 years ago

Sending to the doorbel doesn't work. I'm using a NodeMCU and connected my transmitter to D1. I have a other hub where i use the same transmitter and thats working for the action switches. The transmit sketch compiles without issues but the receiver did have issues, i just rearanged some of the code because it couldn't find the callback. I placed the doorbell button next to the receiver so that shouldn't be it.

bremme commented 6 years ago

I'm afraid a don't have a clear solution. The default transmitter configuration probably only works for my doorbell. Even if the period/timing is the same the code if probably different. If you look at the transmitter constructor:

DoorBellTransmitter::DoorBellTransmitter( unsigned char txPin, unsigned long code, unsigned int period, unsigned char codeRepeat, unsigned char messageRepeat )

You can see that there are quite a couple settings. You probably need to get the receiver working first to obtain the code for your doorbell. Furthermore you could try to use a different pin for the transmitter and set it up properly using pinMode.

If you can't get the receiver to work, this is probably due to the used interrupts. The ESP IC handles this differently I think, but it should be documented. This might be helpful: https://arduino-esp8266.readthedocs.io/en/latest/faq/a03-library-does-not-work.html?highlight=interrupts

Another approach would be to sniff the signal coming from the doorbell knob. This is actually how I build the library. I just used a cheap usb sound card for this purpose, something like this: http://www.stevenhale.co.uk/main/2013/07/making-a-soundcard-logic-analyser/.

Finally, you could use a regular Arduino (if you have one) to sniff/receive the code. Make sure to use one of the interrupt pins. See: https://www.arduino.cc/en/Reference/Interrupts for more information.

iansexton commented 6 years ago

Hi, I've been playing with this today (with an arduino). The receiver code doesn't compile. The transmitter code works (almost) perfectly but I wonder if (eg) the timing is a little out? It works 9/10 times for me :) to sound the bell. I only have one bell & button so I can't be sure where the problem is. I might get my scope out & have a look at the data. Nicely done anyway & thanks for sharing :) Ian

iansexton commented 6 years ago

I've had my oscilloscope out today. Your timing looks perfect but I don't think your code is doing what you intended. It looks as if you are sending 00000000000000000 & not 01010111100000000 as you describe. These bells will accept 4 different transmitters. I think you have taught it a new code rather than reproduce your original code. fwiw MC908T is probably a Motorola/Freescale microcontroller. Ian