Sonoff rf bridge and portisch firmware upgrade

3,694 views
Skip to first unread message

Greg from Oz

unread,
Sep 17, 2018, 2:30:42 AM9/17/18
to SonoffUsers
Hi,
I have upgraded the firmware for the rf chip on the rf bridge and that seems to work.
I can sniff the rf signals and they show upon the console.
I am trying to get some old X10 sensors to register on the rf bridge so I can control other sonoff devices.
I am not sure what to do next. I have read lots about this but I am not familiar with bits and times and hex codes etc so it doesn't mean much to me. 
As far as I can tell I need to include my new codes and recompile the firmware and put that version on the fr bridge.
Has anyone done this before?
I have downloaded the Silicon labs Simplicity Studio 4 but have no idea how to drive it. Not only that if I did know how to use it I wouldn't know what to add to the source code anyway.
Below is a sample of what I have seen on the console:
I get information when pressing the X10 remotes:
05:51:07 MQT: stat/sonoff/RESULT = {"RfRaw":"ON"}
05:51:07 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AAA055"}}
05:51:11 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 2350 118A 023E 068B 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55"}}
05:51:16 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 235A 118A 0238 0692 9C36 01222323222222222223222223232323232222222322222222232323222323232324 55"}}
05:51:18 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 235A 118A 024C 067C 9C36 01222323222222222223222223232323232222232322222222232322222323232324 55"}}
05:51:22 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 235A 1180 0238 068E 9C36 01222323222222222223222223232323232222222322222222232323222323232324 55"}}
05:51:26 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55"}}

Can anyone tell me how all of this is supposed to work?
Do I have the right idea?

Thanks

GS

unread,
Sep 17, 2018, 3:50:16 AM9/17/18
to SonoffUsers
I do also have a tasmotized SonOff RF bridge and try to understand it. In particular, what do I need to do to send the same "string" that I received from door-bell switch in order to activate the door-bell but now by tasmota

Greg from Oz

unread,
Sep 17, 2018, 3:54:32 AM9/17/18
to SonoffUsers
I am not sure if the rf-bridge can send. That's another thing I am unsure of.
There must be someone out there that understands this stuff.
I thought I was on a winner but now I am confused about how it is supposed to function.
At least I know now that I am not the only one pondering on what to do next.

GS

unread,
Sep 17, 2018, 4:19:01 AM9/17/18
to SonoffUsers
There are two antennas, sure it can send. Must be. And yes we need people that understand this all.

Greg from Oz

unread,
Sep 17, 2018, 5:14:13 AM9/17/18
to SonoffUsers
One antenna for rf one for WIFI?

Phil

unread,
Sep 17, 2018, 5:52:01 AM9/17/18
to SonoffUsers
Shooting blind with you here guys but assuming you issued  a RFRaw 1 command to turn on Portisch firmware support and messages.. that would explain #1 entry listed.
 then for example
 
05:51:26 MQT: tele/sonoff/RESULT = {"RfRaw":{"Data":"AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55"}}
 would indicate :"AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55" is the signal recieved, 

SO... what does entering :
 rfdata "AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55"
or 
 rfdata AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55
in the console result in??

Glenn Chapman

unread,
Sep 17, 2018, 6:01:05 AM9/17/18
to SonoffUsers
Hi Greg,

Can you explain what you're trying to achieve a little more please?

If you're saying, once x RF code is received on the bridge do y, then you need to think around how to get an RF signal "converted" to an MQTT message in Node Red.  The RF Bridge doesn't have to send on an RF signal in this instance, although it can store an send on up to 16. In reality, if you think a little out of the box you can just register and change the flow to turn on a sonoff light or change a TV channel, etc.

Glenn

Phil

unread,
Sep 17, 2018, 6:01:39 AM9/17/18
to SonoffUsers
sorry hit post prematurely..

what is:   "AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55" ?


looks like it could be in 4 parts????
the "AA B1 05" prefix is certainly hexidecimal.  
2350 1194 023D 068C 9C40
could also be hex, but its formatted slightly differently???

Then there is the 
 01222323222222222223222223232323232222232322222222232322222323232324


and the 55 ???


whats ?  01222323222222222223222223232323232222232322222222232322222323232324 in hex??  

well that is how i would start......

Phil

unread,
Sep 17, 2018, 6:08:02 AM9/17/18
to SonoffUsers
typo..

SO... what does entering :
 rfdata "AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55"
or 
 rfdata AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55
