Issue with WiFi USB adapter on BBB

98 views
Skip to first unread message

agm...@gmail.com

unread,
Nov 22, 2016, 2:39:13 PM11/22/16
to BeagleBoard
Hello All,

I'm using BeagleBone Black as a TCP client which sends a TCP packet every 5 seconds and the same packet is echoed by the server immediately and I'm measuring the RTT (Round Trip Time). I'm using Edimax WiFi USB adapter. The RTT measured was ridiculously high (400ms) and I eventually found out its because the BBB suspends power to the adapter every few milliseconds (if there is no activity). I can see the current toggling between 80mA and 0 through an ammeter. Its because of this toggle, the RTT shoots up. I have disabled the auto suspend for the USB. Some observations
  1. The same WIFI adapter plugged into a computer (Linux and windows) running the same code works fine (with and without change to the autosuspend settings). No toggling of power and a steady 40ms RTT is observed. Also blue LED on adapter is stable. 
  2. I powered the the USB through a hub(powered externally) and connected it to BBB and it still exhibits the issue 
  3. The toggling of power can be observed with the blue led on the edimax adapter which remains constant when connected to other computers but blinks when connected to BBB. Cross checked with an ammeter. 
  4. When I keep the adapter busy on BBB (by sending the packet every 500ms instead of 2s), the adapter consumes a steady 80mA and the RTT is stable at 40ms

I have played around with the autosuspend settings (by writing -1 to autosuspend for the usb device), powered through hub etc. but the problem persists. 

Can anyone suggest if I'm missing something obvious. 

Robert Nelson

unread,
Nov 22, 2016, 2:47:17 PM11/22/16
to Beagle Board, agm...@gmail.com
Have you disable power management?

sudo iwconfig wlan0 power off


Regards,

--
Robert Nelson
https://rcn-ee.com/

AG M

unread,
Nov 28, 2016, 12:06:39 PM11/28/16
to Robert Nelson, Beagle Board
Thanks Robert. That command is not working. This is what I get when I run that command (my wireless interface is wlan1)

root@beaglebone:~# iwconfig wlan1 power off
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan1 ; Operation not permitted.

I tried this with two USB wifi adapters popular with BBB (this and this). Does not work on both. I'm currently running 3.8.13-bone79 kernel. 

Also tried adding this to my /etc/network/interfaces file. Still no luck. 

allow-hotplug wlan1
iface wlan1 inet dhcp
    wireless-power off

Any suggestions? Thank you.


Robert Nelson

unread,
Nov 28, 2016, 12:11:06 PM11/28/16
to AG M, Beagle Board
On Mon, Nov 28, 2016 at 11:06 AM, AG M <agm...@gmail.com> wrote:
> Thanks Robert. That command is not working. This is what I get when I run
> that command (my wireless interface is wlan1)
>
> root@beaglebone:~# iwconfig wlan1 power off
> Error for wireless request "Set Power Management" (8B2C) :
> SET failed on device wlan1 ; Operation not permitted.
>
> I tried this with two USB wifi adapters popular with BBB (this and this).
> Does not work on both. I'm currently running 3.8.13-bone79 kernel.

any reason you can't use 4.4.x? (4.4.34-ti-r69)

AG M

unread,
Nov 28, 2016, 1:04:03 PM11/28/16
to Robert Nelson, Beagle Board
Thank you. That suggestion worked. I installed a pre-compiled kernel 4.4.27-ti-r62.

I'm trying to find a kernel which supports these 3 things

1. Runs Xenomai
2. Power management with the wireless adapter (the current issue)
3. Power management features in kernel (CPU freq, CPU idle, Suspend-to-Ram, Runtime PM)

With 2, manually patching and compiling xenomai with an existing Linux kernel from scratch didn't work (gave up due to time constraints). I had to install a pre-compiled kernel 3.8.13-xenomai-r79 and then installed the xenomai userspace (xenomai 2.6.4). That worked perfectly. 

With 3, I would like to suspend the CPU and then wakeup using GPIO. 

Any chance there is a 4.4.x precompiled Xenomai kernel which supports 2 and 3?

Appreciate your help. Took me a while to figure out this wireless issue. Thanks. 

Robert Nelson

