BeagleBoneBlack wireless — does the wifi module need to be power cycled to reset after suspend?

I'm trying to configure the beaglebone black [wireless version -
4.9.82-ti-r102 #1 SMP PREEMPT] -- running debian 9.3 stretch.

So, I can successfully cause the device to sleep and wake with this command:

/usr/sbin/rtcwake -m mem -u -t $(date +%s -d "20 minutes")

However, the AP run from the BBB wireless does not restart.

I would like to use crontab to then restart the BBB access point, which I
think I have to do via connmanctl.

Unfortunately, I've not been able to get this to happen. What I am seeing
is that the wifi module on the BBB wifi appears to require a power cycle or
a physical reset before the wifi will re-establish properly after a suspend
and then wake. The following command will not give errors, but it won't
actually get the AP up and running again:

/usr/bin/connmanctl disable wifi;/usr/bin/connmanctl enable wifi;/usr/bin/connmanctl tether wifi "BeagleBone-thing" "Password"

Is this a limitation of the wifi module on this board? Is there a way to
initiate a reset of the module without powering down the BBB?

Thanks!

Hi Matthew,

My comments here are based on WL18xx experience rather than BBBW specifically.

For WL18xx to stay active while the host (AM335x) is suspended the WL_EN pin needs to be kept high. However if I look at am335x-boneblack-wl1835.dtsi (from 4.9.88-ti-rt-r107 which I happened to have) I can see that the wlan_pins_sleep pin mux is specifying PIN_OUTPUT_PULLDOWN for WL_EN. I would have thought it should be PIN_OUTPUT_PULLUP to keep the enable line driven high during host suspend.

I can’t comment on whether it is like this on purpose or not. Hopefully you can patch the device tree and see if that helps.

Iain

Hi Ian

Thanks for the info.
I’ve been worried that it is a “deep-down” problem with the BBBW’s hardware.

I’ve had an extended attempt at using device trees on the BBB a couple of years ago – an excercise at which I was largely unsuccessful.

I’m not sure I need to keep it alive while suspending. Even if I could get the wifi module to shutdown and restart, I think that would get me where I need to go.
But it is in some limbo state, I think, after suspend-wake. I can’t re-establish it from connman.

Suggestions welcome.

Kind regards

Matt

Hi Matt,
The problem is that the wl18xx has been shut down when WL_EN goes low
when you enter suspend, however on resume connman "thinks" everything
is normal and keeps communicating with it and just getting no
response.
I'm not sure if connmanctl actually drives the WL_EN pin when it
disables and enables. Can you try "ifconfig wlan0 down; ifconfig wlan0
up" which should force a restart of the wl18xx.
Iain

Thanks for the idea.

I tried the following:
sudo -i
rtcwake -m mem -u -t $(date +%s -d "2 minutes"); ifconfig wlan0 down; ifconfig wlan0 up

The device went to sleep, woke, but did not re-establish effective wifi.

As usual, the blue led was on, but the BeagleBone-A6XX Access Point was not visible.
I had to use a shutdown -h now to restore the AP.

Any further suggestions?

Thanks for your time.

Kind regards

Matt

Hi.

I’m having the same problem in a BBBLue: after causing the BBBLue to sleep and wake with a command like this one

/usr/sbin/rtcwake -m mem -u -t $(date +%s -d “20 minutes”)

the wifi Access Point run from the BBBlue does not restart.

Anyone has some insight in this? Thanks.

Cheers.