in the console result in??

RFRaw  Not RFdata ..  

ive not installed that upgrade yet so cant check/test this end..)

Greg from Oz

unread,
Sep 17, 2018, 6:34:03 AM9/17/18
to SonoffUsers
If I press the X10 remote control I DON'T see anything on the console screen of the bridge.
If I set the bridge to rfraw 177 and press the remote I see the output like I posted earlier.
What I want to be able to do is make the X10 remote show output on the rf bridge when in "normal" mode, IE like a remote that works with the bridge out of the box.
If I could that then I can use node-red etc to be able to send mqtt commands when the bridge sees an X10 command.
Hope that makes sense.
But I think because the protocol is an unknown it does't show uo when in :normal" mode.
The bit I don't understand is how to get it into the protocols.h in the compile.

Greg from Oz

unread,
Sep 17, 2018, 6:36:26 AM9/17/18
to SonoffUsers
Yes I tried all that before.
Nothing happens.
I even changed the B1 to B0 as it looked like it might be a send command in one of the web pages I was looking at.

Greg from Oz

unread,
Sep 17, 2018, 6:37:53 AM9/17/18
to SonoffUsers
BTW rfraw 166 doesn't show anything.


On Monday, 17 September 2018 20:08:02 UTC+10, Phil wrote:

Greg from Oz

unread,
Sep 17, 2018, 6:39:54 AM9/17/18
to SonoffUsers
Somehow the data has to be converted into this format:
11:38:16 MQT: tele/sonoff/RESULT = {"RfReceived":{"Sync":9740,"Low":290,"High":920,"Data":"D578AD","RfKey":"None"}}
instead of:
AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55

And that's the bit I don't understand on how to do that.

Greg from Oz

unread,
Sep 17, 2018, 6:45:39 AM9/17/18
to SonoffUsers
Also a "normal" remote makes the red light on the rf bridge light up when pressed.
It doesn't light up when the X10 remote is used and that is the problem.


On Monday, 17 September 2018 20:08:02 UTC+10, Phil wrote:

Glenn Chapman

unread,
Sep 17, 2018, 7:02:00 AM9/17/18
to SonoffUsers
I have had a bunch of remotes and some can be read by the RF Bridge and others can't.  It might be that the portische firmware picks the signal up, but only in raw format.  Is there no way you can use the unique "AA B1 05 2350 1194 023D 068C 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55" in node red to enact an MQTT action?

Greg from Oz

unread,
Sep 17, 2018, 7:08:54 AM9/17/18
to SonoffUsers
No I can't extract the really long code as I can only see that in rfraw 177 mode (sniffer), so if I left it in that mode then nothing else would work as it is not in the "normal" mode where the remotes that work with it would still work.
That is what the issue is. I need the X10 remote control to "show up" when the bridge is running in its usual mode.

Greg from Oz

unread,
Sep 17, 2018, 7:12:10 AM9/17/18
to SonoffUsers
I have looked at this as well and used the python code that is on the page and I still don't understand it:

Glenn Chapman

unread,
Sep 17, 2018, 8:03:20 AM9/17/18
to SonoffUsers

Phil

unread,
Sep 17, 2018, 11:08:08 AM9/17/18
to SonoffUsers
Not exactly a walk in the park is it?? I got lost in a cycle chasing the explanation of bit buckets got there tho ;)  Im regretting jumping in prematurely now..

but if i get it IF the 1st message and the one used above for illustration is a good candidate?? 


Getting the Len and repeats values from the running python script and providing it the console output string for the response

0xAA: sync start
0xB1: command
0x??: len command
0x05: bucket count
0x??: repeats
2350 118A 023E 068B 9C40 : buckets 0
01222323222222222223222223232323232222232322222222232322222323232324 :data
0x55: sync end

So
 AA B1 <Insert your len here> 05 <insert your repeats here> 2350 118A 023E 068B 9C40 01222323222222222223222223232323232222232322222222232322222323232324 55




could be the sort of format to enter in the raw mode?  

If it works  probably wont unless you get a lot of the same signals when you press the same button repeatedly.?? 

 BUt i too am somewhat stumped as to how this will help once your out of the raw mode?

GS

unread,
Sep 18, 2018, 8:05:16 AM9/18/18
to SonoffUsers
one for sending (transmit) other for receiving, i guess

Piotr Antczak

unread,
Sep 18, 2018, 8:37:02 AM9/18/18
to SonoffUsers
try 'rfraw 0' command. It will back settings to default messages

