tr-064
TR-064 - UPnP/IGD for node.js
Description
A library to interact with routers and other network devices. Tested and designd for Fritz.Box routers.
This library is capable of:
- Supports the UPnP, IGD and PMR (Samsung TV) Protocol
- Read and configure Services
- authentication with username/password or password only
- SSL encryption
- Transactions
- Subscribe to Events with included EventServer
More info about TR-064: http://www.avm.de/de/Extern/files/tr-064/AVM_TR-064_first_steps.pdf
Install
npm install tr-064
It`s simple
Connect to the device and read a Service.
var tr = ;var tr064 = ;tr064;
Save communication (SSL Encryption, Authentication)
var tr = ;var tr064 = ;tr064;
List All Services and Variables
Get the info from both protocols.
var tr = ;var tr064 = ;tr064; tr064; var { console; devicemetaservicesInfo;}
Methods
initTR064Device(host, port, callback)
Initialize the TR - 064 UPnP controller
host
- hostname of the deviceport
- port of the device(standard: 49000)callback
- (err, device)
initIGDDevice(host, port, callback)
Initialize the TR - 064 IGD controller
host
- hostname of the deviceport
- port of the device(standard: 49000)callback
- (err, device)
device.startEncryptedCommunication([caFile],callback)
Starts SSL encrypted Communication
caFile
- Filename of custom .pem file (Optional)callback
- (err, device)
device.stopEncryptedCommunication()
Stops SSL encrypted Communication
device.login([user],password)
Configure device to use authentication for every request
user
- Username (Optional, default device user is used instead)password
- Device password
device.logout()
Configure device to not use authentication
device.startTransaction(callback)
Starts a 'device-side' transaction
callback
- (err, device)
device.stopTransaction()
Ends the current transaction
device.meta
Array with all info about services and actions
Service Identifier
]
device.services[Gets the specified service form the device
Service Identifier
- usually in the form of: urn:dslforum-org:service:XXX:1
service.actions.XXX([args], callback)
args
- Array of args to configure or read a service.callback
- (err, result)