libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
395 stars 58 forks source link

Remote transmitter/receiver component support #69

Closed i2r closed 1 year ago

i2r commented 1 year ago

Hi. Thank you for great work.

Trying to compile firmware for bk7231.

Adding component:

remote_transmitter:
  pin: D7
  carrier_duty_percent: 50%

Causes compiling error:

undefined reference to 'vtable for esphome::remote_transmitter::RemoteTransmitterComponent'
dbuezas commented 1 year ago

a couple of milliseconds

a couple of ms would be quite ok, but the signal you are sending is over 200ms... Anyway, as I said before, it should be able to recover from that just fine actually.

dbuezas commented 1 year ago

Can you share how the new screenshots look like? I'd like to see how much more accurate it becomes

samneirinck commented 1 year ago

Can you share how the new screenshots look like? I'd like to see how much more accurate it becomes

Unfortunately I only have a single device with both a receiver and a transmitter, maybe @i2r can test out the above and report back.

dbuezas commented 1 year ago

Oh, I think it would be wise to try re-adding the feed_wdt calls. Failling to feed the watchdog for too long will reboot the cpu, that's way worse than losing some packets

i2r commented 1 year ago

But I will check with transmitting by esp32s2 and receipting with bk7231.

Receiver is broken too. Sending signals with ESP32, receiving with bk7231. Re-added the feed_wdt calls.

remote_receiver:
  pin:
    number: P8
    inverted: true
  buffer_size: 1kB
  idle: 500ms
  dump: raw

Test signal with 10 repeats: newplot-7

Real signal (projector volume up, short): newplot-8

i2r commented 1 year ago

@dbuezas the signal is correct with your tweaks!

Receiver is disabled. Re-added the feed_wdt calls.

Test signal with 10 repeats newplot-9

Real signal (projector volume up, short) newplot-10

Real signal (AC, long) newplot-11

dbuezas commented 1 year ago

Oh, interesting, the receiver is affected too? I'm not sure I got you right: Does the transmitter also works when the wdt is fed (as long as interrupts are disabled)?

i2r commented 1 year ago

Does the transmitter also works when the wdt is fed (as long as interrupts are disabled)?

Yes. Right. Transmitter works when the wdt is fed as long as interrupts are disabled.

samneirinck commented 1 year ago

Created a PR @ https://github.com/kuba2k2/libretuya-esphome/pull/6, so at least it doesn't just live on one of our machines.

kuba2k2 commented 1 year ago

This got closed along with the PR that I merged... thanks to @samneirinck the remote transmitter/receiver should work now :smile: If someone confirms that's the case, I'll close this issue.

catalin2402 commented 1 year ago

Confirm, tested both receiver/transmitter

olivluca commented 1 month ago

The receiver is not working here. I reported this bug in the esphome repository.

olivluca commented 1 month ago

Fix here