Greg from Oz

unread,
Sep 21, 2018, 7:15:53 AM9/21/18
to SonoffUsers
I have made a bit more progress and CAN turn my X10 device lights on and off using the sonoff rf-bridge. Finally!

To get the codes for turning on and off for the rf-bridge you have to do this:
Flash the rf-bridge with the the portisch firmware.
Open web browser and go to the IP of the rf bridge.
Open the console in the web browser
type rfraw 255
you should get tele/sonoff/RESULT = {"RfRaw":{"Data":"AA0055"}}
which means you have the firmware flashed correctly.
Type rfraw 177 (in my case this is what I used)
Then press the remote control button of the X10 remote a few times and find codes that are similar.
for example:
{"RfRaw":{"Data":"AA B1 05 236E 1176 021A 06B0 9C36 01222323222223222223222223232223232222232222222222232322232323232324 55"}}

Then type rfraw 0 to turn off the sniffer.

Then run the BitBucketConverter.py program and add the parameter of the sniffed data and add a 1 to the end for the repeat number.

My python version is:
python -V
Python 2.7.15rc1

python BitBucketConverter.py "AA B1 05 236E 1176 021A 06B0 9C36 01222323222223222223222223232223232222232222222222232322232323232324 55" 1

You should get a result like this:

RfRaw AAB02E0501236E1176021A06B09C360122232322222322222322222323222323222223222222222223232223232323232455

I paste the above result in the console and it turns on or off the light depending on what button I have pressed.

Attached is the script I used.

Now all I have to is figure out how I can get the codes to show up on the console when not in the sniffer mode so I can use mqtt etc. 

That's one small step more step for mankind...one giant leap for me.
BitBucketConverter.py

Ron Linder

unread,
Jun 11, 2019, 9:43:28 AM6/11/19
to sonof...@googlegroups.com
Hi there,

Been trying to get this working but can't figure the BitBucketConverter.py.

I used your file but got: 

C:\Users\User\Downloads>python BitBucketConverter.py "AA B1 04 0212 006E 00BE 132E 01202001200101200120010120010120012010202001202023 55" 1
Traceback (most recent call last):
 
File "BitBucketConverter.py", line 56, in <module>
    main
(szInpStr, repVal)
 
File "BitBucketConverter.py", line 44, in main
    strHex
= "%0.2X" % iLength
TypeError: %X format: an integer is required, not float

I've attached all the codes I got with rfraw 177, I pressed several times the same button, but now how do I pick a code for that button since they are all different...

I'm using the latest sonoff tasmota firmware and portisch. Using BitBucketConverter.py on Windows10 with Python 3.6
RF Codes.txt

Greg from Oz

unread,
Jun 12, 2019, 3:00:11 AM6/12/19
to SonoffUsers
You are getting the errors because you are using python3

type python -V and see what version you are using

Try:
python2 BitBucketConverter.py "AA B1 05 236E 1176 021A 06B0 9C36 01222323222223222223222223232223232222232222222222232322232323232324 55" 1

Assuming you have ptyhon 2.7 installed as well.

Ron Linder

unread,
Jun 12, 2019, 10:48:22 AM6/12/19
to SonoffUsers
I got it to work however every single code I tried did not work. I can't seem to control my RF device...

Greg from Oz

unread,
Jun 12, 2019, 8:34:37 PM6/12/19
to SonoffUsers
What I had to do was go through all the codes that were generated when pressing the remote button whilst in sniffer mode and then find ones that appear to be close in similarity.
EG in your codes this seems to be close:
{"RfRaw":{"Data":"AA B1 03 01C2 0500 34E4 01100110011001100110101010101010101010100101010102 55"}}

Which should convert to:

RfRaw AAB021030101C2050034E40110011001100110011010101010101010101010010101010255

Then I send it via mqtt to this topic cmnd/portisch/Backlog

RfRaw AAB021030101C2050034E40110011001100110011010101010101010101010010101010255; RfRaw 0


If you are testing then you just send it from the console.
RfRaw AAB021030101C2050034E40110011001100110011010101010101010101010010101010255


When I did all this I used 6.21 and the portish version that was in the source code of that tasmota version under the tools/fw_efm8bb1
Firmware 6.2.1 and portisch firmware that came with it dated 20180320 and file size 17.8kb seem to work the best.