unread,
Nov 28, 2016, 1:10:02 PM11/28/16
to AG M, Beagle Board
On Mon, Nov 28, 2016 at 12:03 PM, AG M <agm...@gmail.com> wrote:
> Thank you. That suggestion worked. I installed a pre-compiled kernel
> 4.4.27-ti-r62.
>
> I'm trying to find a kernel which supports these 3 things
>
> 1. Runs Xenomai
> 2. Power management with the wireless adapter (the current issue)
> 3. Power management features in kernel (CPU freq, CPU idle, Suspend-to-Ram,
> Runtime PM)
>
> With 2, manually patching and compiling xenomai with an existing Linux
> kernel from scratch didn't work (gave up due to time constraints). I had to
> install a pre-compiled kernel 3.8.13-xenomai-r79 and then installed the
> xenomai userspace (xenomai 2.6.4). That worked perfectly.
>
> With 3, I would like to suspend the CPU and then wakeup using GPIO.
>
> Any chance there is a 4.4.x precompiled Xenomai kernel which supports 2 and
> 3?

Well i see an ipipe driver for 4.4.x:

https://git.xenomai.org/ipipe.git/

the xenomai patch merge is always fun...

Robert Nelson

unread,
Nov 28, 2016, 3:43:07 PM11/28/16
to AG M, Beagle Board
Okay, give this a shot, totally un-tested:

git clone https://github.com/RobertCNelson/ti-linux-kernel-dev.git
cd ti-linux-kernel-dev/
git checkout origin/ti-linux-xenomai-4.4.y -b tmp
./build_deb.sh

cp deploy/linux-image*.deb to target and install via:

sudo dpkg -i linux-image*.deb

Robert Nelson

unread,
Nov 28, 2016, 4:23:04 PM11/28/16
to AG M, Beagle Board
debian@beaglebone:~$ dmesg | grep Xenomai
[ 1.662891] [Xenomai] scheduling class idle registered.
[ 1.662905] [Xenomai] scheduling class rt registered.
[ 1.663079] I-pipe: head domain Xenomai registered.
[ 1.666337] [Xenomai] Cobalt v3.0.3 (Groovy Cosmic Halo)

AG M

unread,
Feb 25, 2017, 7:57:42 PM2/25/17
to Robert Nelson, Beagle Board
Thanks Robert. This works.

However, I moved my project from BBB to BBBGW. Can I follow the same
steps for BBGW?

roberts...@yahoo.com

unread,
Feb 26, 2017, 12:03:13 AM2/26/17
to beagl...@googlegroups.com

--------------------------------------------
On Sun, 2/26/17, AG M <agm...@gmail.com> wrote:

Subject: Re: [beagleboard] Issue with WiFi USB adapter on BBB
To: "Robert Nelson" <robert...@gmail.com>
Cc: "Beagle Board" <beagl...@googlegroups.com>
Date: Sunday, February 26, 2017, 2:57 AM
--
For more options, visit http://beagleboard.org/discuss
---
You received this message
because you are subscribed to the Google Groups
"BeagleBoard" group.
To
unsubscribe from this group and stop receiving emails from
it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/CALD0yU67hDsXeRz85vv7Tj-QmuqeAFgXATceHJnPC1ksObb6NQ%40mail.gmail.com.
For
more options, visit https://groups.google.com/d/optout.
icolae lorga Poporul inspirator al civilizatiei si literaturii romane moderne:

roberts...@yahoo.com

unread,
Feb 26, 2017, 3:09:55 AM2/26/17
to beagl...@googlegroups.com

--------------------------------------------
On Sun, 2/26/17, robertsmaria934 via BeagleBoard <beagl...@googlegroups.com> wrote:

Subject: Re: [beagleboard] Issue with WiFi USB adapter on BBB
To: beagl...@googlegroups.com
Date: Sunday, February 26, 2017, 7:03 AM
https://groups.google.com/d/msgid/beagleboard/1051453251.1090721.1488085386629%40mail.yahoo.com.
For more options, visit
https://groups.google.com/d/optout.ntre natiunile mai vechi romanii ocupa necontestat in privinta numarului locul cel dintai. . .or se poate aprecia pe drept la 4 7 din intreaga populatie. inmultirea populatiei romanesti e TlailJdsproportinat de mare fata de cea secuiasca maghiara si saseasca incat oriunde traieste atat de aceia' |e ja locul indata. Ei sunt raspanditi in intreaga tara pe de o parte in grupuri romanu intregjme satele sau jumatate din populatia acestora pe de alta parte la marginea asezarilor unguresti secuiesti st sasesti. ...
Reply all
Reply to author
Forward
0 new messages