Problems receiving raw rf signal

Hello everyone, I am making an RF transmitter and receiver with esphome and I am not able to receive the transmited code in raw format.

For testing, on my transmitter I have two buttons, one to transmit a specific code with ‘protocol’ and another button where the same code is sent but in raw format.

esphome:
  name: esphome-web-d12d48
  friendly_name: D1 Mini ESP32

esp32:
  board: esp32dev
  framework:
    type: arduino

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

remote_transmitter:
  pin: GPIO21
  carrier_duty_percent: 100%

button:
  - platform: template
    name: RF code with protocol
    on_press:
      - remote_transmitter.transmit_rc_switch_raw:
          code: '101111111111'
          protocol: 
            inverted: True
            pulse_length: 450
            sync: [23,1]
            zero: [1,2]
            one: [2,1]
          repeat:
            times: 8
            wait_time: 0ms  

  - platform: template
    name: RF code in raw
    on_press:
      - remote_transmitter.transmit_raw:
          code: [-10350,450,-900,450,-450,900,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450]
          repeat:
            times: 8
            wait_time: 0ms 

The code sent can be seen in this graph:

On the receiving side I have two binary sensors arranged to indicate when the code is received via protocol or via raw format

esphome:
  name: esphome-web-4950ff
  friendly_name: wemos-RF-receiver

esp8266:
  board: d1_mini

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

remote_receiver:
  pin: D1
  dump:
    - rc_switch
  tolerance: 50%
  filter: 250us
  idle: 4ms
  buffer_size: 2kb

binary_sensor:
  - platform: remote_receiver
    name: RF Button 
    rc_switch_raw:
      code: '101111111111'
      protocol:
        inverted: True
        pulse_length: 450
        sync: [23,1]
        zero: [1,2]
        one: [2,1]
    filters:
      - delayed_off: 1000ms

  - platform: remote_receiver
    name: RF Button  RAW
    raw:
      code: [-10350,450,-900,450,-450,900,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450]
    filters:
      - delayed_off: 1000ms

When I press any of the buttons on the transmitter, only the “RF Button” binary sensor is activated and never the “RF Button RAW” and I don’t understand why if the code in raw is exactly the same.

At the dump I have rc_switch because if I put raw the log output is flooded with “Received Raw” and I can’t see anything.

I need to receive the signal in raw because the code I really want to send does not correspond to any of the included protocols.

I would appreciate your help to resolve this problem. Thanks.

Did you try tinkering with idle and filter to try to clean out noise from the “raw” logs?

If both the transmitting and recieving devices are esps you could also try connecting the transmit and recieving pins directly with a Dupont - the codes go over the wire and you’ll get no noise. I think. Might need a shared GND.

You could also double check all your grounds and connections. I sometimes even try another esp if it’s easy enough - I’ve found hardware quality can impact this component.

Did you try tinkering with idle and filter to try to clean out noise from the “raw” logs?

Can you tell me how I can clean the raw logs of noise? Are you referring to a hardware or software solution?

I am using this cheap and usual receiver:

In any case, it seemed like a very good idea to join the transmission and reception pins of both ESP’s. I repeated the test of pressing the two buttons on the transmitter and as before only the binary_sensor “RF Button” is activated and not the “RF Button RAW”.

Could you send me a small example of receiving a raw signal. Maybe I have something wrong with my programming.

Thanks.

Have you tried setting up the receiver without all the extra configurations set? You might be accidentally filtering the RAW signal out.

Is there a reason for all the specific values you set? Its really best to get the device working first and then changing configuration settings. When you change all these configs first, it makes troubleshooting more difficult. Now you have more possibilities for the cause of the problem.

Start with a minimal config and leave the defaults as is for remote_receiver and verify you didnt filter out your signal. The default filter is 50us and you changed it to 250us, idle time is 10ms and you significantly changed that setting, which by the way filters out rf codes it will accept. You slashed the 10kb default buffer size to only 2kb.

All these changes you made, they are significantly reducing what it will accept as a valid signal. I suspect this is your problem.

1 Like

I really am curious about these config values you set. They are all optional and all have defaults set already. You normally dont need to change defaults unless you have a specific reason and have a specific change you need to make. What was the rationale for that and why did you change them so significantly before you even had the receiver working properly? You arent reciecing RAW codes and still you significantly reduced what it will accept as a recieved code.

Please dont say you just copied it off some random internet post!!!

I mean tinkering with the idle and filter settings in your config ^^^^ . See docs for details.

I read a few bad things about these cheapies and decided to spend a little more on better ones. They have been rock solid. I also swapped to a good ESP32 when I was having a few issues. This was my experience about “good hardware may matter”. You can see the settings which work for me there in my config along with recieving codes (no raw codes though I’m afraid).

In the logs of your transmitting device, can you see the code being transmitted? You (may) need to increasing logging level to see more details. I.e you should try to confirm if the raw code is being sent ok, before checking if it is being recieved.

You could also try increasing your wait_time.

Thank you very much @Fallingaway24 and @Mahko_Mahko for your answers that have made me think about the receiver configuration parameters. I have taken these values from the esphome website:
https://esphome.io/components/remote_transmitter#remote-setting-up-rf

In any case, I have been modifying the values ​​of filter, idle and buffer_size without achieving any improvement. I remember that on the receiving side there is a wemos d1.

remote_receiver:
  pin: D1
  dump:
    - rc_switch
  tolerance: 50%
  filter: 50us
  idle: 10ms
  buffer_size: 5kb

@Mahko_Mahko in the logs of my transmitting device I can see the code being transmitted, and the “RF Button” (binary_sensor) on the receiver is activated but not the “RF Button RAW” (binary_sensor).

By doing many tests, I have only managed to activate the reception of the code in RAW when I have eliminated the first value of the code in this way:

  - platform: remote_receiver
    name: RF Boton custom RAW
    raw:
      code: [-10350,450,-900,450,-450,900,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450]
    filters:
      - delayed_off: 1000ms

That is, eliminating the value “-10350”

  - platform: remote_receiver
    name: RF Boton custom RAW
    raw:
      code: [450,-900,450,-450,900,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450,-900,450]
    filters:
      - delayed_off: 1000ms

and the truth is that I don’t understand it because the first pair of values ​​(-10350,450) corresponds to the sync bit. After the synchronization bit come the 12 data bits.

I reiterate thank you very much for your help

I saw that that example you used after the fact. Those values dont match with what the defaults are so who knows what the deal is. It could just be for just showing an example or it could have been a config from an esp8266 as it uses lower defaults.

I did do a little investigating and in the docs it does mention this possibility with using RAW codes. It mentioned the wait_time can cause issues and the repeat times can make a difference. I cant find it now but, i saw somewhere that repeat times for using RAW codes is recommended to be 10 times. Maybe try that and play around with the delay time.

Other posts ive read, people have mentioned an improvement from using an esp32 for the receiver too. Might be worth trying if you have one laying around.

I didnt notice you are using 2 different boards too. Try swapping them so the receiver is the esp32. I have no evidence to support this claim but you might be better off using the same boards for transmitter and receiver

You can also have a go at inverting your pins in the pin schema.

remote_receiver:
  pin:
    number: XXXXX
    inverted: True
  dump: raw

Not sure if you should try it on one or both sides (transmit / receive) .

Possibly the device you learnt the codes on should have the pin inverted…