var MULTICAST_ADDR = '231.31.31.31'; //Host name or IP address
var PORT = 333;//port as defined in the Weather Display Control Panel -> FTP & Connections Metar/NOAA -> TCP/IP Client/Server
var LOCAL_IP = '192.168.1.12'; //IP address where THIS js is running
var dgram = require('dgram');
var client = dgram.createSocket('udp4');
client.on('listening', function () {
var address = client.address();
console.log('UDP Client listening on ' + address.address + ":" + address.port);
client.setBroadcast(true)
client.setMulticastTTL(128);
client.addMembership(MULTICAST_ADDR, LOCAL_IP);
});
client.on('message', function (message, remote) {
console.log('A: Epic Command Received. Preparing Relay.');
console.log('B: From: ' + remote.address + ':' + remote.port +' - ' + message);
});
client.bind(PORT, MULTICAST_ADDR);
I noticed that only 50 or so of the fields are returned.
Thanks for the reply. Perhaps I was not clear with my question.
Is is possible to make the entire content of the clientraw file (and not just the first 50+ fields) available thru the UDP? (i.e. as part of the Client / Server TCP/IP Setup for LAN or Internet)
Working on building a nodeserver that would access data from WD and to make it available within the ISY-994 (from universal devices), a home automation solution.
Renato, would you care sharing the link to that ISY community/forum where the information will be available - I have a ISY994Zw (with Z-Wave) and I would be very interested in being able to use the data from my Davis Instruments Vantage Por2 weather station (and possibly from my WeatherFlow weather station) through Weather Display to control some of my X10/Insteon/Z-Wave devices rather than purchase the Universal Devices Climate Module.
Unfortunately, I am completely ignorant on the use of UDP… :oops:
Thanks for the implementation. But I still only see a subset of the clientraw record. I went into the Client / Server TCP/IP Setup for LAN or Internet and checked the option “Send complete clientraw” and then restarted WD.
This is now what I see as the output of the multicast code:
The Weather Display node server isn’t yet in the Polyglot node server store so it has to be installed manually from the git hub. I need to do a bit more work on it now to allow it to access more of the clientraw fields now that Brian has added the full contents to the UDP output.
I do have a WeatherFlow specific node server also available that get its data directly from the WeatherFlow hub,
I’m seeing what looks like the full clientraw contents over UDP. I believe I had to toggle the “Server enabled” switch off/on along with checking the new checkbox to make it work. I also checked some of the other checkboxes in that section so I don’t know if that had any impact on it.