Compare commits
2
Commits
15cad37d5e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d468f0414 | ||
|
|
efc1114c86 |
@@ -133,7 +133,7 @@ async def main():
|
|||||||
server = asyncio.create_task(app.start_server(port=80))
|
server = asyncio.create_task(app.start_server(port=80))
|
||||||
|
|
||||||
# Only run if we have internet
|
# Only run if we have internet
|
||||||
if wlan.IF_STA:
|
if mode is "STA":
|
||||||
asyncio.create_task(CTA_Stations(config))
|
asyncio.create_task(CTA_Stations(config))
|
||||||
|
|
||||||
await server
|
await server
|
||||||
@@ -166,6 +166,7 @@ try:
|
|||||||
print('Connection error:', e)
|
print('Connection error:', e)
|
||||||
print('Retrying connection...')
|
print('Retrying connection...')
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
mode = "STA"
|
||||||
except:
|
except:
|
||||||
# Failed to open config file, launch AP mode and disable trains
|
# Failed to open config file, launch AP mode and disable trains
|
||||||
demo = True
|
demo = True
|
||||||
@@ -179,12 +180,6 @@ except:
|
|||||||
|
|
||||||
print("AP active for initial setup: ", wlan.active())
|
print("AP active for initial setup: ", wlan.active())
|
||||||
print("AP IP address:", wlan.ifconfig()[0])
|
print("AP IP address:", wlan.ifconfig()[0])
|
||||||
|
mode = "AP"
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user