Connecting to static IP

Hi,
I want to connect to a router that has a static IP assigned. I have used the mjpeg_streamer.py example, which works when connected to a DHCP server. I have been reading the documentation and I have changed some line of the code but I cannot make it work.
Thanks
Best regards.

# Init wlan module and connect to network
print("Trying to connect... (may take a while)...")
wlan = network.WINC()
wlan.ifconfig(('2.1.1.20','255.0.0.0','2.1.1.10','0.0.0.0'))
wlan.connect(SSID, key=KEY, security=wlan.WPA_PSK)

Hi, I’ll test this and get back to you.

Seems our ifconfig doesn’t support static IPs. I’ll add support for this in the next release. It would be helpful if you can open an issue on github Issues · openmv/openmv · GitHub

Hi, ifconfig now supports static IPs. To set a static IP you should call ifconfig((ip, subnet, gateway, dns)) before calling connect(). This will be available in the next release, alternatively you can download the development firmware images from github: https://github.com/openmv/openmv/tree/master/firmware

Hi,
That’s great. Thank you very much for your work. It’s amazing.