-
Notifications
You must be signed in to change notification settings - Fork 5
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
Advanced bridge commands sniffing/bucket #11
Comments
Specifically commands 0xB0 and 0xB1 are very important for variable timing protocol. It would be greatly appreciated! And I can donate an RF bridge if you want! |
It is unlikely that I would work on this, mainly because it's uncertain how successful the effort would be. But even for the port I had to remove support for protocols/features so that code and ram memory were not over capacity. Possibly more to the point I really still do not understand how the bucket sniffing works. For decoding truly unknown radio protocols, people seem to prefer other projects: The cost of that hardware or a USB RTL SDR is probably comparable. |
You can also use the pass through firmware or hardware hack bypass along with ESPHome which supports raw decoding. |
Thank you for your effort in the development. The difficulties of developing firmware are understandable. I have tried the passthrough mode first and I was able to capture some raw data, but none of which was complete or useful as the signal was drowned in raw dumps. No matter the settings, the output was just drowned in a insane amount of data, none of which can be attributed to any of my devices. I am still trying to understand how the parameters below can be tweaked, but hours passed and no luck, and I reverted to rcswitch.hex firmware.
If there is renewed interest in pursuing bucket sniffing, please let me know. For now, i'd really like to thank you again for your efforts. |
I'm still running into issues with the Portisch port, but am looking into it again. I am not sure that the sniffing output is correct/useful because I think it's reporting 4 buckets, but there should only be 3. AA B1 04 01 9A 03 8E 00 FA 27 D8 38 18 19 29 28 19 28 19 28 19 29 29 28 18 19 28 18 18 18 18 19 28 19 28 18 55 |
I now support Portisch on this release for both white and black box Sonoffs. I do not know if the sniffing output is correct or helpful however at this time. |
I am very sorry I missed your comment. This is the tool that I use to convert "receive" to "send" commands 0xB1 and 0xB0 And glad to hear the you were successful. I will flash this right now and report back! |
The sniffing is not correctly returning all the serial data because the buffer is not large enough. In any case, I temporarily put in a hack and got this sniffing data from my door sensor: I got this output from the tool: I guess the idea is to just paste that back as a transmit command, which I did on my other unit. The data is correct for my door sensor. But let me figure out the buffer issue, otherwise you'll never receive valid sniffing data (i.e. the uart buffer will overwrite itself). |
Ok I flashed the portisch to the OBS38S003 tried a couple of things:
Question, is the rcswtich firmware in this release different that that of Jul,2nd? https://github.com/Portisch/RF-Bridge-EFM8BB1/wiki/Commands |
Ok, I'm checking into the buffers. |
Sorry for the previous confusion, please try the attached portisch for OB38S003 with 0xB0 and 0xB1 support. |
what is the advantage of using the portisch firmware over the pass-through one ? |
@mightymos Trying the main_portisch_OB38S003.zip resulted in the same 2 problems in the post above. |
This is what I receive on Sonoff with OB38S003 from -
This is what I receive on my Sonoff with EFM8BB1 running original Portisch:
These are the transmission commands I have been testing with on rcswitch and portisch (the examples are in the comments of rcswitch.c file):
It might help if we could infer what the protocol is for your device. |
Portisch supports a sniffing mode for unknown radio protocols that essentially allows replaying a previously captured sniffing. You observe the sniffing output and then convert to a 0xB0 command using this tool apparently: I do not know yet how well the sniffing mode on original portisch (or my port) works with real devices. |
This is the device that I am trying to control. The chip says 3002221 3AK C42EA. The post has more details but essentially:
This is not the issue though. The issue is that the bridge freezes after one command (send or receive). Example RCswitch firmwareSend (LED strip)
Receive (door sensor, my sensor sends the transmission 15 times)
Portisch firmwareSend (LED strip)
No confirmation okay.
and with bit bucket sniffing: it sniffs one code (with no buttons pressed) when sniffing is turned on and it freezes ESPhome 2024.10 YAML:
|
Ok @zd3sf I am looking into the freezing issue. It is possible they are correct but I think the low and high timings in your script are reversed as a result. In addition to a door sensor, I now have an outdoor light with remote that I have been able to control using 0xA5 commands. Could we focus on just the LED strips for now because I assume they are the simplest protocol as compared with the AC123 remote? I am assuming the LED strip has several buttons on an included remote, are you able to see that just a single data byte changes when different buttons are pressed? Here is the new release: |
Thank you very much!! That explains why every time the RCswitch is flashed, I have to sniff the codes and re-program the button for the LED strip in ESPHome. 0.4.3-Portisch: Freezing issue persists. ON button
OFF button
Brightness increase
Brightness decrease
Sleep
Timer clear
Timer 30m
Timer 1h
|
Ok @zd3sf most of those codes look reasonable and are possibly correctly decoded because they just change by one bit. The increase and decrease brightness codes are the same, which does not make sense, is that the true decoding or a typo? Are you able to control the LED strip using those codes with the bridge or no? |
I noticed the brightness codes, I was in a hurry and didn't check. I can confirm that I can turn the strip ON/OFF with the bridge. I don't use the other functions in home assistant so I didn't program them in. My guess they would work too. I can confirm that the door/window sensors work fine with the latest RCSwtich firmware.
On Monday, November 18, 2024 at 09:39:28 AM CST, Jonathan Armstrong ***@***.***> wrote:
Ok @zd3sf most of those codes look reasonable and are possibly correctly decoded because they just change by one bit.
The increase and decrease brightness codes are the same, which does not make sense, is that the true decoding or a typo?
Are you able to control the LED strip using those codes with the bridge or no?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@zd3sf I think I fixed the problems with 0xB0 and 0xB1 commands. As best I can tell it operates similarly to rcswitch and does return an ACK on completion (e.g. AA A0 55). |
For the LED strip, transmitting with 0xA5 worked great! no problem, no freezing. There's still a problem receiving and freezing after receiving on command. The only way to 'unfreeze' is to either send another command (beep, start sniffing, stop sniffing, transmit 0xA5). In the log below, I pushed every button multiple times but it freezes after the first received message.
|
I think I might have to try flashing esphome to reproduce. Can you post your yaml here as a git gist link or inline? EDIT: If it's similar to the yaml posted previously then no problem, I'll use that copy for now. |
Sorry stuck at work tonight. The yaml above should have the right indentation. I removed the OTA component but the rest should be functional. Let me know If it doesn't work, I'll post a proper link
|
Basically what was happening is that esphome sends an ACK back to the microcontroller after finished a command. I do not think Tasmota sends ACKs so I had not encountered the issue previously. I think I somehow broke simple transmission again, I need to look at everything again. You might want to check out my uploaded yaml, or at least add the "debug:" under your uart section so you can see raw bytes to understand what I'm talking about. And possibly enable status led. You can try this latest file but again I need to look at source code again. EDIT: OK, well maybe transmitting remains working. I'm able to receive codes with original portisch using stove range toggle. I guess use will reveal more problems or not. |
Okay this thing actually works!! It only freezes after bucket sniffing is on for 1 minute. Must unplug power to unfreeze it (rebooting the ESP8266 doesn't help). Once it freezes Receive/Transmit (RfRaw 0xA5/0xA8) doesn't work. But if bucket sniffing is not started, it keeps working fine. So I started bucket sniffing, collected all the codes for the AC123-01 (blinds), rebooted, converted everything to B0, and the bridge works sending B0 and receiving/sending 0xA4 | 0xA5 for the LED strip. so I now can control both the strip (standard) and the blinds(B0), recieve door alarms(standard)..... it doesn't freeze. As you mentioned the freezing after 1 minute bucket sniffing could be due to Portisch overflow. using this tool https://jonajona.nl/convertB1.html Blinds codes
Up:
Down:
|
ESPhome YAML for the blinds:
|
That's very good. I may have to use one of my boards to simulate sending a long byte sequence in order to eventually investigate freezing. Hopefully going forward I will primarily be making bug fixes and can test out myself but having help with real devices has been very useful. But I may try to add back in the learning mode. One thing that I have not tried much is the advanced decoding with 0xA6 so anyway just FYI. Is that B1 to B0 conversion tool different than the bbconv tool or just shows bytes versus json format? Can you test out the latest release? |
Amazing! The Portisch firmware can control both the strip (standard) and the blinds (B0), receive door alarms(standard) successfully! Bucket sniffing does not freeze anymore, its been on for 5 minutes. Note that the orange LED for the radio chip is also working correctly in this version. In the previous ones, it used to get stuck on after a transmit/receive. Now it only turns on during the actual transmit/receive time. If you're okay with it, we should pull request the documentation page for ESPhome to advertise this firmware. I also want to buy you a coffee if you have a link! |
Well that's good to hear, sounds like several successes. You could buy a coffee, but really no worries either way given that your time to test devices was valuable: |
The link is weird. I see the page, but no where to do a onetime coffee. I noticed a strange thing, after 24 hours, the latest portisch firmware stopped receiving codes from window sensors. It can still send to the LED strip and to the blinds (bit buckets). I started advanced sniffing then stopped it, then it started receiving codes again. I don't have logs but I'll keep you posted if it happens again. |
Ok, I think I needed to click through more settings. If you go back to ko-fi again I think it will work. Absolutely do try to report strange things, it will help users in the future if bugs are ironed out now. |
I am mainly bucket sniffing on my board and I think that it have stopped receiving buckets after multiple hours. I think it's not exactly 24 hours, but I am not sure. Today I got it back sniffing buckets with sending B1 again, but I will test it more in following days and let you know if it happens again. I think that one time it did the same thing and I tried to beep the board but it kept beeping too long and I just shut the board (didn't want to listen the beep too long) and I can test it too if it happens again. |
For me, bucket sniffing stops after an hour which could be from original Portisch overflow. The bug where the bridge stops receiving 0xA4 standard (but kept transmitting 0xA5 and B0) hasn't happened since. |
I had tried replaying the 0xB0 codes to simulate a remote talking to blinds using two bridges but I was not able to receive. I can also just leave my bridge in sniffing mode overnight and see what happens. I know this does not fix the bug, but in the short term would it help if I added a command to reset the microcontroller? Both microcontrollers support reset by firmware. So for example you might send a new command like this to reset processor: I might also possibly consider forcing a reset in the code if a buffer attempts to write past the buffer length. But anyway, if you can manually cause a reset it would at least remove the need to unplug and replug power? |
This version should allow forcing microcontroller reset with: I will look into the bug stuff as soon as I can test. |
Naive question, How would I send the reset command?
|
It looks like from your yaml there is rf_bridge.send_raw, so you just do that with raw: 'AAFE55' |
I am using the same firmware as earlier and it seems that something is causing some kind of overflow or something. After activating B1 I can read maybe 5 (not exactly five every time) codes or so and after that it stops. I can activate it again with B1 and it works again for maybe next five. It seems that if I call beep for 100ms it beeps so long that watchdog resets the chip. It doesn't matter if I have called B1 again or not, beeping will take too long for watchdog. But after boot, if it has not got that overflow (or whatever this is) beep is working normally. Is there some idea where this might be happening? Can it be stack overflow? I think stack overflow would mess the registers r0 etc, but I don't know if those are used for the beep delay. Or is it just some array overflow or something? I can try to get some extra data if I know what to get and if this keeps happening again. |
I have two boards that I think they have the same firmware version, but I don't actually remember what I flashed to those boards yesterday. I have been building and flashing firmwares so it might be that they are not the same version, because the other is reading B1 codes fine and the other is doing that what I wrote in previous message. |
I'm on the latest official release, the bridge beeps for 100ms as expected. Let me know what you find out about the 2 bridges |
I was away for 30 minutes and the other board is kinda doing the same thing now. It seems that activating the B1 and receiving 64 bit nexa signal is doing something there. The other board is not stopping the sniffing as soon as the other board, but it seems that even receiving the first code is messing something there as beeping after receiving just one code is causing the long beep and watchdog reset. I will try the official build next to test if it is just my build. |
It is doing the same thing with official build 0.4.4. I try to create example yaml for esphome so that you could send the same codes and try to replicate the error. |
Here is my example yaml. Nexa code sned_code can be used to send nexa code. Maybe other codes cause the same thing to happen too
|
@otsoni I think we should move this to its own separate thread. I have had bucket sniffing B1 on for 30 minutes and its still going, after a while the beeping changed in duration and pitch just like you said. So, bucket sniffing messes with beeping through an overflow or somethign. I can send raw your Nexa_send code with no problems. @mightymos I tried the new firmware, when its reset, the orange LED turns on for 1 second and the log shows :
I assume that worked? we can add this the example YAML
|
Yes, the startup blink should be a good indicator that microcontroller reset. If you submit anymore pull requests for yaml you should use secrets.yaml file: .gitignore should ignore that file name for file tracking but you could also confirm prior to submission. I will close this issue for now since Portisch port has been implemented. |
Advanced commands that Portisch firmware uses (advanced sniffing , stop advanced sniffing, bucket transmit, bucket sniffing) are not available for OB38S003. It would be great if they can be implemented because they work well with ESPhome RF bridge component
Bridge: Sonoff RF bridge 2.2 (white)
RF chip: main_rcswitch_OB38S003.hex (Jul 02)
ESP: esphome 2024.8.3
The text was updated successfully, but these errors were encountered: