<?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[Core S3 m5ui&#x2F;port.py callback error]]></title><description><![CDATA[<p dir="auto">I'm not sure whether anyone else is having this issue but my Core S3 keeps saying:</p>
<pre><code>Traceback (most recent call last):
  File "m5ui/port.py", line 40, in timer_cb
KeyboardInterrupt:
</code></pre>
<p dir="auto">I have tried python code on UIFlow 2 and blocks in UIFlow 2 but neither seem to work. It seems that with no blocks in the loop the Core S3 works fine but with a loop block and something inside it then it just crashes with that error.</p>
<pre><code>import os, sys, io
import M5
from M5 import *
import m5ui
import lvgl as lv
from unit import GPSV11Unit



TimeburnerxJB8_20px = None
TimeburnerBold_peGR_70px = None
page0 = None
image0 = None
timelabel = None
battlabel = None
label0 = None
label1 = None
label2 = None
image1 = None
label3 = None
label4 = None
gpssma_0 = None


date1 = None
spd = None


def setup():
  global TimeburnerxJB8_20px, TimeburnerBold_peGR_70px, page0, image0, timelabel, battlabel, label0, label1, label2, image1, label3, label4, gpssma_0, date1, spd

  M5.begin()
  Widgets.setRotation(1)
  m5ui.init()
  TimeburnerxJB8_20px = lv.binfont_create("S:/flash/res/font/TimeburnerxJB8-20px.bin")
  TimeburnerBold_peGR_70px = lv.binfont_create("S:/flash/res/font/TimeburnerBold-peGR-70px.bin")
  page0 = m5ui.M5Page(bg_c=0x000000)
  image0 = m5ui.M5Image("/flash/res/img/GPS.png", x=257, y=0, rotation=0, scale_x=0.6, scale_y=0.6, parent=page0)
  timelabel = m5ui.M5Label("00:00", x=277, y=0, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=lv.font_montserrat_14, parent=page0)
  battlabel = m5ui.M5Label("100%", x=0, y=0, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=lv.font_montserrat_14, parent=page0)
  label0 = m5ui.M5Label("100", x=0, y=79, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=TimeburnerBold_peGR_70px, parent=page0)
  label1 = m5ui.M5Label("mph", x=110, y=120, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=TimeburnerxJB8_20px, parent=page0)
  label2 = m5ui.M5Label("10000m", x=72, y=159, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=TimeburnerBold_peGR_70px, parent=page0)
  image1 = m5ui.M5Image("/flash/res/img/satellite.png", x=235, y=2, rotation=0, scale_x=0.6, scale_y=0.6, parent=page0)
  label3 = m5ui.M5Label("HDG:", x=140, y=45, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=lv.font_montserrat_14, parent=page0)
  label4 = m5ui.M5Label("360", x=188, y=40, text_c=0xffffff, bg_c=0xffffff, bg_opa=0, font=TimeburnerBold_peGR_70px, parent=page0)

  gpssma_0 = GPSV11Unit(2, port=(18, 17))
  page0.screen_load()
  gpssma_0.set_work_mode(7)
  gpssma_0.set_time_zone(0)


def loop():
  global TimeburnerxJB8_20px, TimeburnerBold_peGR_70px, page0, image0, timelabel, battlabel, label0, label1, label2, image1, label3, label4, gpssma_0, date1, spd
  M5.update()
  date1 = []
  date1 = gpssma_0.get_gps_time()
  timelabel.set_text(str((str((date1[0])) + str(((str(':') + str((date1[1]))))))))
  timelabel.align_to(page0, lv.ALIGN.TOP_RIGHT, 0, 0)
  if (gpssma_0.get_satellite_num()) == 0:
    image0.set_flag(lv.obj.FLAG.HIDDEN, False)
    image1.set_flag(lv.obj.FLAG.HIDDEN, True)
  else:
    image1.set_flag(lv.obj.FLAG.HIDDEN, False)
    image0.set_flag(lv.obj.FLAG.HIDDEN, True)
  label2.set_text(str(gpssma_0.get_altitude()))
  label2.align_to(page0, lv.ALIGN.BOTTOM_RIGHT, 0, 0)
  spd = int(gpssma_0.get_speed_over_ground())
  spd = spd * 1.151
  label0.set_text(str(str(spd)))
  label0.align_to(page0, lv.ALIGN.LEFT_MID, 0, 0)
  battlabel.set_text(str((str((str((Power.getBatteryLevel())))) + str('%'))))
  battlabel.align_to(page0, lv.ALIGN.TOP_LEFT, 0, 0)
  label4.set_text(str(gpssma_0.get_corse_over_ground()))


if __name__ == '__main__':
  try:
    setup()
    while True:
      loop()
  except (Exception, KeyboardInterrupt) as e:
    try:
      m5ui.deinit()
      from utility import print_error_msg
      print_error_msg(e)
    except ImportError:
      print("please update to latest firmware")

</code></pre>
<p dir="auto">That was the code that hasn't worked.<br />
Any help much appreciated,<br />
RPi</p>
]]></description><link>https://community.m5stack.com/topic/7988/core-s3-m5ui-port-py-callback-error</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 00:36:50 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7988.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Jan 2026 09:45:24 GMT</pubDate><ttl>60</ttl></channel></rss>