WLAN signal strength meter through audio?

How to convert a wireless signal strength into an audio signal?
Does an audio WLAN strength meter exist?

I wand to adjust a directed WLAN antenna mounted on the outside of a shed, but I cannot see the PC display inside when I am at the antenna. So it would be nice if I could get an immediate WLAN signal strength reading through a sound signal, so that I can adjust the directed antenna towards the router by listening.

(Note: I only need this once, so a simple hack would do.)

I want to replace my standard WLAN antenna (already mounted outside) with a directed TP-Link TL-ANT2409A 2,5GHz antenna. The normal antenna works in principle, showing less than half the signal strength bars in the knetworkmanager. However, the connection breaks down in poor weather or if video is added to a VoIP call.

I see no technical usefull help is forthcoming the last 22 hours. Personaly I doubt such a thing exists. But couldn’t yuo solve this by asking a neighbour/friend/family to help you for that once in a lifetime action? Even if you have to offer a beer in return, that seems the quickest solution to me.

I allways though Hessen is full of nice, technical capable people (that love to help for a Maß). lol!

On 2014-01-31 13:56, STurtle wrote:
> (Note: I only need this once, so a simple hack would do.)

If there is a CLI command that gives signal strength as text, then it is
doable, yes.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2014-02-01 14:18, Carlos E. R. wrote:
> On 2014-01-31 13:56, STurtle wrote:
>> (Note: I only need this once, so a simple hack would do.)
>
> If there is a CLI command that gives signal strength as text, then it is
> doable, yes.

I see this:


> minas-tirith:~ # cat /proc/net/wireless
> Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
>  face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
>  wlan0: 0000   69.  -41.  -256        0      0      0      0      3        0
> minas-tirith:~ #


The “Quality” section looks interesting. You can concoct a script to
separate those three values (grep for wlan0, then “cut”), and then have
the machine read them aloud:


echo "69.  -41.  -256" | espeak -v en --stdin -a 20 -w tempfile
gst123 --verbose tempfile

This can be polished more, and run in a loop.

:slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Realy nice. You earn the beer. Were it only for the suggestion.

Nice idea Carlos. Something like that avoids the tempfile

cat /proc/net/wireless | grep wlp2s0 | awk '{print $3}' | espeak -v en --stdin -a 20

(wlp2s0 is my wireless, has to be replaced of course)

This one works for me


#!/bin/bash
while :
do
    echo "Press [CTRL+C] to stop.."
    cat /proc/net/wireless \
    | grep wlp2s0 \
    | awk '{print $3}' \
    | espeak -v de --stdin -a 20
    sleep 3
done

(I tested in german so espeak has here de instead of en)

On 2014-02-01 14:56, martin helm wrote:
>
> Nice idea Carlos.

Thanks :slight_smile:

> Something like that avoids the tempfile
>
> Code:
> --------------------
> cat /proc/net/wireless | grep wlp2s0 | awk ‘{print $3}’ | espeak -v en --stdin -a 20
> --------------------
>
> (wlp2s0 is my wireless, has to be replaced of course)

The tempfile I use because I had at some time problems with pulseaudio
and the volume used. I use something similar to “speak” the local time
every half hour, from a cron job. A talking clock, you see :slight_smile:

This I used time ago:


/bin/date +"%B %e, %k hours %-M minutes " | /usr/bin/festival --tts

or this for Spanish:


> LANG=es_ES.ISO-8859-1 LC_ALL=es_ES.ISO-8859-1 /bin/date +"Es %e de %B, y son las %k horas y %-M minutos " | /usr/bin/festival --tts --language spanish


but festival does not use pulse, and thus failed if something else was
holding audio. Festival produces better output than espeak, but can not
be directed (or not easily) to a file. So I used “espeak” instead:


.... espeak -v en --stdin -a 20

but it had the problem of using full volume, despite the “-a” (bug at
some time?)


.... espeak -v en --stdin -a 20 -w fichero.wav

but did not work from inside cron. It needed at least
“ALSA_CONFIG_PATH=/etc/alsa-pulse.conf”, and was unreliable.

Then I turned to generating a tempfile instead, and playing it separately:


paplay -v tmpfile

This had some other problem I don’t remember (it is not in my notes).
Thus my final version was:


gst123 --verbose tempfile

or rather the silent version for cronjobs.

Long story :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Thanks to everyone contributing to solve this! It worked perfectly fine! :slight_smile:

As for the reason why I asked:

I got the idea from an old article in a German IT Journal: the article (c’t 2008, german) describes the construction of a cheap directional antenna and recommended two Windows tools that conveys signal strength through an audio pitch in order to adjust the antenna. I had constructed that antenna, but the linked Windows tools did not work anymore, due to .net versions being incompatible. So I asked a friend for help indeed. That DIY-antenna worked fine up until icicles grew on it, so I decided to buy the proper directional antenna.

However, it kept bugging me these Windows tools would not work, and that I could not find an equivalent for Linux. I hate to boot Windows, and even more so if it is pointless.

I suspected that it ought to be easy for Linux, no need for clumsy frameworks like .net, and I simply wanted to learn how it is done. So now that the problem actually arose a second time, I eventually decided to ask about it here. So my primary true reason why I asked was learning about the possibilities of the Linux CLI along the way. I actually think that the proposed solution will come in handy for lots of other things in the future. Many thanks for the help!

On 2014-02-07 15:56, STurtle wrote:
> and I wanted
> to learn how it is done. So my primary true reason why I asked was
> learning about the possibilities of the Linux CLI along the way
. I
> actually think that the proposed solution will come in handy for lots of
> other things in the future. Many thanks for the help!

Welcome! :slight_smile:

The traditional Linux idea (older actually, from Unix, I think) is to
have many small programs that do their tasks correctly. The other idea
is that you can use them as bricks to build your house. Or like a
Meccano building blocks.

If you don’t have an exact program that does what you want, you can
probably chain a few of them to get it done.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))