New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

things: Samsung Smart Airconditioner not found via SSDP #100

Closed
CloCkWeRX opened this Issue Jan 1, 2014 · 44 comments

Comments

Projects
None yet
3 participants
@CloCkWeRX
Contributor

CloCkWeRX commented Jan 1, 2014

From https://plus.google.com/114910530124691879879/posts/JoubffVMfd6

Expected

192.168.1.15 should appear as an air conditioner, offering a number of operations (on, off, set temp, etc). Here's an early session, recorded with wireshark ofthe phone app and air con speaking.

Phone:

NOTIFY * HTTP/1.1
LOCATION: 192.168.1.2
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=20
SERVER: AIR CONDITIONER
MAC_ADDR: 98:0c:82:f4:d4:5c
SPEC_VER: MSpec-1.00
SERVICE_NAME: ControlServer-MLib
MESSAGE_TYPE: CONTROLLER_START

... and the air conditioner starts to respond:

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE

Actual

$ node list-ssdp.js > out.txt

produces only the router in my network

SSDP listening on http://0.0.0.0:41383
SSDP response
{ rinfo: { address: '192.168.1.1', family: 'IPv4', port: 1900, size: 259 } }

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 259 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'upnp:rootdevice',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-4858002808e0::upnp:rootdevice' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 268 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-4858002808e0' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 331 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:device:InternetGatewayDevice:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-4858002808e0::urn:schemas-upnp-org:device:InternetGatewayDevice:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 323 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:service:Layer3Forwarding:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-4858002808e0::urn:schemas-upnp-org:service:Layer3Forwarding:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 268 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'uuid:0000e0d8-20a0-00e0-80a0-485801282808',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485801282808' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 307 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:device:WANDevice:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485801282808::urn:schemas-upnp-org:device:WANDevice:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 339 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485801282808::urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 268 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'uuid:0000e0d8-20a0-00e0-80a0-485802286048',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485802286048' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 327 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:device:WANConnectionDevice:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485802286048::urn:schemas-upnp-org:device:WANConnectionDevice:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

{ address: '192.168.1.1', family: 'IPv4', port: 1900, size: 323 }
{ Server: 'Custom/1.0 UPnP/1.0 Proc/Ver',
  EXT: '',
  Location: 'http://192.168.1.1:5431/dyndev/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0',
  'Cache-Control': 'max-age=1800',
  ST: 'urn:schemas-upnp-org:service:WANPPPConnection:1',
  USN: 'uuid:0000e0d8-20a0-00e0-80a0-485802286048::urn:schemas-upnp-org:service:WANPPPConnection:1' }
{"root":{"xmlns":"urn:schemas-upnp-org:device-1-0","specVersion":{"major":1,"minor":0},"URLBase":"http://192.168.1.1:5431/","device":{"deviceType":"urn:schemas-upnp-org:device:InternetGatewayDevice:1","presentationURL":"http://192.168.1.1:80/","friendlyName":"NetComm 11n Wireless ADSL Router","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-4858002808e0","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:Layer3Forwarding:1","serviceId":"urn:upnp-org:serviceId:Layer3Forwarding:11","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-4858002808e0/Layer3Forwarding:1","SCPDURL":"/dynsvc/Layer3Forwarding:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485801282808","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1","serviceId":"urn:upnp-org:serviceId:WANCommonIFC1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485801282808/WANCommonInterfaceConfig:1","SCPDURL":"/dynsvc/WANCommonInterfaceConfig:1.xml"}},"deviceList":{"device":{"deviceType":"urn:schemas-upnp-org:device:WANConnectionDevice:1","friendlyName":"urn:schemas-upnp-org:device:WANConnectionDevice:1","manufacturer":"NetComm","manufacturerURL":"http://www.netcomm.com.au/","modelDescription":"NetComm 11n Wireless ADSL Router","modelName":"NB9WMAXXn","modelNumber":"NB9WMAXXn -1","modelURL":"http://www.netcomm.com.au/","UDN":"uuid:0000e0d8-20a0-00e0-80a0-485802286048","serviceList":{"service":{"serviceType":"urn:schemas-upnp-org:service:WANPPPConnection:1","serviceId":"urn:upnp-org:serviceId:WANPPPConn1","controlURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","eventSubURL":"/uuid:0000e0d8-20a0-00e0-80a0-485802286048/WANPPPConnection:1","SCPDURL":"/dynsvc/WANPPPConnection:1.xml"}}}}}}}}}

