[SOLVED] How to I create an access point DHCP server?
-
How do I start up a DHCP server on the device to serve clients when I have configured the device to act as an access point? I want one client and I want it to have the IP 10.10.10.9. No gateway or DNS. Short lease. (30 min or so.)
from network import WLAN import machine AP_PASSWORD = '123456' AP_wlan = WLAN(mode=WLAN.AP) AP_wlan.init(ssid='WiPy', auth = (WLAN.WPA2, AP_PASSWORD), antenna = WLAN.INT_ANT) AP_wlan.ifconfig(id = 1, config = ('10.10.10.10', '255.255.255.252', '0.0.0.0', '0.0.0.0')) -
I was doing the init wrong. I can't get it to give 10.10.10.9 (it gives 10.10.10.11) but I should be able to work with that somehow; will play with it more.
Changes: Longer password, combine init into object instantiation.
from network import WLAN import machine AP_PASSWORD = '123456abcdef' AP_wlan = WLAN(mode=WLAN.AP, ssid='WiPy', auth = (WLAN.WPA2, AP_PASSWORD), antenna = WLAN.INT_ANT) AP_wlan.ifconfig(id = 1, config = ('10.10.10.10', '255.255.255.252', '0.0.0.0', '0.0.0.0'))
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login