Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fan not responding #1

Open
Diabe1337 opened this issue Jul 28, 2022 · 5 comments
Open

Fan not responding #1

Diabe1337 opened this issue Jul 28, 2022 · 5 comments

Comments

@Diabe1337
Copy link

Diabe1337 commented Jul 28, 2022

Hello,

In your readme you are talking about the 33ms being a problem. Any way to debug this? Since my fan is not responding.
Would it be the best to just try timings? Or scope and tune?

Also, you have a good sketch to try the receiving end? The standard library receiver sketch does not seem to pick up the signal

@alm4096
Copy link
Owner

alm4096 commented Jul 29, 2022

Hi,

As a first step I'd double check you've actually installed the modified RC-Switch library correctly. If you've already installed the original RC-Switch library you'll need to remove it. The easiest way to test this is to add this into the public section of the RCSwitch.h int nProtocol = getProtocol(void); and then add int nProtocol = RCSwitch::getProtocol(void) { return this->protocol;}; to RCSwitch.cpp. If your RC Switch library is correctly modified it'll compile correctly, if not it'll say the function is not defined. Also the function should return '7', whereas the original library will return '0' with the above code.

Second is to check you've actually got a 433MHz receiver/transmitter. Not all of them are 433MHz. Some are 315MHz so just double check the board.

Finally, to test your code is actually transmitting is somewhat harder. You can try to use the receiver function, however if something is wrong you'll receive nothing which isn't helpful. I actually used a logic analyser attached to the receiver which is the easiest way to test everything is working and to compare with what's coming from the remote. You can buy them from eBay cheaply https://www.ebay.com.au/itm/263726106948 however just remember you might need a pull down or pull up resistor to get the analyser to work correctly with the receiver. I then used PulseView to analyse what I captured. No Arduino is required for the logic analyser, it'll connect straight up to the data pin on the receiver.

You can also test with an SDR (Software Defined Radio, also cheaply available off eBay https://www.ebay.com.au/itm/373841028499 and use PothosSDR for the software) however I found the signal isn't very clean and very hard to decipher. The receiver is actually doing some amount of signal conditioning when it receives a signal and converts it to a digital output. The good thing about the SDR is you can actually see what frequency the remote is transmitting on and you can see other devices transmit too (like car keys, phones, wifi etc, even radio and TV signals) so it's a very handy tool to have in your toolbox. You don't need to connect the SDR to anything, it captures the signals wirelessly.

The cheapest way to test is your code transmitting without additional equipment though is to use another Arduino as a capture device. Be warned the Arduino is barely fast enough for this task and it'll be impossible to determine if the timing is correct as the capture resolution will be very poor. I just bit banged the receiver output in HEX to Serial and recorded the output with Putty in logging mode. You'll need to do a hell of a lot of clean up and sift through the noise to see the signal.

I recommend using a logic analyser and PulseView to test your receiver, it just makes things so much easier and you can use your remote to test your logic analyser and receiver are working and you can see timing issues very easily as it has tons of resolution for what you are trying to do.

Or if you have access to a scope that would work too, it might be a little hard to compare the ceiling remote to the transmitter output. You can connect the receiver straight to 5V and connect the scope to the data pin. As before you might need a pull up or pull down resistor (I can't remember which). The output from the receiver will look random until the remote is pressed then it should look pretty obvious.

Hopefully the above helps, let me know how you go

@Diabe1337
Copy link
Author

Diabe1337 commented Aug 2, 2022 via email

@alm4096
Copy link
Owner

alm4096 commented Aug 3, 2022

Hi,

You'll need to add the functions yourself. All you need to do is add this into the public section of the RCSwitch.h int nProtocol = getProtocol(void); and then add int nProtocol = RCSwitch::getProtocol(void) { return this->protocol;}; to RCSwitch.cpp. If your RC Switch library is correctly modified it'll compile correctly, if not it'll say the function is not defined when you try to call it. Also the function should return '7', whereas the original library will return '0' with the above modified code.

Putting the modified RC Switch library in the same folder as your sketch is not going to work. You'll need to add it to your libraries folder. If you are running windows then it'll be under "Documents\Arduino\libraries".

@Diabe1337
Copy link
Author

Diabe1337 commented Aug 4, 2022 via email

@alm4096
Copy link
Owner

alm4096 commented Aug 6, 2022

Hi,

Yes I was asking you to add them yourself. It's okay though, I've modified this Github to include a function that's only in the modified RCSwitch library.

Please download the updated code, install the modified RCSwitch, and then if you get a "amIModified() undefined" when compiling then the modified RCSwitch library is not properly installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants