You are not logged in.

#1 2012-10-20 06:50:22

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Systemd Wireless Parameters

In order to run my broadcom wireless connection with NetworkManager I need to run

iwconfig eth1 power off

I added this to rc.local and everything works fine. Switching to Systemd mean that rc.local will not be run when I remove initscripts.

So my question is where should I run this command on start up/resume under Systemd?

Thanks

Andrew

Offline

#2 2012-10-20 07:32:55

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Systemd Wireless Parameters

I think there are a number of places you may do this.  Maybe have udev run the command through a rule once it determines that the device is present... Personally I use netcfg, and so I would use the PREUP parameter.  But I am not so familiar with network manager... I just find it a bit much for my simple network usage.  But that's me.

Offline

#3 2012-10-20 11:43:16

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

Thanks for the reply. I agree that there are several places I could do this, but I was interested in where is the right place under Systemd to run this command on start up/resume

Offline

#4 2012-10-20 11:54:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Systemd Wireless Parameters

(EDIT: the below seemed to be the recommended method at the time it was originally posted - but as this thread is alive again I should note that (AFAIK) tmpfiles are no longer encouraged for this use - but then "AFAIK" isn't very far on this.)

tmpfiles have replaced rc.local commands.

`man tmpfiles.d`

Last edited by Trilby (2013-01-05 23:43:48)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-10-20 13:11:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Systemd Wireless Parameters

Just so it is clear, you know that rc.local was never the "right" place to do such a thing in the first place.  It was just super convenient.

Offline

#6 2012-10-20 14:14:55

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Systemd Wireless Parameters

Adding to WonderWoofy's comment:
For this case (permanently turning off powersaving of the wifi-device), I would say the best place is to find out which module option you have to pass to your broadcom module

modinfo <yourbroadcommodule>

to turn powersaving off, then create a conf-file one-liner for it under /etc/modules-load.d/
Afaik that's where systemd will reference anytime the module is loaded (be it boot, resume, ifplug, ...).

Iwconfig (better use iw now) is for runtime changes to it (and also was, though using rc.local was of course convenient).

Offline

#7 2012-10-20 14:25:06

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Systemd Wireless Parameters

If there is a modprobe variable to turn the powersaving off, put it in /etc/modprobe.d, not modules-load.d.  The former is for specifying options with modules, the latter is for specifying modules you wish to have loaded. 

If you wish to add options to modules that are loaded by your initramfs, you must ensure you have the appropriate modprobe.d file listed in your mkinitcpio.conf.  For instance, if I wanted to set early kms (which I have to for my screen to work), as well as specify module options for it, I would ahve to create /etc/modprobe.d/i915.conf with the necessary settings.  Then add FILES="/etc/modprobe.d/i915.conf" to my mkinitpcio.conf and then of course rebuild my mkinitcpio.

Offline

#8 2012-10-20 15:40:36

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Systemd Wireless Parameters

Thanks for clarifying, it made me re-read the wiki on it. What I wrote about modules-load.d being used on "ifplug" should be wrong then also. Specifying the module there, would make it be statically loaded regardless of the device (usb-wifi) being plugged in or not, whereas modprobe.d be referenced on the dynamic loading.
Still it's a bit lame if one can't specify the module options in the same conf file used to trigger the module load.

Offline

#9 2012-10-20 17:48:19

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: Systemd Wireless Parameters

Strike0 wrote:

Still it's a bit lame if one can't specify the module options in the same conf file used to trigger the module load.

Most modules load without any conf file to "trigger" their loading (they either load automatically or you load them yourself on the commandline). Also, the conf files are for two entirely different tools - modules.load.d is used by the init system, modprobe.d is used by kmod.

Offline

#10 2012-10-21 07:34:16

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

Many thanks for all the replies and help. I am still not sure where I should run a startup script under systemd.

My broadcom module is broadcom-wl.

$ modinfo wl
filename:       /lib/modules/3.5.4-1-ARCH/extramodules/wl.ko.gz
license:        Mixed/Proprietary
alias:          pci:v000014E4d00000576sv*sd*bc*sc*i*
alias:          pci:v000014E4d0000435Asv*sd*bc*sc*i*
alias:          pci:v000014E4d00004359sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004358sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004727sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004357sv*sd*bc*sc*i*
alias:          pci:v000014E4d0000A99Dsv*sd*bc*sc*i*
alias:          pci:v000014E4d00004353sv*sd*bc*sc*i*
alias:          pci:v000014E4d0000432Dsv*sd*bc*sc*i*
alias:          pci:v000014E4d0000432Csv*sd*bc*sc*i*
alias:          pci:v000014E4d0000432Bsv*sd*bc*sc*i*
alias:          pci:v000014E4d0000432Asv*sd*bc*sc*i*
alias:          pci:v000014E4d00004329sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004328sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004315sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004313sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004312sv*sd*bc*sc*i*
alias:          pci:v000014E4d00004311sv*sd*bc*sc*i*
depends:        cfg80211,lib80211
vermagic:       3.5.3-1-ARCH SMP preempt mod_unload modversions
parm:           oneonly:int
parm:           piomode:int
parm:           instance_base:int
parm:           nompc:int
parm:           name:string

I am not sure that I can turn off the power from the module parameters above. If I can then that would be the best answer I think.

I thought rc.local was used to run startup scripts, that is what it says anyway, so that is where I put it.

Trilby wrote:

tmpfiles have replaced rc.local commands.

This does not seem to be the right place to run a simple script on startup

Could it be that systemd does not have a "right" place?

Offline

#11 2012-10-21 10:17:12

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Systemd Wireless Parameters

If meant as "one 'right' place", then definetely. I guess we got used quite a lot to the old init-system, which built bridges in /etc to achieve that.

As for the power-saving, that "wl" blob does not really do a proper documentation as modinfo shows, sorry for that - but other modules do list the appropriate options there. A quick google did not bring me further either. Maybe someone else reading has the right parameter, it should be the same for all instances / devices using that module.

You can easily test some parameters with likely possibilities by

modprobe -r wl 
modprobe wl PM=0

Then have a look with whether power-saving is turned on or not. Options like e.g. "PM", "power-save", "power_save" the parameter value "0" should be "turn off" always. Good luck with that.

Offline

#12 2012-10-21 13:59:18

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

Thanks - that is good advice as usual.

Thanks to all for the replies

Andrew

Offline

#13 2013-01-05 21:19:14

01walid
Member
Registered: 2012-12-30
Posts: 7

Re: Systemd Wireless Parameters

fdservices wrote:

Thanks - that is good advice as usual.

Thanks to all for the replies

Andrew

Could you please tell us what command/workaround worked with you ?

Offline

#14 2013-01-06 12:31:41

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

Happy to.

What is it that you want to do exactly, the discussion seemed to turn into rather a general one on how to run commands on systemd start up.

I did find that I no longer needed to turn off  the power for the module to work on my system.

Andrew

Offline

#15 2013-01-06 13:27:34

01walid
Member
Registered: 2012-12-30
Posts: 7

Re: Systemd Wireless Parameters

fdservices wrote:

Happy to.

What is it that you want to do exactly, the discussion seemed to turn into rather a general one on how to run commands on systemd start up.

I did find that I no longer needed to turn off  the power for the module to work on my system.

Andrew

I have a broadcom wireless connection as well, and I'm struggling with wireless dropping occasionally, especially when I plug/unplug the AC power or when moving the laptop. and that forces me to reboot in order to get the connection back, whether network manager or wicd or whatever. 
I didn't find any answer and no solution worked, I want to turn off the power as you did to check to see if it will succeed, as that is my last hope.
I want to know as well if there is any solution to restart to whole wireless stuff without rebooting ?
I'm using the broadcom-wl module (after trying the other/free alternatives).

P.S. this happens on Windows7 too, but getting the connection back just after rebooting the laptop excludes hardware failure as we may guess, IMHO.
Thank you,
Walid.

Last edited by 01walid (2013-01-06 14:51:07)

Offline

#16 2013-01-07 08:57:35

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

OK.
The broacom-wl module is often a problem, I use it because it works in concert with the broadcom bluetooth module, but if you do not use bluetooth or do not have the broadcom bluetooth adapter, then I would opt for the open source module.

If you want try turning off the power just execute the command

# iwconfig eth1 power off

and then check that it has been turned off with

# iwconfig
eth1      IEEE 802.11abg  ESSID:"Lantech"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:50:18:3B:D2:5A   
          Bit Rate=54 Mb/s   Tx-Power=200 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=59/70  Signal level=-51 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Now see if that has done the job. if it has then you will just need to make the change permanent, if not we need to find a different answer.

Cheers

Andrew

Offline

#17 2013-01-09 15:40:29

01walid
Member
Registered: 2012-12-30
Posts: 7

Re: Systemd Wireless Parameters

fdservices wrote:

OK.
The broacom-wl module is often a problem, I use it because it works in concert with the broadcom bluetooth module, but if you do not use bluetooth or do not have the broadcom bluetooth adapter, then I would opt for the open source module.

If you want try turning off the power just execute the command

# iwconfig eth1 power off

and then check that it has been turned off with

# iwconfig
eth1      IEEE 802.11abg  ESSID:"Lantech"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:50:18:3B:D2:5A   
          Bit Rate=54 Mb/s   Tx-Power=200 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=59/70  Signal level=-51 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Now see if that has done the job. if it has then you will just need to make the change permanent, if not we need to find a different answer.

Cheers

Andrew

It already shows that power management is off hmm

Offline

#18 2013-01-09 17:04:32

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Systemd Wireless Parameters

OK, that is not the problem then. If you do not use bluetooth then try the open source driver , Problems with the wireless dropping when moving the laptop may be due to injudicious touching of the wireless switch on the case. Check this is firmly on and does not move. Which network manager do you use? NetworkManager?

Andrew

Offline

#19 2013-01-09 19:57:19

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: Systemd Wireless Parameters

Also check for any BIOS settings regarding ACPI and a BIOS update. If the error happens in Windows as well, it sounds like a BIOS problem. 

As for the manual restart of the wireless without rebooting. Even though it is no solution, you can surely do that. Probably it is a matter of stopping the wireless manager you use, unloading the wl module and modprobing it again. If you read the wireless-wiki here on the manual method to connect, you will know the steps without a wireless manager even. Then sketch yourself a script to run when the device crashes.

Offline

Board footer

Powered by FluxBB