NOTE: If you are testing then POWER OFF the RF-bridge as the portisch does just stop working. RESTARTING PORTISH DOES NOT work you have to power it off.
I have the portish on a sonoff device so I can drop the power using the sonoff device if it stops working.

So everything you are trying may be working but you just have to turn off the power to the portisch. That is what i have found.
It might be worth turning the power off every time you try something as it might just work!

Good luck...it took me AGES to get the hang of this. I use it to control my ceiling fan.

https://www.youtube.com/watch?v=9G1kKoTeY3w

I use openhab and have the ceiling fan controls in that now as well as node red which I don't use that much now because the openhab
phone app and web interfaces are better and more configurable.

Ron Linder

unread,
Jun 13, 2019, 7:21:28 PM6/13/19
to SonoffUsers
Well I did exactly what you said and I get nothing. Trying to control a Pool RF RGB LED light...maybe they can't be controlled via Sonoff Bridge. I have the Sonoff Bridge V2 which I soldered the 2 wires like mentioned on several sites. Anyhow will keep trying and see if I get somewhere eventually.

Thanks for your help!
Message has been deleted

Ron Linder

unread,
Jun 14, 2019, 11:21:13 AM6/14/19
to SonoffUsers
What do you mean by

NOTE: If you are testing then POWER OFF the RF-bridge as the portisch does just stop working. RESTARTING PORTISH DOES NOT work you have to power it off.
I have the portish on a sonoff device so I can drop the power using the sonoff device if it stops working.

How do I power it off? ON the board the on/off switch or just removing the power cable?

Here is the hardware I'm using:

Remote #1 (for pool RGB lights)2019-06-14_9-44-53.png




Remote #2 (for projector curtain)

20190614_093459.jpg



My Sonoff Bridge:


20190614_093435.jpg

20190614_093452.jpg

Greg from Oz

unread,
Jun 14, 2019, 8:59:38 PM6/14/19
to SonoffUsers
What I mean by powering it off is II had to pull the power from the device. Just restarting it didn't work.
The way I do it is I have a sonoff basic on the power that the rf-bridge uses and I just turn the sonoff basic on and off and that drops the power to thr bridge.

Why do you have soldered wires on the back of the bridge? You don't need them. I don't have them. I just hold wires to thos connections when flashing and then remove them.

Message has been deleted

Greg from Oz

unread,
Jun 14, 2019, 11:26:48 PM6/14/19
to sonof...@googlegroups.com
Have done some testing .

This is from 6.21 version and I pressed the remote button:
04:11:01 RSL: Group 0, Index 1, Command RFRAW, Data 177
04:11:01 MQT: stat/portisch/RESULT = {"RfRaw":"ON"}
04:11:01 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AAA055"}}
04:11:23 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 0172 02B2 2C4C 00101010101101010101010012 55"}}
04:11:23 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 015E 0294 2C56 00101010101101010101010012 55"}}
04:11:23 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 0140 0280 2C74 00101010101101010101010012 55"}}
04:11:23 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 015E 029E 2C6A 00101010101101010101010012 55"}}

This is 6.5 version and the same button press (I had both versions running at the same time)
13:11:14 CMD: rfraw 177
13:11:15 MQT: stat/portisch/RESULT = {"RfRaw":"ON"}
13:11:15 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AAA055"}}
13:11:20 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 015E 02A8 2C92 00101010101101010101010012 55"}}
13:11:20 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 014A 028A 2C92 00101010101101010101010012 55"}}
13:11:22 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 0168 02A8 2C92 00101010101101010101010012 55"}}
13:11:22 MQT: tele/portisch/RESULT = {"RfRaw":{"Data":"AA B1 03 0172 029E 2C92 00101010101101010101010012 55"}}

Notice the 2 outputs are NOT the same!

I have done even more testing and the original BitBucket converter program doesn't seem to work. If I use another version I have it works on both 6.5 and 6.21.

python BitBucketConverter.py2 -i "AA B1 03 0168 029E 2C60 00101010101101010101010012 55"

'RfRaw AAB01503140168029E2C600010101010110101010101001255'


'AA A8 16 7F 00101010101101010101010012 0168 2C60 5e 029E 5 0  55'

I have attached the BitBucketConverter.py2 

I think it should work OK for you.

I worked for me today.
BitBucketConverter.py2

Greg from Oz

unread,
Jun 14, 2019, 11:42:06 PM6/14/19
to SonoffUsers

Greg from Oz

