Is the're a way to control PoE from the linux command line ? I would like to do a script to remote reset a Cambium ePMP via power cycle method.
Thanks
PoE on/off from cmdline
-
jakematic - Experienced Member
- Posts: 168
- Joined: Thu Jul 14, 2016 8:15 am
- Location: NC USA
- Has thanked: 362 times
- Been thanked: 87 times
Re: PoE on/off from cmdline
I asked about this in September but didn't get an answer.
Maybe I stepped into a proprietary area ?
Maybe I stepped into a proprietary area ?
jakematic wrote:Thought the netonixctl command *might* be the proper way to control the port power at command line.
Tried but get i2c errors, and didn't want to break anything fiddling.
- Code: Select all
admin@ws12:/usr/bin# netonixctl -h
Usage: netonixctl [-hv] [--pin <num>=<0|1>] | [--poe <port>=<off|24v|48v|48vh> ...] | [--poe_led <port>=<off|24v|48v|48vh> ...]
--poe: set PoE on ports
--poe_led: Set PoE leds on ports
--pin: Set GPIO pin
-v: Verbose
-h: Display this
admin@ws12:/www# netonixctl --poe_led 7=off
netonixctl[499]: i2c_read failed after 5 tries: Failed reading data to slave
netonixctl[499]: i2c_write failed after 5 tries: Failed writing data to slave
netonixctl[499]: i2c_read failed after 5 tries: Failed reading data to slave
netonixctl[499]: i2c_read failed after 5 tries: Failed reading data to slave
-
Eric Stern - Employee
- Posts: 532
- Joined: Wed Apr 09, 2014 9:41 pm
- Location: Toronto, Ontario
- Has thanked: 0 time
- Been thanked: 130 times
Re: PoE on/off from cmdline
To power cycle port 11:
touch /tmp/poe_override/11
This is the equivalent of doing a port bounce from the UI.
touch /tmp/poe_override/11
This is the equivalent of doing a port bounce from the UI.
-
jakematic - Experienced Member
- Posts: 168
- Joined: Thu Jul 14, 2016 8:15 am
- Location: NC USA
- Has thanked: 362 times
- Been thanked: 87 times
Re: PoE on/off from cmdline
Eric Stern wrote:To power cycle port 11:
touch /tmp/poe_override/11
This is the equivalent of doing a port bounce from the UI.
This is great Eric, thanks.
But is there no way to turn POE on/off from the cmdline ?
I understand there are diagnostics that should run etc... just would like something that I can automate.
-
sirhc - Employee
- Posts: 7415
- Joined: Tue Apr 08, 2014 3:48 pm
- Location: Lancaster, PA
- Has thanked: 1608 times
- Been thanked: 1325 times
Re: PoE on/off from cmdline
You do realize that there is a COMPLETE CLI that can do everything?
Do you have to drop to Linux level because the CLI via SSH can do everything?
Can you not script your system to execute CLI commands?
Do you have to drop to Linux level because the CLI via SSH can do everything?
Can you not script your system to execute CLI commands?
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
-
mike99 - Associate
- Posts: 837
- Joined: Tue Nov 25, 2014 10:53 am
- Location: Quebec, Canada
- Has thanked: 95 times
- Been thanked: 245 times
Re: PoE on/off from cmdline
Thanks Eric,
I didn't have time to check this out but like jakematic, I really need to shut down port and not bounce it since, for resetting the radio, power must be turn off for 3~5 seconds. I had in mind to use sleep 4 unless I change port bounce time off to 4 seconds ?
Chris, maybe with expect but I think that most sysadmin are more familiar with sh or bash than expect. Personnaly, I never use expect even if I know about it, how it's work, etc.
I didn't have time to check this out but like jakematic, I really need to shut down port and not bounce it since, for resetting the radio, power must be turn off for 3~5 seconds. I had in mind to use sleep 4 unless I change port bounce time off to 4 seconds ?
Chris, maybe with expect but I think that most sysadmin are more familiar with sh or bash than expect. Personnaly, I never use expect even if I know about it, how it's work, etc.
-
jakematic - Experienced Member
- Posts: 168
- Joined: Thu Jul 14, 2016 8:15 am
- Location: NC USA
- Has thanked: 362 times
- Been thanked: 87 times
Re: PoE on/off from cmdline
sirhc wrote:You do realize that there is a COMPLETE CLI that can do everything?
Do you have to drop to Linux level because the CLI via SSH can do everything?
Can you not script your system to execute CLI commands?
The trouble is if you want to automate anything you get dropped to Linux on a password-less ssh by adding your key to /etc/dropbear/authorized_keys
- Code: Select all
root@ubu:/Fedora# ssh admin@192.168.0.30 show config
ash: show: not found
root@ubu:/Fedora# ssh admin@192.168.0.30 df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 5760 5760 0 100% /
/dev/root 5760 5760 0 100% /rom
/dev/mtdblock6 4352 1272 3080 29% /jffs
mini_fo:/jffs 5760 5760 0 100% /
Open to suggestions on other ways to do it.
-
Eric Stern - Employee
- Posts: 532
- Joined: Wed Apr 09, 2014 9:41 pm
- Location: Toronto, Ontario
- Has thanked: 0 time
- Been thanked: 130 times
Re: PoE on/off from cmdline
1. Grab the config (scp /www/config.json)
2. Modify the config locally to turn off PoE (this should be easy to figure out)
3. Upload the new config (scp)
4. Apply the new config (cd /www; php-cli config.php --apply)
2. Modify the config locally to turn off PoE (this should be easy to figure out)
3. Upload the new config (scp)
4. Apply the new config (cd /www; php-cli config.php --apply)
-
sirhc - Employee
- Posts: 7415
- Joined: Tue Apr 08, 2014 3:48 pm
- Location: Lancaster, PA
- Has thanked: 1608 times
- Been thanked: 1325 times
Re: PoE on/off from cmdline
jakematic wrote:Well.... sed ain't gonna work on that file!
I too would NOT mess with the JASON file as any format error can bonk the switch.
This has been a source of heated debate internally that Eric needs to put in routines to deal with corrupted or improperly formatted config files but as far as I know once it hits something incorrect it just stops reading the config file.
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.
Who is online
Users browsing this forum: Google [Bot] and 17 guests