DHCP over WiFi on MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DHCP over WiFi on MQX

482 Views
oscargarciaabad
Contributor III

Hi all,

I'm writing an MQX WiFi driver for an AT based module. The module is communicating with the ucontroller ( a K60 derivative) using UART. So far I have the UART set up and working, so I can issue AT commands to the module. Thi is done using ipcfg_init_device. After that I send some mediactl commands to the module succesfully:

     - iwcfg_set_essid

     - iwcfg_set_passphrase

     - iwcfg_set_sec_type

Then I want to join the AP I set up using the previous mediactl commands using dhcp. In order to do so I'm using ipcfg_bind_dhcp_wait.

I need to link ipcfg_bind_dhcp_wait with my device. At this point I haven't joined the AP. Can somebody point out How to make this work? Do I need to join the network before using DHCP?

Regards,

Oscar.

Labels (1)
0 Kudos
2 Replies

330 Views
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Oscar,

This is a scenario that we haven't tested already. Now, based on your info and what we have in our examples you may need to call another couple of functions before trying the DHCP.

Maybe not needed but call the function iwcfg_set_mode() which sets the mode for Wifi device. The function iwcfg_commit() will commit the requested change. It also associates with the requested AP with SSID set by iwcfg_set_essid.

In addition, also try to set a static IP address with the funciton ipcfg_bind_staticip(). This will help us to discard any connectivity issue with the joining on the WiFi net.

I hope this is useful.


Have a great day,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

330 Views
oscargarciaabad
Contributor III

Hi Garabo,

Thank you for your quick answer. As long as I understood I must set the mode before calling any function from the family ipcfg_bind-xxx() and then call iwcfg_commit which forces the WiFi device to associate (connect) to the requested AP.

I tried doing so, but the module I have needs to have an static IP or the internal DHCP client set before calling the associate (Join network) command, so if I do what you suggetsed my WiFi module is answering the connect command with an error.

Did I get yoy well?

Regards,

Oscar.

0 Kudos