Example output and NodeJS server code snippet for a Froggit weather station when using an own custom server instead of predefined weather services.
My hardware:
- WH3000SE sensor
- DP1500 Dongle
- HTTP method: POST
- Data: urlencoded body
{
"PASSKEY": "6BB****************************",
"stationtype": "GW1000A_V1.6.8",
"dateutc": "2022-02-06 20:00:03",
"tempinf": "64.6",
"humidityin": "59",
"baromrelin": "28.993",
"baromabsin": "28.993",
"tempf": "39.6",
"humidity": "90",
"winddir": "237",
"windspeedmph": "1.12",
"windgustmph": "2.24",
"maxdailygust": "20.58",
"solarradiation": "0.00",
"uv": "0",
"rainratein": "0.000",
"eventrainin": "0.008",
"hourlyrainin": "0.000",
"dailyrainin": "0.039",
"weeklyrainin": "0.039",
"monthlyrainin": "0.319",
"yearlyrainin": "0.618",
"totalrainin": "0.618",
"wh65batt": "0",
"freq": "868M",
"model": "GW1000_Pro"
}
- HTTP method: GET
- Data: query parameters
{
"ID": "zzz",
"PASSWORD": "zzz",
"tempf": "39.6",
"humidity": "90",
"dewptf": "36.9",
"windchillf": "39.6",
"winddir": "248",
"windspeedmph": "0.00",
"windgustmph": "2.24",
"rainin": "0.000",
"dailyrainin": "0.039",
"weeklyrainin": "0.039",
"monthlyrainin": "0.319",
"yearlyrainin": "0.618",
"solarradiation": "0.00",
"UV": "0",
"indoortempf": "64.6",
"indoorhumidity": "59",
"baromin": "28.978",
"lowbatt": "0",
"dateutc": "now",
"softwaretype": "GW1000A_V1.6.8",
"action": "updateraw",
"realtime": "1",
"rtfreq": "5"
}
Here's a very basic server to retrieve the Froggit's data with.
Configure the following options in the weather station when trying it out:
- For Ecowitt protocol type
- Server IP:
[your machine IP]
- Path:
/data
- Port:
3000
- Server IP:
- For Wunderground protocol type
- Server IP:
[your machine IP]
- Path:
/data?
- Port:
3000
- Server IP:
var express = require('express');
var app = express();
app.use(express.urlencoded({ extended: true }));
// Wunderground requests
app.get('/data', (req, res) => {
console.log(JSON.stringify(req.query, null, 2));
res.sendStatus(200);
});
// Ecowitt requests
app.post('/data', (req, res) => {
console.log(JSON.stringify(req.body, null, 2));
res.sendStatus(200);
});
app.listen(3000, () => {
console.log('ws-server listening on port 3000...');
});