• The forum software that supports hummy.tv will be upgraded to XenForo 2.3 on Wednesday the 20th of November 2024 starting at 7pm

    There will be some periods where the forum is unavailable, please bear with us. More details can be found in the upgrade thread.

[wireless-helper] Package to Force WiFi in Half-Awake

Black Hole

May contain traces of nut
This package dates back to at least 2011, but does not appear to have its own thread so I have started this one (and added it to the index of package topics).

The purpose of wireless-helper is to enable WiFi networking (with a compatible USB WiFi dongle fitted) when the HDR-FOX only comes up in half-awake mode (ie recording from standby). Ethernet networking works in this mode, which enables access to the WebIF etc from outside, and for the HDR-FOX CF to check in with the Remote Scheduling service (RS), but a WiFi dongle doesn't (as standard).

wireless-helper might also help in situations where a dongle isn't connecting to your home WiFi even with the HDR-FOX (or HD-FOX) fully awake, such as if the SSID is hidden.

Earliest reference found (Sep 2011):
If your Humax is usually connected to your network via wireless, then it will not connect to the wireless network when it wakes up to make a recording. You can install the wireless-helper package to change this behaviour and increase the opportunities for your Humax to check for new recordings.


Other relevant references:

 
And now the reason I raised this thread particularly:

I use my phone hot-spot to connect to my supported user's HDR+dongle, but because my phone is likely not in range (or the hot-spot isn't turned on) at the time of boot, the WiFi has nothing to connect to and then doesn't retry later.

Would there be any harm in making wireless-helper retry every few minutes?

In the absence of a mod to the wireless-helper package itself, could I use a cron task to do it? If so, details please (if possible, this is probably a better solution than modding the package - only implement it if you need it).
 
OK...

I've tried adding the following line to /mod/var/spool/cron/crontabs/root:
Code:
3/5 * * * * /sbin/wifi-up
...and rebooted, but that doesn't seem to be doing the job. I tested /sbin/wifi-up on the raw command line and that seemed to work (but the WiFi was already up), so perhaps it is my understanding of crontabs at fault - does the team agree 3/5 * * * * should execute every five minutes at 3,8,13,18...?
 
I've changed the schedule to * * * * * (ie every minute), and added logging. The dongle flashes away, but doesn't connect unless I pull it out and plug it in again.

Code:
# Log file from crontab * * * * * /sbin/wifi-up >> /mod/tmp/wifi.log
# Sensitive info redacted.

# Started up with no dongle plugged in

No wireless dongle detected.
No wireless dongle detected.

# Dongle plugged in

Wireless interface: wlan0
Already connected to 'XXXX XXX'
No link found on eth0, disabling.
Wireless interface: wlan0
Already connected to 'XXXX XXX'
No link found on eth0, disabling.

# Rebooted with hot-spot turned off

Wireless interface: wlan0
Set NetworkType=Infra
Set AuthMode=WPA2PSK
Set EncrypType=AES
Set SSID=XXXX
Set WPAPSK=77bc8309a0ddc788b9600ad3b7a047c7fabfbcd40647aa4450268172710f150c
Set SSID=XXXX

# Is this the problem?  It's not setting the right SSID,
# apparently because there's a space in it.

No link found on eth0, disabling.
DHCP:
udhcpc (v1.20.2) started
udhcpc deconfig  wlan0  0.0.0.0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
init wlan0
No wireless dongle detected.

# ^ What's that?  It doesn't seem to be repeated.

config wlan0 169.254.28.233
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Wireless interface: wlan0
Set NetworkType=Infra
Set AuthMode=WPA2PSK
Set EncrypType=AES
Set SSID=XXXX
Set WPAPSK=77bc8309a0ddc788b9600ad3b7a047c7fabfbcd40647aa4450268172710f150c
Set SSID=XXXX
No link found on eth0, disabling.
DHCP:
udhcpc (v1.20.2) started
udhcpc deconfig  wlan0  0.0.0.0
Sending discover...
give link-local address
before kill zcip if
kill zcip process  2429
init wlan0
Sending discover...
config wlan0 169.254.28.233
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
Sending discover...
Wireless interface: wlan0
Set NetworkType=Infra
Set AuthMode=WPA2PSK
Set EncrypType=AES
Set SSID=XXXX
Set WPAPSK=77bc8309a0ddc788b9600ad3b7a047c7fabfbcd40647aa4450268172710f150c
Set SSID=XXXX
No link found on eth0, disabling.
DHCP:
udhcpc (v1.20.2) started
udhcpc deconfig  wlan0  0.0.0.0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
before kill zcip if
kill zcip process  2545
init wlan0
Sending discover...
Sending discover...
config wlan0 169.254.28.233
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
Sending discover...
Sending discover...
Wireless interface: wlan0

<etc>

Wireless interface: wlan0
Set NetworkType=Infra
Set AuthMode=WPA2PSK
Set EncrypType=AES
Set SSID=XXXX
Set WPAPSK=77bc8309a0ddc788b9600ad3b7a047c7fabfbcd40647aa4450268172710f150c
Set SSID=XXXX
No link found on eth0, disabling.
DHCP:
udhcpc (v1.20.2) started
udhcpc deconfig  wlan0  0.0.0.0
Sending discover...
give link-local address
before kill zcip if
kill zcip process  4558
init wlan0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
Sending discover...
before kill zcip if
kill zcip process  4703
init wlan0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
Sending discover...
before kill zcip if
kill zcip process  4724
init wlan0
Sending discover...
give link-local address
before kill zcip if
kill zcip process  4745
init wlan0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
before kill zcip if
kill zcip process  4766
init wlan0
Sending discover...
Sending discover...
Sending discover...
Sending discover...
give link-local address
before kill zcip if
kill zcip process  4787
init wlan0
Sending discover...
Sending discover...

# Dongle unplugged

Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
Read error: Network is down, reopening socket
No wireless dongle detected.
No wireless dongle detected.

# Dongle plugged in

Wireless interface: wlan0
Already connected to 'XXXX XXX'
No link found on eth0, disabling.
Wireless interface: wlan0
Already connected to 'XXXX XXX'
No link found on eth0, disabling.
It looks like the problem is that wifi-up uses a space as a delimiter in the SSID string. I substituted an underscore in the SSID and it all starts working. This appears to be a bug, and might explain if some people have trouble with wireless-helper.
 
What's the output of iwgetid? Feel free to mask all alphanumerics in the SSID as X.
 
Oh, so somebody reading the forum is going to work out where I happen to be at any moment and hack the traffic to my phone hot-spot which isn't even turned on most of the time? I think not. The only reason I redacted the SSID is because it breaches forum anonymity.
 
It'll be a few days before I pass that way again... what are you trying to achieve?
The SSID is extracted from the output of iwgetid, but actually I see that the bug you suspected is in the later code:
Code:
ssid=`swifi ssid`
...
# should be "$ssid"
wset SSID $ssid
This is fixed in the version posted here.
 
Back
Top