mitchins / micropython-wifimanager Goto Github PK
View Code? Open in Web Editor NEWA simple network configuration utility for MicroPython on the ESP-8266 board
License: BSD 2-Clause "Simplified" License
A simple network configuration utility for MicroPython on the ESP-8266 board
License: BSD 2-Clause "Simplified" License
I'm unable to install micropython-wifimanger via upip on my ESP8266.
>>> upip.install('micropython-wifimanager')
Installing to: /lib/
Queue: ['micropython-wifimanager']
https://micropython.org/pi/micropython-wifimanager/json
https://pypi.org/pypi/micropython-wifimanager/json
Error installing 'micropython-wifimanager': , packages may be partially installed
Same is on native linux
$ micropython -m upip install --debug micropython-wifimanager
Installing to: /home/asdf/snap/micropython/80/.micropython/lib/
Queue: ['micropython-wifimanager']
https://micropython.org/pi/micropython-wifimanager/json
Warning: micropython.org SSL certificate is not validated
https://pypi.org/pypi/micropython-wifimanager/json
Error installing 'micropython-wifimanager': , packages may be partially installed
It seems that something is wrong with the hosting of the package itself, because if I try to access the link from the logs (https://micropython.org/pi/micropython-wifimanager/json) in my browser, I get "404 Not found" error.
In just installed and connected ESP8266 4MB:
>>> import network
>>> sta_if = network.WLAN(network.STA_IF)
>>> sta_if.active(True)
#6 ets_task(4020f474, 28, 3fffa018, 10)
>>> sta_if.connect('xxx', 'xxx')
>>> sta_if.ifconfig()
('192.168.0.192', '255.255.255.0', '192.168.0.1', '213.46.172.37')
>>> import upip
>>> upip.install('micropython-wifimanager')
Installing to: /lib/
Warning: pypi.org SSL certificate is not validated
Installing micropython-wifimanager 0.3.3 from https://files.pythonhosted.org/packages/ab/bf/5f896441ca23c794fc7011f5429a04b44018a686789d592cf8d9911afd1a/micropython-wifimanager-0.3.3.tar.gz
Error installing 'micropython-wifimanager': [Errno 22] EINVAL, packages may be partially installed
>>>
If I have webrepl enabled for access point it will make it available even for other networks.
My config:
{
"schema": 2,
"known_networks": [
{
"ssid": "xxxxxx",
"password": "xxxxxx",
"enables_webrepl": false
},
{
"ssid": "xxxxxx",
"password": "xxxxxx",
"enables_webrepl": false
}
],
"access_point": {
"config": {
"essid": "xxxxxx",
"channel": 11,
"hidden": false,
"password": "xxxxxx"
},
"enables_webrepl": true,
"start_policy": "always"
}
}
This is like security bug for me.
It would be nice to provide a callback hook when wifi connection state changes so other modules can be notified. For instance, if wifi disconnects, then I can blink an LED to let the user now the device is reconnecting. Right now I would have to create my own task that polls wlan.isconnected()
repeatedly.
Here's what the API could look like:
manager = WifiManager()
manager.add_connection_handler(handle_wifi_connection)
def handle_wifi_connection(is_connected):
if is_connected:
status_led.on()
else:
status_led.blink()
I'm not sure if this project is still active. If so, I'd be more than willing to submit a PR for this feature. Just give me a ๐ from one of the maintainers and I'll make it happen.
I've tried WiFiManager with with MicroPython builds:
tinypico-idf3-20191220-v1.12
tinypico-idf3-20200223-v1.12-195-gb16990425
Just running the bare main.py included in WiFiManager-master.
The traceback occurs write after the SSID and password check succeeds. The wifi.dat is not saved.
Errors:
Connected. Network config: ('192.168.4.89', '255.255.255.0', '192.168.4.254', '192.168.4.254')
Traceback (most recent call last):
File "main.py", line 4, in
File "wifimgr.py", line 60, in get_connection
File "wifimgr.py", line 306, in start
File "wifimgr.py", line 213, in handle_configure
File "wifimgr.py", line 112, in send_response
File "wifimgr.py", line 103, in send_header
OSError: [Errno 5] EIO
It would be nice to have a REST API to interact with the config file that way developers could create a UI for users to bootstrap the device. Actually, a wrapper class that handles CRUD operations on the config file would support a REST API as well as a traditional web interface. Something like:
GET /wifi/known_networks
GET /wifi/access_point
wifi_config = WifiConfig()
wifi_config.known_networks.append({
"ssid": "my_access_point",
"password": "my_access_point_password",
"enables_webrepl": False,
})
wifi_config.save()
I'm not sure if this project is still active. If so, I'd be more than willing to submit a PR for this feature. Just give me a ๐
from one of the maintainers and I'll make it happen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.