<?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[ATOM Matrix - basic working Access Point (micropython)]]></title><description><![CDATA[<p dir="auto">Thought people might be interested in a simple working example of an Access Point web server on the ATOM Matrix:<br />
(Wasn't sure if this was the correct place to post ...)</p>
<p dir="auto">Based on:<br />
<a href="https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/" target="_blank" rel="noopener noreferrer nofollow ugc">https://randomnerdtutorials.com/esp32-esp8266-micropython-web-server/</a><br />
<a href="http://community.m5stack.com/topic/1262/m5stack-basic-grey-as-wifi-ap" target="_blank" rel="noopener noreferrer nofollow ugc">http://community.m5stack.com/topic/1262/m5stack-basic-grey-as-wifi-ap</a></p>
<p dir="auto">Known Issues/Bugs:<br />
Very flaky - crashes lots ..  Seeing micropython REPL error:<br />
File "&lt;string&gt;", line 77, in &lt;module&gt;<br />
OSError: [Errno 104] ECONNRESET<br />
Atom dies....  Needs hard reset.</p>
<p dir="auto">Not sure why only momentary display Green/Red, looks like constant socket accepts..<br />
Need to investigate the unused addr return from socket accept, is this useful?<br />
Response Initial state affected by loaded page in browser?</p>
<p dir="auto">Anyway, all constructive comments welcome.</p>
<p dir="auto"><strong>One for m5stack: UIFlow-Desktop V1.4.5 is awful, can't even save my micropython code, please, please fix/update.</strong></p>
<p dir="auto"><strong>How do I get the listing to display as code like in other posts?</strong> DONE - see below!</p>
<pre><code>from m5stack import *
from m5ui import *
from uiflow import *
import network

try:
    import usocket as socket
except:
    import socket
    
request_state="NULL" 
waitingConnect = [0xff0000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
acceptedConnect = [0x00ff00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

def web_page():
  
  html = """&lt;html&gt;
	&lt;head&gt; 
		&lt;title&gt;Conrad's Web Server&lt;/title&gt; 
		&lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
		&lt;link rel="icon" href="data:,"&gt; 
		&lt;style&gt;
			html{font-family: Helvetica; display:inline-block; margin: 0px auto; text-align: center;}
			h1{color: #0F3376; padding: 2vh;}
			p{font-size: 1.5rem;}
			.button{background-color: #00aa00; display: inline-block; border: none; 
			 border-radius: 4px; color: white; padding: 16px 40px; text-decoration: none; 
			 font-size: 30px; margin: 2px; cursor: pointer;}
			.button2{background-color: #aa0000;}
		&lt;/style&gt;		
	&lt;/head&gt;
	&lt;body&gt; 	
		&lt;h1&gt;Atom-Matrix Web Server&lt;/h1&gt; 
		&lt;p&gt;Response: &lt;strong&gt;""" + request_state + """&lt;/strong&gt;&lt;/p&gt;		
		&lt;p&gt;&lt;a href="/?led=on"&gt;&lt;button class="button"&gt;GREEN&lt;/button&gt;&lt;/a&gt;&lt;/p&gt;
		&lt;p&gt;&lt;a href="/?led=off"&gt;&lt;button class="button button2"&gt;RED&lt;/button&gt;&lt;/a&gt;&lt;/p&gt;
	&lt;/body&gt;
  &lt;/html&gt;"""
  return html

ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid='Atom-Matrix')
ap.config(authmode=3, password='123456789')

response = None
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('192.168.4.1',80))
s.listen(5)

while True:
    rgb.set_screen(waitingConnect)
    conn, addr = s.accept()
    rgb.set_screen(acceptedConnect)      
    request = conn.recv(1024)
    request = str(request)
    led_on = request.find('/?led=on')
    led_off = request.find('/?led=off')
    if led_on == 6 :
      print('LED ON')
      request_state="ON"
      rgb.setColorAll(0x00ff00)        
    elif led_off == 6 :
      print('LED OFF')   
      request_state="OFF" 
      rgb.setColorAll(0xff0000)      
    else :
      request_state="NULL"      
    response = web_page()
    conn.send('HTTP/1.1 200 OK\n')
    conn.send('Content-Type: text/html\n')
    conn.send('Connection: close\n\n')
    conn.sendall(response)
    conn.close()
</code></pre>
]]></description><link>https://community.m5stack.com/topic/1847/atom-matrix-basic-working-access-point-micropython</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 01:31:47 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1847.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Apr 2020 21:51:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ATOM Matrix - basic working Access Point (micropython) on Tue, 14 Apr 2020 21:48:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m5stack" aria-label="Profile: m5stack">@<bdi>m5stack</bdi></a> UiFlow Version 1.4.5  (Desktop) Issues</p>
<ol>
<li>Pressing &lt;/&gt; Python:<br />
<img src="/assets/uploads/files/1586899663073-d5e1d27a-fb3e-4cf6-a804-ccb943374a93-image.png" alt="0_1586899662275_d5e1d27a-fb3e-4cf6-a804-ccb943374a93-image.png" class=" img-fluid img-markdown" /></li>
</ol>
<p dir="auto">At any time wipes out any code you have in the edit window, why?</p>
<ol start="2">
<li>Cannot save code, also two methods available to save:<br />
<img src="/assets/uploads/files/1586899837534-4ebd7d13-b7fd-46f2-b82b-f235d7d1d99c-image.png" alt="0_1586899836134_4ebd7d13-b7fd-46f2-b82b-f235d7d1d99c-image.png" class=" img-fluid img-markdown" /></li>
</ol>
<p dir="auto">Or<br />
<img src="/assets/uploads/files/1586899862738-ae0ea337-c3c8-4c38-812b-817cba96a19a-image.png" alt="0_1586899862312_ae0ea337-c3c8-4c38-812b-817cba96a19a-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Using either method saves a main.m5f file (Note, not a <a href="http://main.py" target="_blank" rel="noopener noreferrer nofollow ugc">main.py</a>), opening the main.m5f results in:</p>
<pre><code>rom m5stack import *
from m5ui import *
from uiflow import *

rgb.set_screen([0,0,0,0,0xFFFFFF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
setScreenColor(0x222222)






</code></pre>
<p dir="auto">Ok, so I thought I would change version via the Ver button at the top of the screen, now all I get is:</p>
<p dir="auto"><img src="/assets/uploads/files/1586900319548-c38ae718-927a-486d-b540-bc31fbbfe7f9-image.png" alt="0_1586900318444_c38ae718-927a-486d-b540-bc31fbbfe7f9-image.png" class=" img-fluid img-markdown" /></p>
<ol start="3">
<li>On startup I get:</li>
</ol>
<p dir="auto"><img src="/assets/uploads/files/1586900383901-704ee601-390a-4461-89be-2cde53e65372-image-resized.png" alt="0_1586900382795_704ee601-390a-4461-89be-2cde53e65372-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Everytime even though the driver is installed.  I select Skip which takes me to the main GUI which informs me the Atom-matrix is detected.</p>
<ol start="4">
<li>Basic editing navigation via shortcut keys such as &lt;ctrl&gt; S don't work - very annoying.</li>
</ol>
<p dir="auto">Because of the Javascript error I can't open in UIFlow anymore to continue....  Now I'm stuck.</p>
<p dir="auto">Please tell me I'm doing something wrong and being a complete idiot...</p>
]]></description><link>https://community.m5stack.com/post/8159</link><guid isPermaLink="true">https://community.m5stack.com/post/8159</guid><dc:creator><![CDATA[Conrad]]></dc:creator><pubDate>Tue, 14 Apr 2020 21:48:19 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Matrix - basic working Access Point (micropython) on Tue, 14 Apr 2020 12:41:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/conrad" aria-label="Profile: conrad">@<bdi>conrad</bdi></a> could you provide more detail? we already test , it can save the program file. if you can share you program , it will be very helpful for us find the bug. thank feedback</p>
]]></description><link>https://community.m5stack.com/post/8154</link><guid isPermaLink="true">https://community.m5stack.com/post/8154</guid><dc:creator><![CDATA[m5stack]]></dc:creator><pubDate>Tue, 14 Apr 2020 12:41:24 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Matrix - basic working Access Point (micropython) on Tue, 14 Apr 2020 07:53:07 GMT]]></title><description><![CDATA[<p dir="auto">Thanks.</p>
]]></description><link>https://community.m5stack.com/post/8149</link><guid isPermaLink="true">https://community.m5stack.com/post/8149</guid><dc:creator><![CDATA[Conrad]]></dc:creator><pubDate>Tue, 14 Apr 2020 07:53:07 GMT</pubDate></item><item><title><![CDATA[Reply to ATOM Matrix - basic working Access Point (micropython) on Tue, 14 Apr 2020 02:56:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/conrad" aria-label="Profile: conrad">@<bdi>conrad</bdi></a></p>
<p dir="auto">Re: How do I get the listing to display as code like in other posts?</p>
<p dir="auto">Enclose your code in sets of three back ticks (```)</p>
<pre><code>code

</code></pre>
]]></description><link>https://community.m5stack.com/post/8147</link><guid isPermaLink="true">https://community.m5stack.com/post/8147</guid><dc:creator><![CDATA[world101]]></dc:creator><pubDate>Tue, 14 Apr 2020 02:56:36 GMT</pubDate></item></channel></rss>