PoE

NodeJS MikroTik PoE status query example

This example builds on our previous posts NodeJS Mikrotik API minimal example and MikroTik RouterOS: How to power-cycle PoE using the terminal.

The following code will print the PoE status on Port ether5 on the given MikroTik device using the MikroTik API.

import * as MikroNode from 'mikrotik' ;

const host = "192.168.88.1";
const username = "admin";
const password = "admin1234"; // Hope that's not your real password ;)

const connection = MikroNode.getConnection(host, username, password, {
    closeOnDone : true
});

connection.getConnectPromise().then(function(conn) {
    conn.getCommandPromise(['/interface/ethernet/poe/print', '?name=ether5']).then(values => {
        console.log(values);
    }, reason => {
        console.log('Error while running command: ' + JSON.stringify(reason));
    });
}).catch(reason =>  {
    console.log('Error while connecting: ' + JSON.stringify(reason));
});

Example output:

[
  {
    '.id': '*5',
    name: 'ether5',
    'poe-out': 'forced-on',
    'poe-priority': '10',
    'poe-lldp-enabled': 'false',
    'power-cycle-ping-enabled': 'false',
    'power-cycle-interval': 'none',
    '.about': 'poe-out status: power_reset'
  }
]

If the PoE is currently being power-cycled, this will print:

[
  {
    '.id': '*5',
    name: 'ether5',
    'poe-out': 'forced-on',
    'poe-priority': '10',
    'poe-lldp-enabled': 'false',
    'power-cycle-ping-enabled': 'false',
    'power-cycle-interval': 'none',
    '.about': 'poe-out status: power_reset'
  }
]

 

Posted by Uli Köhler in MikroTik, NodeJS, PoE

How to enable/disable PoE ports using pySNMP on the Netgear GS710TUP

In our previous post How to use pySNMP to query SNMPv3 information from Netgear GS710TUP we showed how to connect pySNMP to the Netgear GS710TUP to query simple informaton.

The following example script is the pySNMP equivalent to How to enable/disable PoE port power using SNMPv3 on the Netgear GS710TUP : It sets the relevant OID in 1.3.6.1.2.1.105.1.1.1.3 (pethPsePortAdminEnable).

The following OIDs for individual ports are available for the GS710TUP which has 8 PoE ports:

1.3.6.1.2.1.105.1.1.1.3.1.1 # Port 1
1.3.6.1.2.1.105.1.1.1.3.1.2 # Port 2
1.3.6.1.2.1.105.1.1.1.3.1.3 # Port 3
1.3.6.1.2.1.105.1.1.1.3.1.4 # Port 4
1.3.6.1.2.1.105.1.1.1.3.1.5 # Port 5
1.3.6.1.2.1.105.1.1.1.3.1.6 # Port 6
1.3.6.1.2.1.105.1.1.1.3.1.7 # Port 7
1.3.6.1.2.1.105.1.1.1.3.1.8 # Port 8

In our example, we’ll enable the power to port 1:

import pysnmp.hlapi as snmp

portNumber = 1

iterator = snmp.setCmd(
    snmp.SnmpEngine(),
    snmp.UsmUserData('admin', 'SWITCH_ADMIN_PASSWORD',
                     authProtocol=snmp.usmHMACSHAAuthProtocol,
                     privProtocol=snmp.usmNoPrivProtocol),
    snmp.UdpTransportTarget(('SWITCH_IP_ADDRESS', 161)),
    snmp.ContextData(),
    snmp.ObjectType(
        snmp.ObjectIdentity(f'1.3.6.1.2.1.105.1.1.1.3.1.{portNumber}'),
        snmp.Integer(1))
)

errorIndication, errorStatus, errorIndex, varBinds = next(iterator)

if errorIndication:
    print(errorIndication)
elif errorStatus:
    idx = int(errorIndex) - 1
    location = errorIndex and varBinds[idx][0] or '?'
    print(f"{errorStatus.prettyPrint()} at {location}")
else: # Success
    for varBind in varBinds:
        print(' = '.join([x.prettyPrint() for x in varBind]))

In order to disable power on port 1, replace

snmp.Integer(1)

by

snmp.Integer(2)

Note that an 1 value represents boolean true (as in enable PoE output) whereas 2 represents boolean false, disabling PoE output on the port.

Posted by Uli Köhler in Networking, PoE, Python, SNMP

How to enable/disable PoE port power using SNMPv3 on the Netgear GS710TUP

