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 Bridge: Add support for flashing the RF EFM8BB1 chip #2886

Closed
wants to merge 25 commits into from

Conversation

ErikAndren
Copy link

@ErikAndren ErikAndren commented Jun 1, 2018

Hi,
This isn't a pull request per se but more of a call for review / interest.

This branch allows you to flash the RF EFM8BB1 chip on the Sonoff RF Bridge, given that you connect the C2CK pin to the GPIO4 and C2K pin to GPIO5 on the board.

Update:
If you are running a 2.0 board (check PCB) then swap c2ck and c2k. Do not power the board via usb.

Firmware updates are performed the ordinary way and the software autodetects if the image is for the EFM8BB1.

Is this something that would be of use to the general Tasmota project?

Thanks,
Erik

@Jason2866
Copy link
Collaborator

Great job!
Will try soon😃

@arendst arendst added the enhancement Type - Enhancement that will be worked on label Jun 1, 2018
@Jason2866
Copy link
Collaborator

Hello @ErikAndren

i get this compile error:
Archiving .pioenvs\sonoff\lib0de\libSPI.a Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\HtmlColor.cpp.o Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\HtmlColorNameStrings.cpp.o D:/Sonoff-Tasmota-add-rf-flash-5.14/sonoff/webserver.ino: In function 'void HandleUploadLoop()': D:/Sonoff-Tasmota-add-rf-flash-5.14/sonoff/webserver.ino:1356:34: error: 'UPDATE_ERROR_BOOTSTRAP' was not declared in this scope if (Update.getError() == UPDATE_ERROR_BOOTSTRAP) { ^ Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\HtmlColorNames.cpp.o Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\HtmlColorShortNames.cpp.o Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\NeoEsp8266UartMethod.cpp.o Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\NeoGamma.cpp.o Compiling .pioenvs\sonoff\lib946\NeoPixelBus-2.2.9\internal\NeoPixelAnimator.cpp.o *** [.pioenvs\sonoff\src\sonoff.ino.cpp.o] Error 1

@ErikAndren
Copy link
Author

Ah, seems like this is dependent on what version of the esp8266 library. I've pushed a workaround for now. Is there a define that one could use to see what version of the esp8266 library that is used?

@Jason2866
Copy link
Collaborator

Jason2866 commented Jun 2, 2018

Now build is successfull. But flashing is not working.
image
Now EFM8BB1 Flash is erased/corrupted -> RFBridge doesnt receive anything now
I connected C2CK to GPIO4, C2D to GPIO5 and switch off when trying to flashing

@Jason2866
Copy link
Collaborator

Jason2866 commented Jun 2, 2018

Solved. Really heavy stuff with Hardware R2 V1.0....
Gpio 4 and 5 labeling is wrong (switched) AND GPIO 4 and 5 is connected to USB Power.
Solution was swapping cables and NOT Powering through USB Cable!
Details here:
https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack
This modification is not needed!! Just power the R2 bridge with 3.3V over pinheader!!

Now Intertechno Remote is correct decoded with Portisch firmware:
00:00:00 Project sonoff RFBridge_2 (Topic sonoff-82589D, Fallback sonoff-82589D, GroupTopic sonoffs) Version 5.14.0-2_3_0 00:00:00 WIF: Connecting to AP1 Jason_Home_WLAN in mode 11N as sonoff-82589D-6301... 00:00:09 WIF: Connected 00:00:09 HTP: Web server active on sonoff-82589D-6301 with IP address 192.168.2.127 22:58:50 MQT: Attempting connection... 22:58:50 MQT: Connected 22:58:50 MQT: tele/sonoff-82589D/LWT = Online (retained) 22:58:50 MQT: cmnd/sonoff-82589D/POWER = 22:58:50 MQT: tele/sonoff-82589D/INFO1 = {"Module":"Sonoff Bridge","Version":"5.14.0","FallbackTopic":"sonoff-82589D","GroupTopic":"sonoffs"} 22:58:50 MQT: tele/sonoff-82589D/INFO2 = {"WebServerMode":"Admin","Hostname":"sonoff-82589D-6301","IPAddress":"192.168.2.127"} 22:58:50 MQT: tele/sonoff-82589D/INFO3 = {"RestartReason":"Power on"} 22:58:58 MQT: tele/sonoff-82589D/STATE = {"Time":"2018-06-02T22:58:58","Uptime":"0T00:00:18","Vcc":3.182,"Wifi":{"AP":1,"SSId":"Jason_Home_WLAN","RSSI":100,"APMac":"00:A0:57:2A:BD:19"}} 22:59:06 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9470,"Low":310,"High":930,"Data":"150554","RfKey":"None"}} 22:59:06 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9500,"Low":310,"High":920,"Data":"15155F","RfKey":"None"}} 22:59:07 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9480,"Low":310,"High":930,"Data":"150554","RfKey":"None"}} 22:59:08 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9490,"Low":320,"High":940,"Data":"150555","RfKey":"None"}} 22:59:08 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9480,"Low":320,"High":930,"Data":"15155F","RfKey":"None"}} 22:59:10 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9460,"Low":320,"High":940,"Data":"151154","RfKey":"None"}} 22:59:10 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9490,"Low":310,"High":920,"Data":"15115F","RfKey":"None"}} 22:59:10 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9490,"Low":310,"High":920,"Data":"15155F","RfKey":"None"}} 22:59:11 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9470,"Low":310,"High":940,"Data":"151454","RfKey":"None"}} 22:59:11 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9530,"Low":290,"High":910,"Data":"15155F","RfKey":"None"}} 22:59:12 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9470,"Low":310,"High":940,"Data":"151514","RfKey":"None"}} 22:59:12 MQT: tele/sonoff-82589D/RESULT = {"RfReceived":{"Sync":9510,"Low":250,"High":860,"Data":"15155F","RfKey":"None"}}

