intel / zephyr.js

JavaScript* Runtime for Zephyr* OS
Other
180 stars 64 forks source link

[dhcp] fail to build samples/DHCP.js #1358

Closed qiaojingx closed 7 years ago

qiaojingx commented 7 years ago

Description

undefined reference to 'zjs_net_config_init' error occurs when building DHCP.js sample.

Test Code

DHCP.js

Steps to Reproduction

  1. make BOARD=frdm_k64f JS=samples/DHCP.js
  2. make JS=samples/DHCP.js
  3. make BOARD=qemu_x86 qemu JS=samples/DHCP.js

    Actual Result

    On FRDM-K64F: selection_111

On Arduino101 & QEMU: selection_126

Expected Result

Build DHCP.js sample successfully.

Test Builds

Branch Commit Id Target Device Test Date Result
master 1ff882b FRDM-K64F Jul 13, 2017 Fail
master 1ff882b Arduino Jul 13, 2017 Fail
master 1ff882b Qemu Jul 13, 2017 Fail

Additional Information

qiaojingx commented 7 years ago

Update issue description since net-config module should also be supported on Arduino 101.

jprestwo commented 7 years ago

This sample was carry over from a stand alone DHCP module. The net-config module must be used in conjunction with another networking module (net/ws/dgram). These other modules include the needed config options for networking in general, which DHCP needs to work. Because of this, DHCP.js will not work, I pushed #1389 to remove it. To test DHCP you can use TCPEchoServ4_DHCP.js.

The next issue is the support between boards/targets. Currently only the FRDM board supports DHCP i.e. the dhcp() API is only defined on that target. This was done because it is currently the only "real" use case for it. The Arduino 101 uses 6lowpan which doesn't seem like DHCP would work (maybe I am wrong). @pfalcon did say you could do DHCP on QEMU, though I don't think that is a very good use case either, but perhaps for testing. It would be trivial to add DHCP support on QEMU if thats desired.

qiaojingx commented 7 years ago

Verified with commit 5726f4e. DHCP.js sample has been removed.