- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I want to use two BCM943907WCD2 devices and one is server(or gateway) ,the other is client.
The AP fails to start DHCP service at wiced_start_dhcp_server() because I define the interface as WICED_ETHERNET_INTERFACE .
How can I get the right configuration to run a BCM943907WCD2 platform as an ethernet server with DHCP function?
Could anyone help?
Solved! Go to Solution.
- Labels:
-
softAP
-
WICED Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding this:
wiced_ip_setting_t ip_settings =
{
INITIALISER_IPV4_ADDRESS( .ip_address, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
INITIALISER_IPV4_ADDRESS( .netmask, MAKE_IPV4_ADDRESS( 255,255,255, 0 ) ),
INITIALISER_IPV4_ADDRESS( .gateway, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
};
wiced_network_up( WICED_ETHERNET_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &ip_settings );
If building for debug, comment the following line for testing
/* DHCP_CHECK_PARAMS( (server == NULL) || ( (interface != WICED_STA_INTERFACE) && (interface != WICED_AP_INTERFACE) && (interface != WICED_P2P_INTERFACE) && (interface != WICED_CONFIG_INTERFACE) ), WICED_BADARG ); */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use wiced_network_up( WICED_ETHERNET_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, NULL ); for this. The WICED_USE_INTERNAL_DHCP_SERVER would allow WICED to start DHCP server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi grsr,
It is stuck in wiced_start_dhcp_server() since the parameter is not allowed. When use the WICED_USE_INTERNAL_DHCP_SERVER option, wiced_start_dhcp_server() will sentence the WICED_ETHERNET_INTERFACE to be WICED_BADARG as the following shows at line.153 in dhcp_server.c.
DHCP_CHECK_PARAMS( (server == NULL) || ( (interface != WICED_STA_INTERFACE) && (interface != WICED_AP_INTERFACE) && (interface != WICED_P2P_INTERFACE) && (interface != WICED_CONFIG_INTERFACE) ), WICED_BADARG );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does it work if you comment out the DHCP_CHECK_PARAMS line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The result is "Unable to obtain IP address via DHCP"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
joeccmou_2842441 wrote:
The result is "Unable to obtain IP address via DHCP"
grsr
Any comment about this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please ignore my last response. Ethernet interface cannot be used as DHCP server. The WICED_USE_INTERNAL_DHCP_SERVER is only valid for softAP interface.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why ethernet interface cannot be used as DHCP server?
Take a look at libraries/daemons/DHCP_server, there is no such limitation at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply, but why the ethernet interface cannot be used as DHCP server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To start DHCP server, the WICED_USE_INTERNAL_DHCP_SERVER is required in wiced_network_up(). However, in the documentation API.html, WICED_USE_INTERNAL_DHCP_SERVER has been described as "softAP interface: use the internal DHCP server". The interfaces are configured as shown in the struct below:
static wiced_network_config_t wiced_config_cache[ WICED_INTERFACE_MAX ] =
{
[WICED_STA_INTERFACE] = WICED_USE_EXTERNAL_DHCP_SERVER,
[WICED_AP_INTERFACE] = WICED_USE_INTERNAL_DHCP_SERVER,
[WICED_P2P_INTERFACE] = WICED_USE_EXTERNAL_DHCP_SERVER,
[WICED_ETHERNET_INTERFACE] = WICED_USE_EXTERNAL_DHCP_SERVER,
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you can try:
1. Change
[WICED_ETHERNET_INTERFACE] = WICED_USE_EXTERNAL_DHCP_SERVER,
to
[WICED_ETHERNET_INTERFACE] = WICED_USE_INTERNAL_DHCP_SERVER,
Above change depends on the network stack you use:
WICED/network/LwIP/WICED/wiced_network.c
WICED/network/NetX/WICED/wiced_network.c
WICED/network/NetX_Duo/WICED/wiced_network.c
2. Comment out the line checking interface in dhcp_server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding this:
wiced_ip_setting_t ip_settings =
{
INITIALISER_IPV4_ADDRESS( .ip_address, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
INITIALISER_IPV4_ADDRESS( .netmask, MAKE_IPV4_ADDRESS( 255,255,255, 0 ) ),
INITIALISER_IPV4_ADDRESS( .gateway, MAKE_IPV4_ADDRESS( 192,168, 0, 1 ) ),
};
wiced_network_up( WICED_ETHERNET_INTERFACE, WICED_USE_INTERNAL_DHCP_SERVER, &ip_settings );
If building for debug, comment the following line for testing
/* DHCP_CHECK_PARAMS( (server == NULL) || ( (interface != WICED_STA_INTERFACE) && (interface != WICED_AP_INTERFACE) && (interface != WICED_P2P_INTERFACE) && (interface != WICED_CONFIG_INTERFACE) ), WICED_BADARG ); */