WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved] udhcpc cannot obtain IP in WIFI  (Read 14441 times)

Offline Xianwen Chen

  • Full Member
  • ***
  • Posts: 142
[solved] udhcpc cannot obtain IP in WIFI
« on: March 10, 2013, 05:42:28 PM »
Hi all,

I use a USB Realtek 8187B wireless adapter. I find that udhcpc cannot obtain IP. I have to use dhcpcd every time. Is it just me having this problem?

Thanks in advance.
« Last Edit: March 12, 2013, 04:32:21 AM by Xianwen Chen »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: udhcpc cannot obtain IP in WIFI
« Reply #1 on: March 10, 2013, 11:13:17 PM »
Using a dell dw1530 wireless card, I need to run udhcpc once, kill the process and run udhcpc again - it always works the second time.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: udhcpc cannot obtain IP in WIFI
« Reply #2 on: March 10, 2013, 11:28:34 PM »
You could use the nodhcp boot optiion so you can run udhcpc at the proper time.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: udhcpc cannot obtain IP in WIFI
« Reply #3 on: March 10, 2013, 11:40:19 PM »
Thanks, but in my case I'm not sure that would change anything (there was no problem with my previous hardware) - plus I need udhcpc running in case I use a wired connection.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: udhcpc cannot obtain IP in WIFI
« Reply #4 on: March 10, 2013, 11:42:16 PM »
You can always run it in bootlocal.sh.

Offline Xianwen Chen

  • Full Member
  • ***
  • Posts: 142
Re: udhcpc cannot obtain IP in WIFI
« Reply #5 on: March 12, 2013, 02:57:01 AM »
Using a dell dw1530 wireless card, I need to run udhcpc once, kill the process and run udhcpc again - it always works the second time.
Hi Juanito,

Thank you. I tried to run udhcpc multiple times. However, I cannot obtain IP from DHCP server with udhcpc. I use a USB wireless adapter with Realtek 8187B chip.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: udhcpc cannot obtain IP in WIFI
« Reply #6 on: March 12, 2013, 03:01:39 AM »
could you post the output you get when you try to run udhcpc - make sure there are no other instances of udhcpc running first

Offline Xianwen Chen

  • Full Member
  • ***
  • Posts: 142
Re: udhcpc cannot obtain IP in WIFI
« Reply #7 on: March 12, 2013, 03:43:56 AM »
could you post the output you get when you try to run udhcpc - make sure there are no other instances of udhcpc running first

Hi Juanito,

Thank you. I took Gerald Clark's advice. The option 'nodhcp' was added to the boot menu. No 'udhcpc' instance was running at system startup.

My landlord uses WPA to protect her WIFI. After I associated the USB wireless adapter to the WIFI, I tried both 'udhcpc' and 'udhcpc wlan0' twice. It always repeated reporting 'Sending discover...'. I waited several minutes for each trial.

The USB adapter is connected to one of the USB ports. The light did not blink when 'udhcpc' was trying to discover the DHCP server. That suggests that 'udhcpc' might not have sent signal through the adapter.

As usual, 'dhcpcd' obtained IP from the DHCP server instantly.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: udhcpc cannot obtain IP in WIFI
« Reply #8 on: March 12, 2013, 03:49:47 AM »
After I associated the USB wireless adapter to the WIFI, I tried both 'udhcpc' and 'udhcpc wlan0' twice.
sudo udhcpc -i wlan0
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14817
Re: udhcpc cannot obtain IP in WIFI
« Reply #9 on: March 12, 2013, 04:10:04 AM »
You need to use something like this:
Code: [Select]
$ sudo udhcpc -b -i wlan0 -x hostname:box -p /var/run/udhcpc.wlan0.pid

Offline Xianwen Chen

  • Full Member
  • ***
  • Posts: 142
Re: udhcpc cannot obtain IP in WIFI
« Reply #10 on: March 12, 2013, 04:31:45 AM »
The problem has been solved. Thank you Tinypoodle and Juanito.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [solved] udhcpc cannot obtain IP in WIFI
« Reply #11 on: March 12, 2013, 04:44:06 AM »
Just by
Code: [Select]
udhcpc --helpyou could see that you actually were trying to get a lease for eth0 ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Xianwen Chen

  • Full Member
  • ***
  • Posts: 142
Re: [solved] udhcpc cannot obtain IP in WIFI
« Reply #12 on: March 12, 2013, 05:42:17 AM »
Just by
Code: [Select]
udhcpc --helpyou could see that you actually were trying to get a lease for eth0 ;)

Thank you tinypoodle.