4 years, 11 months ago.

DHCP with WIZnetInterface-OS5

Hi, I'm using mbed with WIZnetInterface-OS5. Trying to run DHCP via:

source

WIZnetInterface eth;
uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x00, 0x01, 0x02}; 
eth.init(mac_addr);
eth.connect();
printf("IP Address: %s\r\n", eth.getIPAddress());

I get this output on the console:

source

[int DHCPClient::setup(int):197]m_retry: 0
[int DHCPClient::setup(int):197]m_retry: 1
[int DHCPClient::setup(int):197]m_retry: 2
[int DHCPClient::setup(int):207]m_retry: 3, m_interval: 5672
IP Address: 0.0.0.0

I see no DHCP packets via wireshark.

Note: my hardware is ok, using a static IP address works fine.

Any help? Thanks!

Question relating to:

WIZwiki-W7500P is a SoC platform board based on the W7500P chip = ARM Cortex-M0 that integrates 128KB Flash and hardwired TCP/IP core and MacPhy. If you use WIZwiki-W7500 board, you …

Hi Jonathan, check the Mbed os5 version, your platform is indicating up to 5.6. You may have to switch back to that version or even try os2.

posted by Paul Staron 30 Apr 2019

I tried rolling back but I get the following error:

[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting

[mbed] Working path "/aprojects/poewall/application" (library) [mbed] Program path "/aprojects/poewall/application" [mbed] WARNING: Missing Python modules were not auto-installed. The Mbed OS tools in this program require the following Python modules: pyyaml, requests You can install all missing modules by running "pip install -r requirements.txt" in "/aprojects/poewall/application/mbed-os" On Posix systems (Linux, etc) you might have to switch to superuser account or use "sudo"

File "/aprojects/poewall/application/mbed-os/tools/make.py", line 189 print mcu_toolchain_matrix(platform_filter=options.general_filter_regex) ^ SyntaxError: invalid syntax [mbed] ERROR: "/usr/bin/python3" returned error. Code: 1 Path: "/aprojects/poewall/application" Command: "/usr/bin/python3 -u /aprojects/poewall/application/mbed-os/tools/make.py -t GCC_ARM -m WIZWIKI_W7500P source . build ./BUILD/WIZWIKI_W7500P/GCC_ARM" Tip: You could retry the last command with "-v" flag for verbose output

[mbed] WARNING: Using Python 3 with Mbed OS 5.8 and earlier can cause errors with compiling, testing and exporting -

Which is weird because when I run

******

$ python - -version

Python 2.7.16

******

It returns version 2, not 3

posted by Jonathan Vervaeke 02 May 2019
Be the first to answer this question.