Reserved Ports

Is there anywhere a list of TCP/UDP ports that are reserved for use by Hubitat and should not be used by developers???

I am curious... Just how would a developer create an App or Driver that could listen on a port? I am pretty sure Hubitat does not really allow that, unless something has changed?

I know the hub listens on ports 80, 8080, 8081, and 39501. There may be a few others, but I am not sure.

If you send out a UDP packet on a port, HE can listen for a reply on that same port.

If a packet hits a pocket on a socket on a port, 
and the bus is interrupted at a very last resort, 
and the access of the memory makes your floppy disk abort, 
then the socket packet pocket has an error to report.

Outgoing ports are typically auto-assigned by the operating system, which chooses an unused port.

Here's what I have...

private read() {
  byte[] rawBytes = [0xF1, 0x00, 0x00, 0xA4]
  String stringBytes = hubitat.helper.HexUtils.byteArrayToHexString(rawBytes)
  def myHubAction = new hubitat.device.HubAction(
        stringBytes,
        hubitat.device.Protocol.LAN,
        [
             type              : hubitat.device.HubAction.Type.LAN_TYPE_UDPCLIENT,
             destinationAddress: "192.168.199.59:1337",
             encoding          : hubitat.device.HubAction.Encoding.HEX_STRING,
             ignoreResponse    : false,
             parseWarning      : true,
             timeout           : 10,
		     callback          : parseUDP
        ]
  )
  sendHubCommand(myHubAction)    
}

def parseUDP(message) {  
  log.debug "Got something to parseUDP"
  log.debug "UDP Response -> ${message}"    
}

I'm expecting to get a response back in on port 1337 - and I get nothing. I'm trying to track down what's happening and I then thought - "What if 1337 is being used internally by HE?"

Why?

That’s the udp port at the destination address. Not the outgoing port used on the HE to connect to that destination port.

2 Likes

Will the response not come back to 1337??? Or it comes back to the outgoing port???

This.

2 Likes