alm4096 / Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino

Arlec DC Grid Connect Ceiling Fan 433MHz Remote, FT0317A Arduino
2 stars 0 forks source link

Fan not responding #1

Open Diabe1337 opened 2 years ago

Diabe1337 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Hey,

Thanks for your answer.

I have tried the verification of the installed RC-switch library. It is saying getProtocol is undefined. When searching for it I can only find setProtocol and getReceivedProtocol. This is when directly searching through the zip file.

Is this correct?

From: alm4096 @.> Sent: vrijdag 29 juli 2022 11:07 To: alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino @.> Cc: Diabe1337 @.>; Author @.> Subject: Re: [alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino] Fan not responding (Issue #1)

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.

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 that 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.

You can also test with an SDR (Software Defined Receiver, 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 receiver 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.

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.

— Reply to this email directly, view it on GitHubhttps://github.com/alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino/issues/1#issuecomment-1199048300, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANMSFKE2BBOYTKTXCRTBDSTVWONMLANCNFSM5437XRVA. You are receiving this because you authored the thread.Message ID: @.**@.>>

alm4096 commented 2 years ago

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 commented 2 years ago

I might be missing something, but here’s my understandings.

By adding those lines you are calling the getProtocol function. But this is not defined anywhere in the library. I’ve looked through all the raw files.

And by adding those lines, that function does not get defined. I do see a function getReceivedProtocol, are you looking for this?

Im using studio code, added the library in the lib folder. Its imported alright.

Am I looking over something?

From: alm4096 @.> Sent: woensdag 3 augustus 2022 12:15 To: alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino @.> Cc: Diabe1337 @.>; Author @.> Subject: Re: [alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino] Fan not responding (Issue #1)

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".

— Reply to this email directly, view it on GitHubhttps://github.com/alm4096/Arlec-DC-Ceiling-Fan-Remote-FT0317A-Arduino/issues/1#issuecomment-1203754536, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANMSFKEUWFQUNST3MYUVSOLVXJBANANCNFSM5437XRVA. You are receiving this because you authored the thread.Message ID: @.**@.>>

alm4096 commented 2 years ago

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.