<?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[M5 Flow2 + Web Server]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am trying to have two parallel capabilities:</p>
<ul>
<li>UI functionality (with BtnA.setCallbacks, etc.),</li>
<li>WebServer (to listen on specific port and change UI labels based on received data).</li>
</ul>
<p dir="auto">When I use the following code:</p>
<pre><code>if __name__ == '__main__':
  try:
    setup()
    addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]
    s = socket.socket()
    s.bind(addr)
    s.listen(1)
while True:
  M5.update()
  conn, addr = s.accept()
  print('client connected from', addr)       
</code></pre>
<p dir="auto">Then UI stops working (as probably code hangs on socket accept).  As soon as I comment: s.accept, then UI starts working again. What is interesting is that socket also does not work as well.</p>
<p dir="auto">Can you advise how to enable these two capabilities at the same time?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://community.m5stack.com/topic/6259/m5-flow2-web-server</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 03:20:31 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6259.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 Mar 2024 21:45:52 GMT</pubDate><ttl>60</ttl></channel></rss>