<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help with UNIT IR and NanoC6 in Uiflow2]]></title><description><![CDATA[<p dir="auto">Hi. I usually use M5 products with esphome. I an completely novice with UIflow2 and mycropython. I would like some help using the unit IR to decode a ac remote. I followed the video example on m5docs, and I have an error.</p>
<p dir="auto">Here is the code:</p>
<pre><code>import os, sys, io
import M5
from M5 import *
from unit import IRUnit



ir_0 = None


data = None
addr = None


def ir_0_rx_event(_data, _addr, _ctrl):
  global ir_0, data, addr
  data = _data
  addr = _addr
  print(data)


def setup():
  global ir_0, data, addr

  M5.begin()
  ir_0 = IRUnit((1, 2))
  ir_0.rx_cb(ir_0_rx_event)
  data = 0
  addr = 27


def loop():
  global ir_0, data, addr
  M5.update()


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")
</code></pre>
<p dir="auto">I get error:</p>
<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 25, in &lt;module&gt;
  File "&lt;stdin&gt;", line 17, in setup
  File "unit/ir.py", line 24, in rx_cb
  File "driver/ir/nec.py", line 116, in __init__
  File "driver/ir/nec.py", line 67, in __init__
  File "driver/ir/receiver.py", line 47, in __init__
ValueError: invalid Timer number
</code></pre>
<p dir="auto">The only thing that is different from the YouTube video is instead of setting a label to print the data value I am printing it to console, could this be the problem?</p>
]]></description><link>https://community.m5stack.com/topic/7694/help-with-unit-ir-and-nanoc6-in-uiflow2</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 15:45:40 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7694.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Jul 2025 02:44:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help with UNIT IR and NanoC6 in Uiflow2 on Sun, 18 Jan 2026 06:17:42 GMT]]></title><description><![CDATA[<p dir="auto">Updating the <code>Timer()</code> was in fact the primary issue.  The code has already been updated <a href="https://github.com/peterhinch/micropython_ir/tree/master" target="_blank" rel="noopener noreferrer nofollow ugc">upstream</a> to handle this.  Importing the latest version would allow changing the timer setting.  I've created a <a href="https://github.com/m5stack/uiflow-micropython/issues/79" target="_blank" rel="noopener noreferrer nofollow ugc">bug/PR</a> for it.</p>
<p dir="auto">After resolving this, the next hurdle is that UIFlow2 currently only handles one IR protocol ("NEC").  If your systems use a different protocol, you'll have to import it from the upstream repo.  If your device uses an unsupported protocol, you'll have to hack together a raw handler as described <a href="https://github.com/peterhinch/micropython_ir/blob/master/TRANSMITTER.md#5-unsupported-protocols" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
]]></description><link>https://community.m5stack.com/post/30486</link><guid isPermaLink="true">https://community.m5stack.com/post/30486</guid><dc:creator><![CDATA[vincebusam]]></dc:creator><pubDate>Sun, 18 Jan 2026 06:17:42 GMT</pubDate></item><item><title><![CDATA[Reply to Help with UNIT IR and NanoC6 in Uiflow2 on Sat, 17 Jan 2026 15:58:26 GMT]]></title><description><![CDATA[<p dir="auto">This error stems from calling <code>Timer(-1)</code> in <a href="https://github.com/m5stack/uiflow-micropython/blob/417a5f8787da7b45c6cf8a9c7ba1905404f2c61a/m5stack/libs/driver/ir/receiver.py#L47" target="_blank" rel="noopener noreferrer nofollow ugc">reciever.py</a>.  According to <a href="https://github.com/orgs/micropython/discussions/18056" target="_blank" rel="noopener noreferrer nofollow ugc">this</a>, it's now required to send an actual timer to that function.  I've tested it with a proper timer patched in, and it runs the callback when IR is received, but I haven't gotten it to return the actual IR data yet.</p>
]]></description><link>https://community.m5stack.com/post/30485</link><guid isPermaLink="true">https://community.m5stack.com/post/30485</guid><dc:creator><![CDATA[vincebusam]]></dc:creator><pubDate>Sat, 17 Jan 2026 15:58:26 GMT</pubDate></item><item><title><![CDATA[Reply to Help with UNIT IR and NanoC6 in Uiflow2 on Tue, 12 Aug 2025 21:18:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/233805">@HybridZach</a></p>
<p dir="auto">New M5Stack user here..I encountered the same problem with a CoreS3 and getting the same "invalid timer number" error messages when trying to configure the IR Unit. The S3 was reflashed to UIFlow 2.3.3, but this did not resolve the problem.</p>
<p dir="auto">yuyun2000's helpful suggestion didn't work either as timer_id does not appear to be in the constructor for the IRUnit. Is this a more fundamental software problem?</p>
<p dir="auto">The IR Unit with UIFlow2 is completely unusable at the moment</p>
]]></description><link>https://community.m5stack.com/post/29739</link><guid isPermaLink="true">https://community.m5stack.com/post/29739</guid><dc:creator><![CDATA[Vortrax]]></dc:creator><pubDate>Tue, 12 Aug 2025 21:18:38 GMT</pubDate></item><item><title><![CDATA[Reply to Help with UNIT IR and NanoC6 in Uiflow2 on Fri, 18 Jul 2025 11:19:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/290474">@yuyun2000</a></p>
<pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 25, in &lt;module&gt;
  File "&lt;stdin&gt;", line 16, in setup
TypeError: unexpected keyword argument 'timer_id'
</code></pre>
]]></description><link>https://community.m5stack.com/post/29542</link><guid isPermaLink="true">https://community.m5stack.com/post/29542</guid><dc:creator><![CDATA[HybridZach]]></dc:creator><pubDate>Fri, 18 Jul 2025 11:19:01 GMT</pubDate></item><item><title><![CDATA[Reply to Help with UNIT IR and NanoC6 in Uiflow2 on Thu, 17 Jul 2025 09:03:13 GMT]]></title><description><![CDATA[<p dir="auto">The "invalid Timer number" error occurs because the IRUnit is trying to use a hardware timer that's either unavailable or already in use on your M5 device. ESP32-based boards have limited hardware timers (usually 4, IDs 0-3), and the default timer allocation in the IR library might conflict with other system functions.<br />
Solution:Explicitly specify a valid timer ID when initializing the IRUnit. Modify your setup code to include the timer_id parameter with a value between 0-3:<br />
ir_0 = IRUnit((1, 2), timer_id=1)  # Try timer IDs 0, 1, 2, or 3</p>
<p dir="auto">Troubleshooting Tips:</p>
<p dir="auto">Test different timer IDs (0-3) if the first attempt fails<br />
Ensure no other libraries/features are using the same timer (e.g., PWM, other sensors)<br />
Verify your M5 device's firmware is up-to-date via UIFlow2</p>
<p dir="auto"><a href="https://chat.m5stack.com/" target="_blank" rel="noopener noreferrer nofollow ugc">https://chat.m5stack.com/</a></p>
]]></description><link>https://community.m5stack.com/post/29525</link><guid isPermaLink="true">https://community.m5stack.com/post/29525</guid><dc:creator><![CDATA[yuyun2000]]></dc:creator><pubDate>Thu, 17 Jul 2025 09:03:13 GMT</pubDate></item></channel></rss>