# Connecting to static IP

**URL:** <https://forums.openmv.io/t/connecting-to-static-ip/1378>\
**Category:** OpenMV Boards\
**Created:** [August 7, 2019, 10:03am UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378 "2019-08-07T10:03:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jandraka](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jandraka](https://forums.openmv.io/u/jandraka)\
**Post date:** [August 7, 2019, 10:03am UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378/1 "2019-08-07T10:03:02Z")

</div>

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.

```python
# 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)

```

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [August 9, 2019, 7:28pm UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378/2 "2019-08-09T19:28:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [August 12, 2019, 1:06pm UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378/3 "2019-08-12T13:06:36Z")

</div>

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](https://github.com/openmv/openmv/issues)

---

<div class="post-metadata">

**Author:** ![iabdalkader](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/iabdalkader/32/1169_2.png) [@iabdalkader](https://forums.openmv.io/u/iabdalkader)\
**Post date:** [August 25, 2019, 11:33pm UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378/4 "2019-08-25T23:33:36Z")

</div>

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](https://github.com/openmv/openmv/tree/master/firmware)

---

<div class="post-metadata">

**Author:** ![jandraka](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@jandraka](https://forums.openmv.io/u/jandraka)\
**Post date:** [August 27, 2019, 9:39am UTC](https://forums.openmv.io/t/connecting-to-static-ip/1378/5 "2019-08-27T09:39:48Z")

</div>

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