-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Make sure you are running the latest version of TinyWeb before reporting an issue.
Device and/or platform:
- MicroPython, TinyPICO (ESP32) (latest - built from source today)
- Built against IDF 4.0 release
- Using latest MicroDNSSrv for DNS + latest TinyWeb for Webserver.
Description of problem:
Webserver is running as expected if I connect to my wifi and run the server with the host set to my IP given by the DNS.
But my use case is to set local DNS and start an AP and connect to my AP, and have it serve pages from that - Making a MicroPython WifiManager-esq system for my application.
If I set the DNS to be MicroDNSSrv using this...
dns = MicroDNSSrv.Create({ '*' : '192.168.4.1' })
And connect to it, as soon as it tries to serve the / page, I get a kernel panic!
Expected:
It should just serve me the page. Even the most basic of pages kernel panics. There should never be a kernel panic from a module.
This setup works with MicroWebServ2 as the web server, and my basic sockets based web server. I moved to TinyWeb as I need an uasyncio based web server as I'm transitioning the rest of my app to be asyncio based.
Error:
`>>> import tw
I (110680) phy: phy_version: 4180, cb3948e, Sep 12 2019, 16:39:13, 0, 0
tw.run()
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x40093c30 PS : 0x00060034 A0 : 0x80096544 A1 : 0x3ffbb150
A2 : 0x3ffba694 A3 : 0x3f427d11 A4 : 0x3ffba6a8 A5 : 0x3ffbeaf0
A6 : 0x3ffbeb38 A7 : 0x00000001 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x00000011 A12 : 0x8009707b A13 : 0x3ffbeac0
A14 : 0x00000020 A15 : 0x00000020 SAR : 0x00000018 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400948e0 LEND : 0x4009490e LCOUNT : 0x00000000
ELF file SHA256: `
Traceback (if applicable):
Additional info:
Please let me know if there is anything else I can provide!
Code:
import tinyweb, network
from microDNSSrv import MicroDNSSrv
wlan_ap = network.WLAN(network.AP_IF)
wlan_ap.active(True)
wlan_ap.config(essid='Seon')
dns = MicroDNSSrv.Create({ '*' : '192.168.4.1' })
# sta = network.WLAN(network.STA_IF)
# sta.active(True)
# sta.connect('aaa', 'bbb')
# sta.ifconfig()
# Create web server application
app = tinyweb.webserver()
# Index page
@app.route('/')
async def index(request, response):
# Start HTTP response with content-type text/html
await response.start_html()
# Send actual HTML page
await response.send('<html><body><h1>Hello, world! (<a href="/table">table</a>)</h1></html>\n')
# Another one, more complicated page
@app.route('/table')
async def table(request, response):
# Start HTTP response with content-type text/html
await response.start_html()
await response.send('<html><body><h1>Simple table</h1>'
'<table border=1 width=400>'
'<tr><td>Name</td><td>Some Value</td></tr>')
for i in range(10):
await response.send('<tr><td>Name{}</td><td>Value{}</td></tr>'.format(i, i))
await response.send('</table>'
'</html>')
def run():
app.run()