unread,
Jun 15, 2019, 11:46:20 PM6/15/19
to SonoffUsers
Let me know if you get it to work.

Ron Linder

unread,
Jun 16, 2019, 9:45:16 AM6/16/19
to SonoffUsers
I gave up after numerous attempts. I'm now trying with espurna firmware, had to mod the board though.

I see that the board interact when receiving data but can't figure out if it actually sends data out. Is there a way to find if any data actually gets sent out from the rf bridge?

Thomas De Groote

unread,
Jun 16, 2019, 9:54:19 AM6/16/19
to Ron Linder, SonoffUsers
If you have a second bridge available you could use that one to monitor RF signals?

Thomas

On Sun, 16 Jun 2019 at 15:45, Ron Linder <ronl...@gmail.com> wrote:
I gave up after numerous attempts. I'm now trying with espurna firmware, had to mod the board though.

I see that the board interact when receiving data but can't figure out if it actually sends data out. Is there a way to find if any data actually gets sent out from the rf bridge?

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/60fe497c-c736-41b4-ada8-ea7dc24cad44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Greg from Oz

unread,
Jun 17, 2019, 1:47:25 PM6/17/19
to SonoffUsers
Last attempt to try.

1) remove the soldered wires.

2) make sure the small switch is set to on

3) connect the power using the USB power don't power it from the header.

4) generate the codes using the last butbucket program I attached.

5) try a different remote and a different device.

I have 3 of the sound rf bridges and they all work.

It's 4 a.m.here going back to sleep now.

The only difference between your bridge and mine is that mine are 433mhz
It should work!

Ron Linder

unread,
Jun 18, 2019, 8:46:18 AM6/18/19
to SonoffUsers
Yeah makes sense but I don't have one...


On Sunday, June 16, 2019 at 9:54:19 AM UTC-4, Thomas DG wrote:
If you have a second bridge available you could use that one to monitor RF signals?

Thomas
On Sun, 16 Jun 2019 at 15:45, Ron Linder <ronl...@gmail.com> wrote:
I gave up after numerous attempts. I'm now trying with espurna firmware, had to mod the board though.

I see that the board interact when receiving data but can't figure out if it actually sends data out. Is there a way to find if any data actually gets sent out from the rf bridge?

--
You received this message because you are subscribed to the Google Groups "SonoffUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonof...@googlegroups.com.

Ron Linder

unread,
Jun 18, 2019, 8:47:40 AM6/18/19
to SonoffUsers
I'll try once I retrace the cut I made for the Espurna direct hack. I'll revert back to Tasmota and try your config, btw which one is your last butbucket file (just to be sure I'm using the right one)?

Greg from Oz

unread,
Jun 18, 2019, 4:30:54 PM6/18/19
to SonoffUsers
It's the one that has.py2 as the file extension.

Greg from Oz

unread,
Jun 18, 2019, 4:32:30 PM6/18/19
to SonoffUsers
Use Python 2.7 not Python 3 with the converter script

Ron Linder

unread,
Jun 18, 2019, 5:09:41 PM6/18/19
to SonoffUsers
I tried it today with one of the remotes. Codes look different but still nothing.

I'm using latest Tasmota.

Greg from Oz

unread,
Jun 19, 2019, 2:25:41 AM6/19/19
to SonoffUsers
Do you have another bridge to try? Maybe there is something wrong with that one?
Like I said I have 3 and they all work.

Udo Heuzeroth

unread,
Jul 9, 2020, 5:24:05 AM7/9/20
to TasmotaUsers
Hi Greg,
after reading so many posts and giving up a few times i got my bridge working. thanks a lot for the final clue.(sending the string to backlog)
What i did was:
1. Flashing tasmota
2. changing firmware to portischs
3. sniffing the codes and shorten them to be accepted by the Bitbucket web converter
4. got my B0 codes to send to devices via MQTT
5. using Node Red to combine to different events and 
6. Tataaaaaaa. i am so happy

Udo

Greg from Oz

unread,
Jul 9, 2020, 5:38:07 AM7/9/20
to TasmotaUsers
I am so glad I helped you out as I had so much trouble getting it to work I thought I would sort of document it.
It is very confusing.
I was using node-red but now I use openhab2 and just send the code via mqtt.
sendCommand(FanCeiling2_FanCeiling2,"RfRaw AAB0150303014702872C920010101010110101010100110255; RfRaw 0")

Thanks for letting me know that it worked!
Reply all
Reply to author
Forward
0 new messages