zephyriot / zep-jira14

0 stars 0 forks source link

sample of dhcpv4_client runs failed on Arduino 101 #1604

Closed nashif closed 7 years ago

nashif commented 7 years ago

Reported by jiequan wu:

Configuration

x86 Bug detailed description =================== sample of dhcpv4_client runs error on Arduino 101 ================== 1. cd samples/net/dhcpv4_client 2. make pristine && make BOARD=arduino_101 flash ``` warning: (SPI_CS_GPIO && SPI_SS_CS_GPIO && I2C_NRF5) selects GPIO which has unmet direct dependencies (SOC_FAMILY_NRF5 && SERIAL || SOC_SERIES_KINETIS_K6X && SOC_MK64F12 || BOARD_ARDUINO_101_BLE && UART_NRF5 || BOARD_CURIE_BLE && UART_NRF5 || BOARD_QUARK_SE_C1000_BLE && UART_NRF5 || BOARD_ARDUINO_101 && NBLE || BOARD_ARDUINO_101 && FLASH && SPI || BOARD_GALILEO || BOARD_QUARK_SE_C1000_DEVBOARD && NBLE || BOARD_QUARK_SE_C1000_DEVBOARD && IEEE802154_CC2520) warning: (SPI_CS_GPIO && SPI_SS_CS_GPIO && I2C_NRF5) selects GPIO which has unmet direct dependencies (SOC_FAMILY_NRF5 && SERIAL || SOC_SERIES_KINETIS_K6X && SOC_MK64F12 || BOARD_ARDUINO_101_BLE && UART_NRF5 || BOARD_CURIE_BLE && UART_NRF5 || BOARD_QUARK_SE_C1000_BLE && UART_NRF5 || BOARD_ARDUINO_101 && NBLE || BOARD_ARDUINO_101 && FLASH && SPI || BOARD_GALILEO || BOARD_QUARK_SE_C1000_DEVBOARD && NBLE || BOARD_QUARK_SE_C1000_DEVBOARD && IEEE802154_CC2520) ``` 3. Connect arduino 101 to Ubuntu by the LAN 4. configure file /etc/dhcpd/dhcp.conf ``` log-facility local7; default-lease-time 600; max-lease-time 7200; subnet 192.0.2.0 netmask 255.255.255.0 { range 192.0.2.10 192.0.2.100; } ``` 5. set ipv4 address on host $ sudo ifconfig eth1 192.0.2.2/24 6. start dhcp server $ sudo service isc-dhcp-server start 7. open serial port 8. reset the arduino 101 serial port output: ``` [dhcpv4] [INF] main: In main [dhcpv4] [INF] main_thread: Run dhcpv4 client ``` (Imported from Jira ZEP-1753)
nashif commented 7 years ago

by jiequan wu:

Jukka Rissanen, please check this issues.

nashif commented 7 years ago

by jiequan wu:

I tested again. It is fine (commit c78a3485e24fad master branch).

nashif commented 7 years ago

by jiequan wu:

The latest commit, this issue reproduced(commit id: 23d946f4c0f6 && branch: master).

nashif commented 7 years ago

by Jukka Rissanen:

Arduino 101 is not a reference platform for networking support. Please verify this with qemu and frdm board which support networking natively.

nashif commented 7 years ago

by Geoff Gustafson:

I ran into this issue in Zephyr 1.8 - I see DHCP Discover messages go out and Offers come back, but Requests never happen. Then I updated to Zephyr 1.9 master and now it appears not even the Discovers go out anymore.

It does work on K64F... but there is a prj.conf file in the sample specifically for A101 w/ the ENC28J60 card; with a static IP it works great. Seems like the sample should be removed if it's not going to be kept working (though I'd much prefer the problem be looked at).

nashif commented 7 years ago

by Tomasz Bursztyka:

Geoff Gustafson Are you saying all works on a101+enc25j60 with a static IP address? Because from what I see currently in this ethernet driver, all incoming packet will be bogus. I'll fix the driver, it has nothing to do with a101.

Does that PR fix the issue: https://github.com/zephyrproject-rtos/zephyr/pull/1284 ? I think it should, but I cannot test as my a101s are dead, and no time trying to wire this up on other occupied boards.

nashif commented 7 years ago

by Geoff Gustafson:

It works in 1.8 w/ static IP at least. That's what ZJS is based on currently: https://github.com/01org/zephyr.js/issues/1488.

And what I mean by "works" is that echo server traffic works w/ the ENC28J60.

I switched to reproduce the problem in the Zephyr sample and then did git bisect on that, but haven't gone back to try ZJS w/ that commit. I'll do that and report back.

nashif commented 7 years ago

by Geoff Gustafson:

Yeah, I've confirmed that with the db11fcd1 Zephyr commit, a TCP echo sample works fine with ENC28J60 on A101, if I set a static IP address (192.168.1.99 FWIW).

And with the patch you submitted to Zephyr I do see DHCP Request/Ack. Thanks!