peterhinch / micropython_remote

Capture and replay 433MHz remote control codes. Control remote switched power adaptors.
MIT License
70 stars 11 forks source link

Transmit fails on ESP32 #5

Closed marcso-bdrck closed 3 years ago

marcso-bdrck commented 3 years ago

transmit(key) returns the following error with micropython esp32-20210825-unstable-v1.16-237-g996f70316:

Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
  File "tx/__init__.py", line 96, in __call__
TypeError: function doesn't take keyword arguments

Line 96 is: self._rmt.write_pulses(lst * self._reps, start = 1) # Active high

The implementation of ports/esp32/esp32_rmt.c has changed in July. As far as I understand the source, kw_args 'start' is no more.

peterhinch commented 3 years ago

Thank you for the report, you are correct about the reason. I will review my use of RMT and push a fix later today. From an initial look at the docs it should be OK to do:

self._rmt.write_pulses(lst * self._reps)

as the default is high. But I guess this will require users to run a daily build of firmware.

peterhinch commented 3 years ago

Updated and tested against current firmware. I've pushed an update. There is a warning in the docs to use new firmware as my reading of the git history suggests this release will fail if run against old builds.