Wireless Daemon for Linux
 help / color / mirror / Atom feed
* how to disable colorized/grey output from iwctl commands
@ 2020-03-08 13:35 KeithG
  2020-03-10  3:47 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: KeithG @ 2020-03-08 13:35 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

I am trying to move to connman/iwd from netctl on a RPi. It currently has a
PHP based UI to display the info and allow connections, etc. Connmanctl
commands  respond with text (no control characters, no colorization) iwdctl
responds with text with control characters. If I use this command::
iwctl station wlan0 get-networks
I get a response which looks like clear txt in my linux terminal connected
by ssh, but it has control characters indicating which network is connected
and the signal strength stars are all present and are either full
brightness of grey depending on the signal. THis makes it challenging to
feed this into php to be displayed in a browser... Is there a hidden flag
to turn this off? Can this be added? If there are other suggestions on how
to best deal with this, I am soliciting advice... What I get is this in php:

sysCmd($str) ###  iwctl station wlan0 get-networks | sed -e '1,4d' | tr -s
' '
sysCmd() output: ### $data type = array
sysCmd() output: ###  ['0'] =>  Edventures psk ***ESC[1;30m*ESC[0m
sysCmd() output: ###  ['1'] =>  Oliwia2009 psk *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['2'] =>  HouseStark01 psk *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['3'] =>  ATTeHeTKI2 psk *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['4'] =>  monterrey psk *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['5'] =>  ATTxZIQ4wa psk *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['6'] =>  Wemo.Mini.25B open *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['7'] =>  xfinitywifi open *ESC[1;30m***ESC[0m
sysCmd() output: ###  ['8'] =>  ESC[1;30m> ESC[0mspg2 psk ****

I am trying to figure out how to use sed to remove the control characters,
but tit would be easier if I could just turn it off. Is there a flag? Could
one be added?

Thanks,

Gearhead

[-- Attachment #2: attachment.htm --]
[-- Type: text/html, Size: 2072 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to disable colorized/grey output from iwctl commands
  2020-03-08 13:35 how to disable colorized/grey output from iwctl commands KeithG
@ 2020-03-10  3:47 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-03-10  3:47 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Hi Keith,

On 3/8/20 8:35 AM, KeithG wrote:
> I am trying to move to connman/iwd from netctl on a RPi. It currently 
> has a PHP based UI to display the info and allow connections, etc. 
> Connmanctl commands  respond with text (no control characters, no 
> colorization) iwdctl responds with text with control characters. If I 

connman client does not use special ANSI codes, iwctl does.

> use this command::
> iwctl station wlan0 get-networks
> I get a response which looks like clear txt in my linux terminal 
> connected by ssh, but it has control characters indicating which network 
> is connected and the signal strength stars are all present and are 
> either full brightness of grey depending on the signal. THis makes it 

It should be quite straightforward to filter the ANSI escape sequences 
out.  See https://en.wikipedia.org/wiki/ANSI_escape_code

> challenging to feed this into php to be displayed in a browser... Is 
> there a hidden flag to turn this off? Can this be added? If there are 
> other suggestions on how to best deal with this, I am soliciting 
> advice... What I get is this in php:

Right now there's no flag in iwctl to turn colorization off.  Should be 
straightforward to add though.  Patches are always welcome.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-10  3:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08 13:35 how to disable colorized/grey output from iwctl commands KeithG
2020-03-10  3:47 ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox