I am new to this but have been using Cumulus MX with my WH1080 for about a week and this is so easy to use, Thank You Cumulus Admin......
I have looked through the pages about hosting the data presented by Cumulus, the options are many, most of them require Host Computers or the WRT device, the Raspberry PI Zero has been running this software and posting the data to a free web space, with the PI Zero at £4 + WiFi @ £5 + USB2 Hub @ £3 + SD @ £3 you get a very capable host.
The USB hub is powered providing power to the PI.
I have for setup connected a USB Keyboard and mouse to configure WiFi via HDMI on the TV, then installed the basic Jessi build from https://www.raspberrypi.org/, Installed mono as per post(from sudo apt-get mono-complete), then downloaded the Cumulus MX to the pi home directory and ran it.
The FTP setup uploads realtimegauges.txt to a free website, this is then gathered by one of my ESP8266's and presented as a CORS Enabled JSON frame, allowing the data to be presented with other sensor data from the network of ESP's.
The basic Template Site... is here(uploaded by Cumulus from the PI Zero)
http://emonitor.16mb.com/index.htm
The ESP8266 Hosted data.....very simple layout...
http://82.5.78.180:5050/monitor
This is the basic code for the ESP it is using the Arduino IDE, the code is adapted from the Arduino Ethernet therefore it is very portable......
The fetch routine......
Code: Select all
void getfile() {
delay(200);
WiFiClient cl;
// The Start of the Routine to clollect the data...........
// if you get a connection, GET the file
if (cl.connect("emonitor.16mb.com", 80)) {
// Make a HTTP request:
// send the HTTP GET request:
cl.println("GET /realtimegauges.txt HTTP/1.1");
cl.println("Host: emonitor.16mb.com");
cl.println("User-Agent: arduino-ethernet");
cl.println("Connection: close");
cl.println();
}
while(!!!cl.available()) {
yield();
}
while (cl.available()) {
char c = cl.read();
// Use a marker for self constructed formats, I am using this as it works for stripping header and my files
if (c == '{') { // First Tag.....
// end of HTTP header, now save requested file
// open the file for writing
File theFile = SPIFFS.open("/realtime.txt", "w"); // change file name to write to here
if (theFile) { // If we can open file write to it
theFile.print("{");
int Lc=0; // we do not want to get stuck in the loop.....
while (cl.available()) {
// stay in this loop until the file has been received
String linew = cl.readStringUntil('\n'); // get data a line at a time to save memory
theFile.println(linew); // save data to file
Lc++;
if(Lc>=128){
ESP.restart();
}
}
}
theFile.close();
}
}
cl.flush();
cl.stop();
}
Code: Select all
if(sPath=="/realtime")
{
ulReqcount++; // Counter for web requests
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: application/json");
client.println("Connection: close");
// client.println("Connection: keep-alive");
client.println("Access-Control-Allow-Origin: *");
client.println("Access-Control-Allow-Methods: GET");
client.println("Access-Control-Allow-Headers: Content-Type");
client.println("Access-Control-Max-Age: 500");
client.println();
// send web page/file
File thefile = SPIFFS.open("/realtime.txt", "r"); // open web page/file
while(thefile.available()) {
client.println(thefile.readStringUntil('\n')); // send web page/file to client
}
thefile.close();
client.println();
}
Code: Select all
<script>
$.ajax({
type: "GET",
url: "http://82.5.78.180/realtime",
async: false,
beforeSend: function(x) {
if(x && x.overrideMimeType) {
x.overrideMimeType("application/j-son;charset=UTF-8");
}
},
dataType: "json",
success: function(data){
var items = [];
var key1 = ["Time Sampled(UTC+1) ","Ext Temp Now(°C) ","Low Today(°C) ","High Today(°C) ","Int Temp(°C) ","Wind Speed (Mph)","Barometric Pressure(Mbar)","Rainfall Today(mm)","Ext Humidity(RH%)","Int Humidity(RH%)","Forecast For Today "];
$.each(data, function(key, val) {
if (key=="date") {
key=key1[0];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="temp") {
key=key1[1];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="tempTL") {
key=key1[2];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="tempTH") {
key=key1[3];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="intemp") {
key=key1[4];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="wlatest") {
key=key1[5];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="press") {
key=key1[6];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="rfall") {
key=key1[7];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="hum") {
key=key1[8];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="inhum") {
key=key1[9];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
if (key=="forecast") {
key=key1[10];
items.push("<tr><td> "+ key +" </td><td> " + val + " </td></tr> ");
}
});
// $('.my-new-list').remove();
$('<ul/>', {
'class': 'my-new-list',
html: items.join('')
}).appendTo('#ESPS008');
}
});
</script>