sebmillet / RF433recv

Manage receiving codes from 433 Mhz RX device plugged on Arduino
GNU Lesser General Public License v3.0
6 stars 4 forks source link

Crashes on ESP8266 #10

Closed praneeth03 closed 7 months ago

praneeth03 commented 8 months ago

Thanks a ton for creating the RF433any, RF433send and RF433recv libraries. This is much more compatible than the rc_switch library and have allowed me to control my previously undetectable ceiling fans.

However I noticed the the RF433recv library has a bug/incompatibility with the more recent ESP8266 board manager. Essentially the included example (01_generic) compiles fine but crashes repeatedly with an error that says "ISR not in IRAM!". Upon some research it seems that including the IRAM_ATTR decoration for the line 65 in RF433recv.cpp (void handle_int_receive();) fixes the issue. Apparently the more recent versions of the ESP8266 board libraries are very strict and expect more functions to have the IRAM_ATTR decoration.

I hope you will add this fix into the library so that it can help others in the future.

Thanks again!

sebmillet commented 8 months ago

Hello

About your proposal, I'll be happy to include such a fix in the code.

The thing is, I don't know where this decoration is missing, could you precise? In RF433send there is no interrupt management so I don't see a candidate for such a decoration, and in RF433any the two functions subject to being attached to interrupt handler do have the decoration already... Thanks for providing details,

Best Regards, Sébastien Millet

praneeth03 commented 8 months ago

Thanks for taking the time to reply. This needs a fix in RF433recv library (not in RF433send - my mistake about mentioning RF433send earlier). Specifically, adding IRAM_ATTR to line 65 (in RF433recv.cpp) as shown in below screenshot is what makes it work again with ESP8266.

image

Please let me know if you need any further clarification.

sstawecki commented 7 months ago

Hello! Any update? I want to use my ESP32 with this library, I agree with @praneeth03, with RCSwitch I couldn't detect my remote signal, this library has more compatibility!

sebmillet commented 7 months ago

Hello

Actually adding this option has already been added so I need your help to understand it all. So from the beginning I was confused by all this. But maybe I know the reason...

=>

In the actual repo (actual commit = af4e350 = release tag 0.3.3, 2023-03-11) you can see the below:

File RF433recv.cpp:

line 65 #if defined(ESP8266) line 66 IRAM_ATTR line 67 #endif line 68 void handle_int_receive();

That said, when checking on Arduino library reference, I can see the lib version is 0.3, dated 2022-04-10.

So now there are two reasons for this situation:

1- The "#if defined" does not work as expected (very unlikely)

2- You are using the last "Arduino Release Library" version and as such, you are using 0.3.0, therefore you don't have the IRAM_ATTR attribute to the handle_int_receive() function.

Can you please confirm we are in the situation (2)? With your confirmation, I'll see to how to get the lib updated in Arduino reference.

Thanks for your help,

Reg, Sébastien Millet

sebmillet commented 7 months ago

Hello again

So, using arduino-lint, I discovered that since a while ago, updates in github were not propagated into the Arduino Library Reference - there were symlinks in me repo and Arduino does not like it. I updated the repo by removing these symlinks and now it is fine, according to arduino-lint.

I updated the actual version to 0.3.4. It has a release tag on. From my experience, update (into Arduino Library Reference) can take up to 24 hours.

Hence, you should see the last version (0.3.4) sometime tomorrow, available on Arduino Library Reference.

Can you please check and confirm?

Thanks,

Reg, Sébastien Millet

sstawecki commented 7 months ago
image

Thank you very much! I'll test it as soon as I have some time. I'm still learning arduino stuff so not very familiar. Ended up using this library because discovered RCSwitch cannot read my gate remote control signal, I thought it was not 433mhz, but when I tested with your library it worked like a charm, now I'm trying to see how to copy the exact signal in order to emmit it again. When I tested with the ESP32, got this kind of compatibility error.

PS: I was using v0.3.0

praneeth03 commented 7 months ago

Thanks for making the update. Confirming that this works great now with ESP8266.