TSW202 PoE power usage via CLI/SSH

Hi,

I found this post: Tsw202 PoE power consumption via cli but unfortunately it was never resolved. I am trying to read out the PoE power usage via CLI but I seem unable to do so.

I have run ubus list and I get:

boardjson
dnsmasq
dnsmasq.dns
file
hostapd
hotplug.dhcp
hotplug.ieee80211
hotplug.iface
hotplug.neigh
hotplug.net
hotplug.ntp
hotplug.tftp
ip_block
lan_info
log
mnfinfo
network
network.bonding
network.device
network.interface
network.interface.loopback
network.interface.static
network.interface.static_vlan2
network.interface.static_vlan3
network.rrdns
network.wireless
poeman
port_events
rc
rms
rpc-sys
rut_fota
service
session
sys
system
tswconfig
tswconfig.cable_diag
tswconfig.eee
tswconfig.isolation
tswconfig.l2
tswconfig.lldp
tswconfig.mirror
tswconfig.mtu
tswconfig.qos
tswconfig.rate
tswconfig.rstp
tswconfig.stats
uci
uhttpd
wpa_supplicant

Running ubus call tswconfig.poe get returns Command failed: Not found.

Could you please help me get this working?

Of course, as soon as I asked this I worked it out.

There is an interesting item in the list poeman. You can interrogate the items in the list using ubus -v list poeman. From this, I found that there is a method dump. Therefore, running ubus call poeman dump gives the useful data:

{
	"ports": [
		{
			"name": "lan1",
			"index": 4,
			"port_state": 1,
			"class": "4",
			"current": 126,
			"voltage": 53.028000,
			"temperature": -1
		},
		{
			"name": "lan2",
			"index": 3,
			"port_state": 0,
			"class": "Unknown",
			"current": 5,
			"voltage": 0.560000,
			"temperature": -1
		},
		{
			"name": "lan3",
			"index": 2,
			"port_state": 0,
			"class": "Unknown",
			"current": 5,
			"voltage": 0.560000,
			"temperature": -1
		},
...

Though unfortunately I don’t know what units the current is in (I’m going to assume mA)

Hi,

For most stable way between versions it is recommended to use API. So via CLI it would be api get /ports_settings/status or api get /ports_settings/status/{port id} for any specific port. poe_enable - is poe enabled, power - is poe being used, budget - current in mA

Hello @jeremy1,

Kindly confirm whether the issue has been resolved or if you require any further assistance.

Best regards,

This topic was automatically closed after 60 days. New replies are no longer allowed.