@ErikAndren
Copy link
Author

Hmm, I have a 1.0 board and I did not need to swap cables and am powering the board via USB.

@Jason2866
Copy link
Collaborator

Jason2866 commented Jun 2, 2018

Yes, that is the difference from 1.0 to 2.0
Described here:
https://github.com/xoseperez/espurna/wiki/Hardware-Itead-Sonoff-RF-Bridge---Direct-Hack

and THX again for your great work!!

@arendst
Copy link
Owner

arendst commented Jun 3, 2018

@ErikAndren you can easily check for core version using:

#ifdef ARDUINO_ESP8266_RELEASE_2_3_0 
#endif

#ifdef ARDUINO_ESP8266_RELEASE_2_4_0
#endif

#ifdef ARDUINO_ESP8266_RELEASE_2_4_1
#endif

@arendst
Copy link
Owner

arendst commented Jun 3, 2018

Working on it. Was able to flash. No need to integrate some features....

arendst added a commit that referenced this pull request Jun 4, 2018
6.0.0a
* Add support for uploading Sonoff Bridge firmware found in
tools/fw_efm8bb1 folder build by Portisch using Web Gui File Upload
(#2886)
* Add command RfRaw to control Portisch firmware features
@arendst
Copy link
Owner

arendst commented Jun 4, 2018

Released just now

@arendst arendst added the fixed Result - The work on the issue has ended label Jun 4, 2018
@arendst arendst closed this Jun 4, 2018
curzon01 pushed a commit to curzon01/Tasmota that referenced this pull request Sep 7, 2018
6.0.0a
* Add support for uploading Sonoff Bridge firmware found in
tools/fw_efm8bb1 folder build by Portisch using Web Gui File Upload
(arendst#2886)
* Add command RfRaw to control Portisch firmware features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type - Enhancement that will be worked on fixed Result - The work on the issue has ended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants