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

RF/RFBRIDGE Update #1693

Merged
merged 13 commits into from
May 8, 2019
Merged

RF/RFBRIDGE Update #1693

merged 13 commits into from
May 8, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Apr 12, 2019

fixes #1590
fixes #1586
maybe #1014

  • redefine RF_SUPPORT to be generic RF support. Use RFB_DIRECT=1 for RCSwitch implementation, RFB_DIRECT=0 for EFM8 controller.
  • remove optional RF RAW support.
  • rename RF_PIN -> RFB_RX_PIN, fix hardware and general headers
  • aand small fix for Core 2.5.0 compilation.

I have only tried building itead-sonoff-rfbridge bin with RFB_DIRECT=0/1, to see if everything is in place. No live testing done yet.

cc @induprakash (#1014 (comment))

- remove optional RFRAW
- enable module when RF_SUPPORT=1, optionally enable RCSwitch
- reorder ifdef checks to treat RFB_DIRECT and old RF_SUPPORT the same
- remove RF_PIN
@iprak
Copy link
Contributor

iprak commented Apr 12, 2019

In relay.ino, can "#if RELAY_PROVIDER == RELAY_PROVIDER_RFBRIDGE" around rfbStatus() calls be replaced with check for RF_SUPPORT?

@iprak
Copy link
Contributor

iprak commented Apr 12, 2019

The RF section is missing in web image due to this check:

#if defined(ITEAD_SONOFF_RFBRIDGE)
    #ifndef WEBUI_IMAGE
        #define WEBUI_IMAGE    WEBUI_IMAGE_RFBRIDGE
    #else
        #undef WEBUI_IMAGE
        #define WEBUI_IMAGE    WEBUI_IMAGE_FULL
    #endif
#endif

@iprak
Copy link
Contributor

iprak commented Apr 12, 2019

MQTT messages is working for my nodemcu device as before.

I saw this explicit check for ITEAD_SONOFF_RFBRIDGE (in migrate.ino), does it need to be adjusted?
#elif defined(ITEAD_SONOFF_RFBRIDGE)

@mcspr
Copy link
Collaborator Author

mcspr commented Apr 14, 2019

RELAY_PROVIDER == RELAY_PROVIDER_RFBRIDGE" around rfbStatus() calls be replaced with check for RF_SUPPORT?

IDK about that. The way providers work now, it will force you to use RELAY_PROVIDER_RELAY with real pins. Maybe for some other PR.

I saw this explicit check for ITEAD_SONOFF_RFBRIDGE (in migrate.ino), does it need to be adjusted?

Nope. That is a copy of defines from hardware.h (which I'd like to replace with #1680 instead of duplicating data manually)

Some fixes. (kinda delayed, because I could not find rf receiver / transmitter yesterday)

  • fixed defined(ITEAD_SONOFF_RFBRIDGE) checks
  • runtime configurable RX & TX pins, WebUI section to configure them
  • configurable repeat value
  • moved sending to loop instead of ticker (allow more repeats, yield())

I was having trouble receiving anything with rc-switch. It worked for some time, but then suddenly stopped and I could no longer see data. Even with rc-switch ReceiveDemo example :/ Sending worked ok.
One last thing is to test with Sonoff...

@iprak
Copy link
Contributor

iprak commented Apr 14, 2019

The new changes work as intended.

Is configuring the Rx/Tx pins from WebUI really useful? I mean it can be useful when prototyping but pin configuration would probably need a new image.

"Repeats" value is only relevant for RFBridge, right? It is always 1 for RFB_DIRECT.

@mcspr
Copy link
Collaborator Author

mcspr commented Apr 15, 2019 via email

@iprak
Copy link
Contributor

iprak commented Apr 15, 2019

I see what you were referring to; I was referring to the times setting on message which put it back on the queue > 1. I am using an 315Mhz external tx/rx and it works fine. My switch is a bit weird though and based on some suggestions ended up using a special version of RCSwitch (https://github.com/Martin-Laclaustra/rc-switch.git#protocollessreceiver).

@mcspr
Copy link
Collaborator Author

mcspr commented Apr 16, 2019

Right. This was added here:
#913
ab175de#diff-33b53c8048ea432beaa4729de07e48b8R212
I assume a bunch of delayMicroseconds calls to switch GPIO on and off will trigger software watchdog if timings are large enough:
https://github.com/sui77/rc-switch/blob/a9da9c36820b02fc5613dfe2437e1187bcf5b402/RCSwitch.cpp#L523-L533

Unspecified, it defaults to 10:
https://github.com/sui77/rc-switch/blob/a9da9c36820b02fc5613dfe2437e1187bcf5b402/RCSwitch.cpp#L104

Or it can be a separate option altogether.

@mcspr mcspr added this to the 1.13.6 milestone May 6, 2019
@mcspr mcspr merged commit 193cebd into xoseperez:dev May 8, 2019
@mcspr mcspr deleted the rfb/remix branch June 4, 2019 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants