Espurna: Add more than 8 switches in Sonoff RF Bridge

Created on 14 Aug 2018  路  10Comments  路  Source: xoseperez/espurna

I would like to add more than 8 switches from the default prebuilt binary. I have modified the arduino.h and hardware.h to accommodate 16 switches and successfully uploaded to the RF Bridge. After the web page loads, the page is randomly not loaded properly and the RF switch capturing page is not capturing full codes of RF. What am I missing?

bug relay

Most helpful comment

OK, api module was the culprit here, it was taking a lot of memory for each extra relay. You can checkout dev branch and update the hardware.h file to support 16 relays without issue. From them on other memory issues arise with the web support.

All 10 comments

Apparently, increasing the number of switches have a big impact on available memory. I'm trying to find the reason.

OK, api module was the culprit here, it was taking a lot of memory for each extra relay. You can checkout dev branch and update the hardware.h file to support 16 relays without issue. From them on other memory issues arise with the web support.

I was looking for this feature. Any idea when this will be available in builds? Thanks!

With next release. By the end of August, I guess.

The new firmware can be upgraded via web page of existing firmware?.
And will there be an option to change the no. of switches in admin page?

Yes, it can be upgraded from the web UI and yes, there will be (not yet but soon) the option to change the number of switches from the web UI.

While changing DUMMY_RELAY_COUNT in custom.h makes additional 8 relays available in the UI, only the first 8 are submitted to home assistant for auto-discovery.

I also noticed, that the newly added additional 8 relays would have a garbage 1DE200F002E41C45E8 entry pre-populated in the "Switch OFF" fields for relays 8 to 15.

Should I open new issues for these 2 and reference back to this?

@peterhoeg For rfbridge see https://github.com/xoseperez/espurna/issues/1308.
Hass issue is different, but close. One theory is it might lose the data in transport (network stack drops it), requiring some delay for it to go through.

Yeah, #1308 is the same issue behind peterhoeg's problem, but it seems like in his case the data comes from uninitialized memory (hence why it is "garbage" in his case). Possibly an index programming error somewhere, in some loop where the logic wraps around the hardcoded old limit or some such. Not sure why the issue is closed. @xoseperez could you take a look? Since this will likely manifest in potentially destructive ways (whenever a write operation occurs it's going to be out of bounds too, thrashing whatever is there most likely).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BakaOsaka picture BakaOsaka  路  10Comments

HugoMSMartins picture HugoMSMartins  路  10Comments

germaguire picture germaguire  路  7Comments

MariusLaurinaitis picture MariusLaurinaitis  路  9Comments

fernando-p-jesus picture fernando-p-jesus  路  6Comments