Page 1 of 1

WIZnet5K use DHCP ?

Posted: Fri Sep 11, 2020 3:35 pm
by water
Can I configure WIZnet5K use DHCP ?
If not, how to set the network parameter ?
I try to use

Code: Select all

nic.ifconfig(('192.168.1.103', '255.255.255.0', '192.168.1.1', '8.8.8.8'))
(e.g. my router IP address is '192.168.1.1')

but can't not connect to internet, WIZnet5K device can't detect on router (it should be detected).

I use adafruit_wiznet5k library on CircuitPython success to connect to internet, so the hardware is correct.
https://circuitpython.readthedocs.io/pr ... t/api.html

How should I configure WIZNET5K correctly on MicroPython ?

Re: WIZnet5K use DHCP ?

Posted: Thu Sep 24, 2020 3:44 am
by Stevo52
You haven't shown how you set up the WIZnet5k device?

This section of Micropython documentation might be worth reading, to help you figure it out...

http://docs.micropython.org/en/latest/l ... NET5K.html

Re: WIZnet5K use DHCP ?

Posted: Sun Jan 24, 2021 4:50 am
by acute
Stevo52 wrote:
Thu Sep 24, 2020 3:44 am
You haven't shown how you set up the WIZnet5k device?

This section of Micropython documentation might be worth reading, to help you figure it out...

http://docs.micropython.org/en/latest/l ... NET5K.html
That section doesn't mention DHCP at all. So I tried to build firmware for my PyBoard like this:

Code: Select all

make BOARD=PYBV11 MICROPY_PY_WIZNET5K=5500 MICROPY_PY_LWIP=1
(PYBV11 for PyBoard v1.1 in my case), and it helped, so apparently DHCP is implemented in lwIP.

Re: WIZnet5K use DHCP ?

Posted: Wed Jan 27, 2021 8:39 pm
by water
That section doesn't mention DHCP at all. So I tried to build firmware for my PyBoard like this:

Code: Select all

make BOARD=PYBV11 MICROPY_PY_WIZNET5K=5500 MICROPY_PY_LWIP=1
(PYBV11 for PyBoard v1.1 in my case), and it helped, so apparently DHCP is implemented in lwIP.
Good, it works.
I think the lwIP module already enabled by default when build firmware with 'MICROPY_PY_WIZNET5K=5500' before, so, that means if not specific:

Code: Select all

MICROPY_PY_LWIP=1
when build the firmware, the WIZnet5K module has nothing practical implication?
:)

Re: WIZnet5K use DHCP ?

Posted: Wed Jan 27, 2021 10:36 pm
by acute
Without explicitly enabling lwIP — no, W5x00 module driver is being built, but it only accepts static IPv4 configuration for ifconfig() method; and it changes its behavior when built with lwIP.
UPD0: actually, you can still use the interface without DHCP, so if you can configure everything without DHCP and use it as you expected, then there's no need in that. Sockets work, the HTTP example from the manual works, for instance.