In our previous post How to query if PoE ports are enabled using SNMPv3 on the Netgear GS710TUP we showed how to use snmpwalk to check whether PoE power is enabled on the GS710TUP.

In this post we’ll show how to enable port on

The relevant OID is 1.3.6.1.2.1.105.1.1.1.3 (pethPsePortAdminEnable), therefore the OID for a given port number 1...8 is

1.3.6.1.2.1.105.1.1.1.3.1.PORTNUMBER

i.e. the following OIDs are available for the GS710TUP which has 8 PoE ports:

1.3.6.1.2.1.105.1.1.1.3.1.1 # Port 1
1.3.6.1.2.1.105.1.1.1.3.1.2 # Port 2
1.3.6.1.2.1.105.1.1.1.3.1.3 # Port 3
1.3.6.1.2.1.105.1.1.1.3.1.4 # Port 4
1.3.6.1.2.1.105.1.1.1.3.1.5 # Port 5
1.3.6.1.2.1.105.1.1.1.3.1.6 # Port 6
1.3.6.1.2.1.105.1.1.1.3.1.7 # Port 7
1.3.6.1.2.1.105.1.1.1.3.1.8 # Port 8

We can therefore enable power on port 1 by using the following command:

snmpset -v3 -l authNopriv -c public -a SHA1 -u admin -A 'switchAdminPassword' SWITCHIPADDRESS 1.3.6.1.2.1.105.1.1.1.3.1.1 i 1

or disable power on port 1:

snmpset -v3 -l authNopriv -c public -a SHA1 -u admin -A 'switchAdminPassword' SWITCHIPADDRESS 1.3.6.1.2.1.105.1.1.1.3.1.1 i 2

Remember to replace switchAdminPassword by the admin password of your switch and SWITCHIPADDRESS by the IP address of the switch.

i tells snmpset to set an INTEGER1 represents true while 2 represents false.

Example output for enabling power on port 1 successfully:

SNMPv2-SMI::mib-2.105.1.1.1.3.1.1 = INTEGER: 1
Posted by Uli Köhler in Networking, PoE, SNMP

How should a PoE flyback transformer look on the oscilloscope

Measure at the pin not connected to the 48VDC line i.e. the pin of the transformer connected to the MOSFET / integrated flyback regulator IC (If unsure, try it out).

Depending on how exactly the IC works and the load (and the circuitry), these waveforms look quite differently. So the following pictures are mostly for basic reference.

Posted by Uli Köhler in Electronics, EMI, PoE

Is your PD device 802.3bt PoE++ Type-3 or Type-4?

Note: Do NOT confuse Type-3 or Type-4 with PoE class 3 and class 4!

If your PD uses a maximum of 51W (class 1-6 – up to 60W at the PSE), your device is Type 3. If your device uses 62W or 71.3W (class 7 or 8 – 75W or 90W at the PSE), your device is Type 4.

In case your device uses more than 71.3W (or 90W at the PSE), your use-case is not covered by IEEE 802.3bt aka PoE++.

Note that “uses” does not refer to the actual power draw of your device but whatever class you present during the PoE classification process. Typically, this is configured using a resistor, depending on your PoE PD controller.

For reference, see this Ethernet Alliance Whitepaper

Posted by Uli Köhler in Electronics, Networking, PoE

Does 802.3bt PoE++ work with 2-pair power or does it require 4-pair power?

802.3bt always requires four pairs for power >= 40W (class 5+) and does not support powering over two pairs. Powering 2-pair devices using 802.3bt will only when powering devices with up to 30W (i.e. in “802.3at backwards-compatible” mode).

For reference see this whitepaper by the Ethernet Alliance.

Posted by Uli Köhler in Electronics, Networking, PoE

What does “PSE” mean in PoE / Power over Ethernet context?

PD means Power sourcing equipment. This refers to a device which injects power in a PoE port – in other words, it provides Power over Ethernet as opposed to a PD (powered device) that consumes power injected by a Power sourcing equipment device.

Also see: What does “PD” mean in PoE / Power over Ethernet context?

Posted by Uli Köhler in Electronics, Networking, PoE

What does “PD” mean in PoE / Power over Ethernet context?

PD means Powered device. This refers to a device which is powered by a PoE port – in other words, it consumes Power over Ethernet as opposed to a PSE (power sourcing equipment) that injects power that can be consumed by powered devices.

Also see: What does “PSE” mean in PoE / Power over Ethernet context?

Posted by Uli Köhler in Electronics, Networking, PoE