http://clockwerx.blogspot.com.au/2013/01/hacking-samsung-smart-air-conditioners.html is the previous investigation into the SSDP behaviour that was done here.

@freman

This comment has been minimized.

freman commented Jan 1, 2014

This perl code will discover all the samsung airconditoining units on the network (I'm fortunate enough to have two ;))

#!/usr/bin/perl

use 5.10.0;

use warnings;
use strict;

use Data::Dumper;
use IO::Socket::Multicast;
use IO::Interface::Simple;

my $wait = 5;

alarm($wait);
$SIG{ALRM} = sub {exit 0};

my $if = IO::Interface::Simple->new('br0');

my $s = IO::Socket::Multicast->new(Reuse => 1, LocalPort => 1900, PeerPort => 1900, Broadcast => 1) or die $!;
$s->mcast_add('239.255.255.250', $if);
$s->mcast_loopback(0);
my $msg = "NOTIFY * HTTP/1.1\r
HOST: 239.255.255.250:1900\r
CACHE-CONTROL: max-age=20\r
SERVER: AIR CONDITIONER\r
\r
SPEC_VER: MSpec-1.00\r
SERVICE_NAME: ControlServer-MLib\r
MESSAGE_TYPE: CONTROLLER_START\r
";

$s->mcast_send($msg, $if->broadcast . ':1900');
my $data='';
my %seen = ();

say "Waiting for responses";

while ($s->recv($data, 1024)) {
    my %response = map {
        my ($n, $v) = split /:\s*/, $_, 2;
        (lc $n => $v)
    } split /[\r\n]+/, $data;

    # Filter out background noise from the upnp server running on the same box
    next unless defined $response{message_type} && $response{message_type} eq 'DEVICEDESCRIPTION';

    next if $seen{$response{mac_addr}} ++;

    # Make the nickname english not hex
    $response{decoded_nickname} = unpack('a*', pack('H*', $response{nickname}));

    print Dumper(\%response);
}

From what I have seen nothing else is done via HTTPU outside of the discovery, the aircon units respond up to 5 times to any given broadcast, the aircon units only respond to port 1900, they do not respond when the udp packet is transmitted to 239.255.255.250:1900,

@ghost ghost assigned mrose17 Jan 1, 2014

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 1, 2014

wow, on both counts. OK. let me put something together in node.js for you to test...

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 1, 2014

just for reference: the first thing i always do is a series of "npm search …" commands to see if someone has already written a module.

    npm search samsung

returns information about the "zircon" package for the "Samsung zircon dms2" which isn't what we want. so, time to write a little code.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 1, 2014

ok, get the latest and "rebuild" the steward, e.g.,

    cd steward    # the top-level directory
    git pull
    cd steward
    rm -rf node_modules
    npm install -l

then do this

    cd ../scripts
    node list-notify.js

and let's see what happens. in theory this javascript will output the same network bits as the perl script. i say "in theory", since i don't have a unit to test with here…

good luck!

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 1, 2014

Any chance we could add a command line flag to specify an alternative port?


    var udn   = self.usns[usn]
      , heads =
        { HOST            : '239.255.255.250:1900'
        , 'CACHE-CONTROL' : 'max-age=20'
        , SERVER          : signature

// comment out these lines, if need be...
        , NT              : usn
        , NTS             : 'ssdp:alive'
        , USN             : udn
        , LOCATION        : 'http://' + ipaddr + ':' + port + '/' + self.description
        }
      ;

Unfortunately, it'll be quite common for various things to be running on port 80 (I got stuck fighting nginx, apache, etc on my local dev box) - got stuck there before having to run off to work :/

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 1, 2014

Sure . Make whatever changes you need to make to get it to run and discover things.

It's just a test program...

@freman

This comment has been minimized.

freman commented Jan 1, 2014

@CloCkWeRX I don't belive the airconditioners actually use that LOCATION header anyway, if you're getting Unknown system errno 92 while trying to bind then it's a node/kernel issue (like I have)

I don't understand why node has problems using "SO_REUSEPORT" while my perl code works fine.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 2, 2014

ok, let's try this:

  1. "get the latest" -- as a part of this be sure to delete node_modules and do a fresh "npm install -l"
  2. run the script again and tell me exactly what it says.

this will have the node process bind to port 10293. consequently, it may be able to send, but not receive. in that case, you may need to run tcpdump to see what's coming back...

thanks!

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 4, 2014

@CloCkWeRX @freman - any motion? don't mean to nag, but i am mighty curious. thanks!

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Got distracted by the work week

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

no worries… thanks for letting me know! good luck!

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Just having a play at the moment. Pure tcpdump is too hard to make sense of, just grabbing wireshark.

I keep getting

clockwerx@clockwerx-laptop:~/steward/scripts$ node list-notify.js 
listening wlan0 on 192.168.1.3 udp port 10293
ssdp
Trace: { [Error: bind EADDRNOTAVAIL]
  code: 'EADDRNOTAVAIL',
  errno: 'EADDRNOTAVAIL',
  syscall: 'bind' }
    at SSDP_LOGGER.error (/home/clockwerx/steward/steward/node_modules/node-ssdp/ssdp.js:13:93)
    at Socket.<anonymous> (/home/clockwerx/steward/steward/node_modules/node-ssdp/ssdp.js:40:45)
    at Socket.EventEmitter.emit (events.js:95:17)
    at dgram.js:207:14
    at dns.js:72:18
    at process._tickCallback (node.js:415:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:901:3


which confuses me.

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

I can see my machine, presumably the script generating

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: uuid:e3f28962-f694-471f-8f74-c6abd507594b
NTS: ssdp:byebye
USN: uuid:e3f28962-f694-471f-8f74-c6abd507594b

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
NT: uuid:e3f28962-f694-471f-8f74-c6abd507594b
NTS: ssdp:byebye
USN: uuid:e3f28962-f694-471f-8f74-c6abd507594b

But I can't see anything much else. The closest other traffic, some ARP queries to my router about my laptop (who has 192.168.1.3? tell 192.168.1.1); but I see nothing from aircon to laptop or router otherwise.

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Oh, the unavailable port was

  ssdp.server('192.168.1.72', null, portno);

being hardcoded

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

oops, that should be

ipaddr

not "192.168.1.72"

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

this is what i see on my machine after making that change:

    % node ../scripts/list-notify.js 
    listening en0 on 192.168.1.72 udp port 10293
    SSDP listening on http://192.168.1.72:10293

    multicasting to 192.168.1.255:1900 from 192.168.1.72:10293
    NOTIFY * HTTP/1.1
    HOST: 239.255.255.250:1900
    CACHE-CONTROL: max-age=20
    SERVER: AIR CONDITIONER
    NT: uuid:e3f28962-f694-471f-8f74-c6abd507594b
    NTS: ssdp:alive
    USN: uuid:e3f28962-f694-471f-8f74-c6abd507594b
    LOCATION: http://192.168.1.72/upnp/desc.php

    SPEC_VER: MSpec-1.00
    SERVICE_NAME: ControlServer-MLib
    MESSAGE_TYPE: CONTROLLER_START
@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Yeah, getting that now. What's really weird is I can see the logger saying that packet has broadcast, but wireshark doesn't see it over wlan0 - any chance it's broadcasting on eth0 or something silly like that?

Would skype/google hangout, so I can share my screen help at all?

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

So, here's what the perl version does (and I'm broadcasting directly at the air con's ip, not multicasting)

192.168.1.3 -> 192.168.1.15

NOTIFY * HTTP/1.1
nHOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=20
SERVER: AIR CONDITIONER

SPEC_VER: MSpec-1.00
SERVICE_NAME: ControlServer-MLib
MESSAGE_TYPE: CONTROLLER_START

192.168.1.15 -> 192.168.1.3

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE

NOTIFY * HTTP/1.1
LOCATION: http://192.168.1.15
NTS: ssdp:alive
CACHE_CONTROL: max-age=60
HOST: 255.255.255.255:1900
SERVER: SSDP,SAMSUNG-AC-BORACAY
MAC_ADDR: 7825AD103D06
SERVICE_NAME: ControlServer-MLib
SPEC_VER: MSpec-1.00
MESSAGE_TYPE: DEVICEDESCRIPTION
NICKNAME: 536D61727420412F432837383235414431303344303629
MODELCODE: SAMSUNG_DEVICE
@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Perhaps unrelated, but the reason it never sends alive packets by default appear to be the .advertise() calls are never made with a complete argument. Is that a bug?


SSDP.prototype.server = function (ip, portH, portS) {
  var self = this;

  if (!portH) portH = 10293;
  if (!portS) portS = 1900;
  this.httphost = 'http://'+ip+':'+portH;
  this.usns[this.udn] = this.udn;
  if (!this.listening) this.sock.bind(portS, ip);

  // Shut down.
  this.advertise(false);

  setTimeout(function () {
    self.advertise(false);
  }, 1000);

  // Wake up.
  setTimeout(self.advertise, 2000);
  setTimeout(self.advertise, 3000);

  // Ad loop.
  setInterval(self.advertise, 10000);
};


ie: should it be:

SSDP.prototype.server = function (ip, portH, portS) {
  var self = this;

  if (!portH) portH = 10293;
  if (!portS) portS = 1900;
  this.httphost = 'http://'+ip+':'+portH;
  this.usns[this.udn] = this.udn;
  if (!this.listening) this.sock.bind(portS, ip);

  // Shut down.
  this.advertise(false);

  setTimeout(function () {
    self.advertise(false);
  }, 1000);

  // Wake up.
  setTimeout(function () { self.advertise(true); }, 2000);
  setTimeout(function () { self.advertise(true); }, 3000);

  // Ad loop.
  setInterval(function () { self.advertise(true); }, 10000);
};
@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Sigh: I give up for the moment.

I can clearly send traffic directly at the router via UDP, and it can see it.

What I can't figure out is what's different between the perl multicast stuff and the node stuff:

Perl, it reaches right back to me.
image

Node, it sprays out messages to 255.255.255.255 - and I'm not in that broadcast group, so never see the traffic.

Node:
image

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

thanks. i'm back for a bit, but heads up on something. let me take a look at this and i'll ping you back...

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Gah, finally got it to respond a bit.

  1. If I listen on 0.0.0.0:1900 I get traffic, listening on 192.168.1.3:* via wlan0, not so much.

  ssdp.server('0.0.0.0', null, 1900);


  setTimeout(function() {
    ssdp.notify('192.168.1.3', 1900);
  }, 1000);
  1. The responses aren't matching the regexp, as the air conditioner is responding to our notify with its notify. This is weird behaviour.
SSDP.prototype.parseMessage = function (msg, rinfo) {
  var type = msg.toString().split('\r\n').shift();

  // HTTP/#.# ### Response
  if (true || type.match(/HTTP\/(\d{1})\.(\d{1}) (\d+) (.*)/)) {
    this.parseResponse(msg, rinfo);
  } else {
    this.parseCommand(msg, rinfo);
  }
};

Result

{ address: '192.168.1.15',
  family: 'IPv4',
  port: 49131,
  size: 355 }
{ LOCATION: 'http://192.168.1.15',
  NTS: 'ssdp:alive',
  CACHE_CONTROL: 'max-age=60',
  HOST: '255.255.255.255:1900',
  SERVER: 'SSDP,SAMSUNG-AC-BORACAY',
  MAC_ADDR: '7825AD103D06',
  SERVICE_NAME: 'ControlServer-MLib',
  SPEC_VER: 'MSpec-1.00',
  MESSAGE_TYPE: 'DEVICEDESCRIPTION',
  NICKNAME: '536D61727420412F432837383235414431303344303629',
  MODELCODE: 'SAMSUNG_DEVICE' }
socket error: connect ECONNREFUSED

x3 or 4.

Now the air con rejects traffic to 192.168.1.15:80; it expects you to know to speak via ssl on port 2878 instead, so its quite likely that we want to fork the whole SSDP class into a specific version.

https://gist.github.com/CloCkWeRX/8264408 is my working code.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

many thanks. in about an hour, i think i can fold your changes back in, and then attempt some mods.

could you go here in a browser

    https://192.168.1.15:2878

it should fetch an XML file. if it does, please put it in a gist for me. thanks!

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Afraid it doesn't. When I said "expects you to connect", I meant to say "connect, authenticate, and start issueing commands"

The closest thing to a capabilities description (which I assume you are looking for) I've ever found is
https://bitbucket.org/CloCkWeRX/samsung-remote/src/20efc6ea8fe093070673f6b49d5b77dced7658c8/boracay.xml?at=master - presumably samsung specific, rather than describing the operations available like a WSDL or whatnot.

From here, the sequence of events tends to be:

  1. Authenticate and get a token, if you don't have one. You need to physically power on the air conditioner to complete the auth, and it has a 30 second timeout.

https://bitbucket.org/CloCkWeRX/samsung-remote/src/20efc6ea8fe093070673f6b49d5b77dced7658c8/lib/physical/authenticator.rb?at=master#cl-7

  1. Now that you have a token, you can send commands

https://bitbucket.org/CloCkWeRX/samsung-remote/src/20efc6ea8fe093070673f6b49d5b77dced7658c8/lib/physical/boracay.rb?at=master#cl-30

The commands go into a stack, so in theory you want to match every command id with the response id - if you disconnect in the middle of twenty commands taking place and reconnect, you'll end up reading stuff out of order. For most operations though, that doesn't really matter as everything is pretty much repeatable/idempotent

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

wow! well, i like a challenge.

ok, step 1, let me update list-ssdp and i'll get back to you.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 5, 2014

ok, step 1 complete. this may seems like going sideways, but i am doing my best to maximize code re-use. try this:

cd steward
git pull
cd steward
rm -rf node_modules/node-ssdp
npm -l install
node ../scripts/list-notify.js

and let's see how it goes! thanks for your patience

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Going direct works:
//self.sock.send(out, 0, out.length, 1900, '192.168.1.15');

But for some reason, this won't broadcast - (phone broadcasts to this, perl version, when broadcasting to this, both work)
self.sock.send(out, 0, out.length, 1900, '255.255.255.255');

Its silly, because clearly the right bcast address is calculated (192.168.1.255) - it just appears that traffic there never reaches my aircon's wireless.

wlan0     Link encap:Ethernet  HWaddr bc:77:37:e3:8c:b2  
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::be77:37ff:fee3:8cb2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1580942 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1443243 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1310826654 (1.3 GB)  TX bytes:644454299 (644.4 MB)
@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Ah.

     out = new Buffer(out);
);

+     self.sock.setBroadcast(true);
+    self.sock.send(out, 0, out.length, 1900, bcast); 

... works like a charm. Only because we're listening now on 0.0.0.0 we see our own NOTIFY

and end up with

SSDP response
{ rinfo: { address: '192.168.1.3', family: 'IPv4', port: 1900, size: 189 } }

url.js:107
    throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
          ^
TypeError: Parameter 'url' must be a string, not undefined
    at Url.parse (url.js:107:11)
    at Object.urlParse [as parse] (url.js:101:5)
    at SSDP.<anonymous> (/home/clockwerx/steward/scripts/list-notify.js:71:22)
    at SSDP.EventEmitter.emit (events.js:98:17)
    at SSDP.parseResponse (/home/clockwerx/steward/steward/node_modules/node-ssdp/ssdp.js:165:8)
    at Socket.onMessage (/home/clockwerx/steward/steward/node_modules/node-ssdp/ssdp.js:48:52)
    at Socket.EventEmitter.emit (events.js:98:17)
    at UDP.onMessage (dgram.js:437:8)

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 5, 2014

Working:
https://gist.github.com/CloCkWeRX/8269212

Namely has:

     self.sock.setBroadcast(true);
    self.sock.send(out, 0, out.length, 1900, bcast); //

plus

    if (info.LOCATION) {
      http.request(url.parse(info.LOCATION || info.Location), function(response) {

and specifically listening on

  ssdp.server('255.255.255.255');    // i suspect this should be ipaddr
@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

hi. i don't think you can bind to 255.255.255.255 - that's the broadcast address. you can send to that address, but not receive from it. (it blows up on my system.) by the way, what platform are you running on.

could you replace the 255.255.255.255 with 0.0.0.0 and see if it works.

step 2, after this works, is for me to write a driver for the steward that does this discovery algorithm and creates a /device/climate/samsung/control object that will then ask the user to hit the button, etc.

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 6, 2014

I managed to bind to 255.255.255.255, but earlier had 0.0.0.0 - no
appreciable difference. Keeping 0.0.0.0 should be fine if it gets upset on
your machine. (Will double check in a bit to be certain)

I'm on Ubuntu 13.10.

With the second bit, do you have examples of other setup? I doubt I'd be as
quick as you, but I might as well have a bit of a tinker..

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

thanks very much! i put the new version in github. your patience is much appreciated.

i'm really amazed that ubuntu let's you bind to 255.255.255.255, i'm also sort of amazed that it didn't result in a broadcast storm, a term i haven't heard used in over a decade.

i'm happy (of course) to let you take over from here, the question is how much time do you want to spend understanding the linkage scaffolding in the steward vs. doing the actual code that talks to the samsung. the linkage may be about 1/3 of the code, but unless you're familiar with the steward, it will take you longer to figure that out than writing the other 2/3rds (since you know the samsung protocol). i'm also happy to do the scaffolding, since i do a lot of it.

eventually, perhaps a few months from now, the curators can just tell someone "base your driver on module X and pay attention to these functions in the module", but we're not quite there yet with all the device categories.

also, as long as we're chatting: here's a random question or two:

  • is this an ethernet or a wifi thing?
  • can you point me to any URL that shows one of these units for sale? i'm not thinking of buying one, but i am curious as to how they are presented to folks
  • the choice of 'SERVER: AIR CONDITIONER' is rather interesting. are there other samsung devices out there, do you think that speak the same protocol? if so, i'm wondering whether 'AIR CONDITIONER' could be replaced with '*' (or left out) and whether all samsung devices on the home network would reply. otherwise, you'd have to cycle through a list of appliance names (e.g., washing machine, dryer, dishwasher, refrigerator, oven, cooktop, microwave, television, vacuum, etc.)

many thanks for the education!

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 6, 2014

i'm happy (of course) to let you take over from here, the question is how much time do you want to spend understanding the linkage scaffolding in the steward vs. doing the actual code that talks to the samsung. the linkage may be about 1/3 of the code, but unless you're familiar with the steward, it will take you longer to figure that out than writing the other 2/3rds (since you know the samsung protocol). i'm also happy to do the scaffolding, since i do a lot of it.

If you can set me up with the basics of a test case, I can probably give you a high-ish level API (on, off, set temp, etc) in a node module. That way you'll get something pretty close to the UI controls you want to add; even if its ugly, ugly XML strings under the hood.

is this an ethernet or a wifi thing?

The aircon hooks up to your wireless. My laptop is also on wireless. http://www.samsung.com/au/air-conditioning/smart-zone/ is the marketing stuff for it, there's probably a manual around there too if you look hard enough.

the choice of 'SERVER: AIR CONDITIONER' is rather interesting. are there other samsung devices out there, do you think that speak the same protocol?

Probably. Things like http://liliputing.com/2014/01/samsung-wants-bring-together-phone-watch-tv-washing-machine.html keep popping up.

https://play.google.com/store/search?q=samsung%20smart%20washing&c=apps&hl=en also suggests there's a few apps on the way. I knew of a washing machine app, but the 'home control tablet app' is new.

There is a 'nickname' field in the response to help you determine which thing is which, I know that if you had two aircons, you'd get two responses for example.

@freman

This comment has been minimized.

freman commented Jan 6, 2014

Greetings,

Sorry I kind of dumped this in your lap and vanished, between work, other projects, and xmas... well I'm looking forward to the next public holiday that comes around.

I had to bind the interface in perl, I haven't checked to see if that binds 0.0.0.0 or 255.255.255.255, but I've also found binding 192.168.0.255 worked.

The nickname field is user settable so that might be something to use for displaying the device to the user rather than identifying it.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

many thanks. i like your suggestion.

why don't you create a node package, e.g., node-smart-samsung, and model it after either the node-pixelpusher or node-greenwave-gop modules. the basic idea is this:

the caller does this:

var SS = require('smart-samsung');

var api = new SS().on('discover, function(device) {
  // device models a smart airconditioner (later it might be other things as well)
  // device.props = { type     : 'AIR CONDITIONER'
                    , udn      : 'a unique identifier, not sure what to use yet...'
                    , url      : 'https://a.b.c.d'
                    , nickname : 
                    };

  // at this point, the caller sees if they have a database entry for this device and if the entry has a token
  // if so, they call:
  device.setToken(token);  // to tell the package what token to use
  // otherwise  the caller tells the user to go push the button and calls
  device.getToken(function(err, token) {
    // if (!!err) there was an error;
    // otherwise token is what the device says to use for a token
    // the caller stores the token in a database for future use
  });

  // once there is a valid token, these calls can be made
  // the final argument is a callback that is invoked when a response is received

  device.onoff(onoff, function(err) {});            // either true or false
  device.setMode(mode, function(err) {});           // one of 'auto', 'cool', 'dry', 'wind', or 'heat'
  device.setTemperature(degrees, function(err) {}); // degrees in celsius
  device.getTemperature(function(err, degrees) {}); // if (!err) then degrees is meaningful
  device.setConvenientMode(mode, function(err) {}); // one of 'off', 'quiet', ..., 'windmode3'
  device.setSleepMode(hours, function(err) {});     // in hours
  device.setWindLevel(level, function(err) {});     // one of 'center', 'direct', ..., 'wide'
}).on('error', function(err) {
  // error detected during discovery...
});
@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

@freman - thanks. we can use nickname as the device name. although we'll need an API call to get and set it!

@freman

This comment has been minimized.

freman commented Jan 6, 2014

<Request Type="ChangeNickname"><ChangeNickname DUID="%s" Nickname="%s" /></Request>

DUID appears to be the devices mac address (returned as part of the SSDP conversation)
Nickname is a hex packed string (eg: unpack('H_', pack('a_', 'Fred'))) - The nickname is also returned via SSDP
I do not know of any API to get the nickname out of the SSDP process

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

then we need only a set operation, since there's an implicit get when the ssdp response is read. great, less work all around.

@CloCkWeRX

This comment has been minimized.

Contributor

CloCkWeRX commented Jan 6, 2014

You might want to fork and clean up https://github.com/CloCkWeRX/node-samsung-airconditioner

There's a few operations (get_temperature, set_wind_direction) not yet implemented, but on/off more or less works.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

that was fast! ok, forked. i plan to get back to you tomorrow on this...

@freman

This comment has been minimized.

freman commented Jan 6, 2014

Hey @CloCkWeRX you might want to wrap a function around the reader to handle unexpected update messages. I know my aircon sends updates whenever the temperature changes, there might be other updates I've yet to discover.

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 6, 2014

hi. give me until the end of the day (us/pacific) to make this more node-like. if you like it, accept the pull request. if not, … that's ok!

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 7, 2014

hi. haven't forgotten. just got put onto a firedrill for 36 hours. back soon… (-;

@mrose17

This comment has been minimized.

Member

mrose17 commented Jan 8, 2014

ok, it's ready to be fleshed out and tested.

look for /* … */ to see things that you need to do

then test it.

sorry if this looks like a lot of edits, my goals is to make this look more like a node.js module. i don't claim to be a guru, but there are certain design patterns that are in common use that i've incorporated.

any questions, please open an issue here: https://github.com/TheThingSystem/node-samsung-airconditioner/issues

thanks and good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment