Wetterstation für unter 80€

Guten Abend,

hat eventuell noch jemand eine alte Kumulus Version ?
Die, die es aktuell herunterzuladen gibt, hat so wie es aussieht, keinen USB Support mehr …

Danke

Julian

Hallo Julian,

ich habe noch eine ältere Version von Cumulus, habe aber mal die neue installiert und obwohl tatsächlich die Auswahl „USB“ fehlt, funktioniert es trotzdem bei mir…

Was ich aber schon vorher zur Kenntnis genommen habe, aber noch mich noch nicht intensiver mit beschäftigt habe:
Der aktuelle Luftdruck wird nicht mehr angezeigt…gibt es dazu einen „Trick“ (etwas säubern oder ähnliches??)

Joachim

Hallo Julian,

ich habe seit Weihnachten auch die Wetterstation :slight_smile:

Ich der neuen Cumulus Version gibt es nicht mehr die Möglichkeit, USB als Anschluss auzuwählen, braucht es aber auch nicht :smiley:
Du musst einfach nur dieser Anleitung hier folgen. Wobei ich den Treiber direkt runtergalden und installiert habe, ohne den Umweg über die Weatherlink Software.

So läuft es bei mir seit Weihnachten ohne Probleme…

Hallo ,

habe meine neue WS0101 installiert. Die Daten sehe ich wenn ich die Software aufrufe.
Nur wird mir keine Log-Datei angelegt. Weiter oben steht etwas von EasyWeather.Dat. Wo werden die Daten hingeschrieben, die Beschreibung gibt zu dem Thema nichts her.
Hat da irgendjemand Erfahrungen?

Gruß aus Dithmarschen

Bei mir läuft es mittlerweile. Ich hatte einfach bei google nochmal nach der Vorversion mit USB gesucht und gefunden. Ich habe also jetzt die alte Cumulus Version. Aber wie aus den 2 Beiträgen vor dir ersichtlich, gehts auch mit der neuen, hatte ich aber noch keine Zeit umzustellen.

Da es bei mir auch erst nicht ging, hatte ich auch mal Testweise das Easyweather-ding Installiert und ganz schnell wieder deinstalliert. Ich weiss nicht mehr warum, aber es war mist. Kann sein das es keine Logdatei anlegt ? Ich rate dir jedenfalls Cumulus zu nehmen.

Bei mir läuft die Sache übrigens bisher sehr Stabil, bis auf mein Sharkoon Lan-Usb Interface, der verlangt ab und zu mal einen Neustart (bisher leider Manuell).

@JPaeper
Bei mir kommt der Luftdruck an ?!

Edit: im ersten Post des Threads steht doch wo die Easywaether.dat sein sollte:

$datei="C:\Program Files\EasyWeather\EasyWeather.dat"

…der Luftdruck wird bei mir übertragen und angezeigt, sowohl auf dem Display, als auch im IPS - nur ist er seit Wochen konstant auf 1013,2mbar. Daher war meine Frage dahingehend gemeint, ob man ab und zu irgendetwas mal reinigen sollte, um den Fehler zu beheben…

Joachim

Hallo zusammen,

da mit der neusten Easyweather Version das Dateiformat auf MDB geändert wurde, und somit das Script nicht mehr funktioniert und ich außerdem Cumulus nicht ans laufen bekommen und die alte Easyweather ist wie bekannt ziemlich instabil ist habe ich mich nach einer Alternative umgesehen.

Dabei bin ich auf „WWSR“ gekommen. http://meteolinger.lowlevel.cz/ „WWSR“ steht unter GPL.

Das Tool läuft unter Linux und liefert einfach die Wetterdaten wie sie aus der Basisstation kommen.
Es läuft bei mir auf einem Raspberry Pi mit einer Pollin WS0101 Wetterstation angeschlossen via USB.

Ich habe das Tool ein wenig erweitert damit es mir die Daten in einem XML Datei schreib, welche ich dann via WWW_Reader und Text Parser auswerten kann.

WWSR ist in C geschrieben und deshalb ziemlich einfach zu erweitern.

Hier der geänderte Code. Kompilieren muss man ihn selbst. Bei mir läuft er auf einem Raspberry Pi und wird so kompiliert.
Zuerst noch GCC und libusb installieren. GCC ist vermutlich schon installiert.

apt-get install libusb-dev, gcc
gcc /usr/lib/arm-linux-gnueabihf/libusb.so -lm weather.c -o weather
/*
 * wwsr - Wireless Weather Station Reader
 * 2007 dec 19, Michael Pendec (michael.pendec@gmail.com)
 * Version 0.5
 * 2008 jan 24 Svend Skafte (svend@skafte.net)
 * 2008 sep 28 Adam Pribyl (covex@lowlevel.cz)
 * 2014 jul 03 Christian Lechner (christian.lechner@gmx.de) added xml export
 * Modifications for different firmware version(?)
 */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <ctype.h>
#include <usb.h>
#include <time.h>

struct usb_dev_handle *devh;
int	ret,mempos=0,showall=0,shownone=0,resetws=0,pdebug=0,postprocess=0;
int	o1,o2,o3,o4,o5,o6,o7,o8,o9,o10,o11,o12,o13,o14,o15;
char	buf[1000],*endptr;
char	buf2[400];
FILE *file; 

void _close_readw() {
    ret = usb_release_interface(devh, 0);
    if (ret!=0) printf("could not release interface: %d
", ret);
    ret = usb_close(devh);
    if (ret!=0) printf("Error closing interface: %d
", ret);
}

struct usb_device *find_device(int vendor, int product) {
    struct usb_bus *bus;
    
    for (bus = usb_get_busses(); bus; bus = bus->next) {
	struct usb_device *dev;
	
	for (dev = bus->devices; dev; dev = dev->next) {
	    if (dev->descriptor.idVendor == vendor
		&& dev->descriptor.idProduct == product)
		return dev;
	}
    }
    return NULL;
}

struct tempstat {
	char ebuf[271];
	unsigned short  noffset;
	char delay1;
	char hindoor;
	signed int tindoor;
	unsigned char houtdoor;
	signed int toutdoor;
	unsigned char swind;
	unsigned char swind2;
	unsigned char tempf;
	int pressure;
	unsigned char temph;
	unsigned char tempi;
	signed int rain;
	signed int rain2;
	unsigned char rain1;
	unsigned char oth1;
	unsigned char oth2;
	char nbuf[250];
	char winddirection[100];
} buf4;


void print_bytes(char *bytes, int len) {
    int i;
    if (len > 0) {
	for (i=0; i<len; i++) {
	    printf("%02x ", (int)((unsigned char)bytes[i]));
	}
	// printf("\"");
    }
}
void _open_readw() {
    struct usb_device *dev;
    int vendor, product;
#if 0
    usb_urb *isourb;
    struct timeval isotv;
    char isobuf[32768];
#endif

    usb_init();
//    usb_set_debug(0);
    usb_find_busses();
    usb_find_devices();

    vendor = 0x1941;
    product = 0x8021; 

    dev = find_device(vendor, product);
    assert(dev);
    devh = usb_open(dev);
    assert(devh);
    signal(SIGTERM, _close_readw);
    ret = usb_get_driver_np(devh, 0, buf, sizeof(buf));
    if (ret == 0) {
	// printf("interface 0 already claimed by driver \"%s\", attempting to detach it
", buf);
	ret = usb_detach_kernel_driver_np(devh, 0);
	// printf("usb_detach_kernel_driver_np returned %d
", ret);
    }
    ret = usb_claim_interface(devh, 0);
    if (ret != 0) {
	printf("Could not open usb device, errorcode - %d
", ret);
	exit(1);
    }
    ret = usb_set_altinterface(devh, 0);
    assert(ret >= 0);
}


void _init_wread() {
	char tbuf[1000];
	ret = usb_get_descriptor(devh, 1, 0, tbuf, 0x12);
	// usleep(14*1000);
	ret = usb_get_descriptor(devh, 2, 0, tbuf, 9);
	// usleep(10*1000);
	ret = usb_get_descriptor(devh, 2, 0, tbuf, 0x22);
	// usleep(22*1000);
	ret = usb_release_interface(devh, 0);
	if (ret != 0) printf("failed to release interface before set_configuration: %d
", ret);
	ret = usb_set_configuration(devh, 1);
	ret = usb_claim_interface(devh, 0);
	if (ret != 0) printf("claim after set_configuration failed with error %d
", ret);
	ret = usb_set_altinterface(devh, 0);
	// usleep(22*1000);
	ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0xa, 0, 0, tbuf, 0, 1000);
	// usleep(4*1000);
	ret = usb_get_descriptor(devh, 0x22, 0, tbuf, 0x74);
}

void _send_usb_msg( char msg1[1],char msg2[1],char msg3[1],char msg4[1],char msg5[1],char msg6[1],char msg7[1],char msg8[1] ) {
	char tbuf[1000];
	tbuf[0] = msg1[0];
	tbuf[1] = msg2[0];
	tbuf[2] = msg3[0];
	tbuf[3] = msg4[0];
	tbuf[4] = msg5[0];
	tbuf[5] = msg6[0];
	tbuf[6] = msg7[0];
	tbuf[7] = msg8[0];
	// print_bytes(tbuf, 8);
	// printf(" - - - 
");
	ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 9, 0x200, 0, tbuf, 8, 1000);
	// usleep(28*1000);
}

void _read_usb_msg(char *buffer) {
   char tbuf[1000];
   usb_interrupt_read(devh, 0x81, tbuf, 0x20, 1000);
   memcpy(buffer, tbuf, 0x20);
   // usleep(82*1000);
}


void read_arguments(int argc, char **argv) {
	int c,pinfo=0;
	char *mempos1=0,*endptr;
  	shownone=0;
  	o1=0;
	while ((c = getopt (argc, argv, "akwosiurthp:zyx")) != -1)
	{
         switch (c)
           {
           case 'a':
  	     showall=1;
	     shownone=1;
             break;
           case 'i':
  	     o1=1;
	     shownone=1;
             break;
           case 'u':
  	     o2=1;
	     shownone=1;
             break;
           case 't':
  	     o3=1;
	     shownone=1;
             break;
           case 'w':
  	     o4=1;
	     shownone=1;
             break;
           case 'r':
  	     o5=1;
	     shownone=1;
             break;
           case 'o':
  	     o6=1;
	     shownone=1;
             break;
           case 's':
  	     o7=1;
	     shownone=1;
             break;
           case 'j':
  	     o9=1;
	     shownone=1;
             break;
           case 'p':
  	     mempos1=optarg;
             break;
           case 'h':
  	     pinfo=1;
             break;
           case 'x':
  	     pdebug=1;
             break;
           case 'y':
             postprocess=1;
             shownone=1;
             break;
           case 'z':
  	     resetws=1;
	     shownone=1;
             break;
           case '?':
             if (isprint (optopt))
               fprintf (stderr, "Unknown option `-%c'.
", optopt);
             else
               fprintf (stderr,"Unknown option character `\\x%x'.
",optopt);
           default:
             	showall=0;
		//abort ();
           }
	}
	if ( (pinfo!=0) | (shownone==0) ) {
		printf("Wireless Weather Station Reader v0.1
");
		printf("(C) 2007 Michael Pendec

");
		printf("options
");
		printf(" -h	help information
");
		printf(" -p	Start at offset (can be used together with below parameters
");
		printf(" -x	Show bytes retrieved from device
");
		printf(" -z	Reset log buffer (will ask for confirmation.

");
		printf(" -a	Show all stats (overrides below parameters)
");
		printf(" -s	Show current history position
");
		printf(" -t	Show temperature
");
		printf(" -j	Show Pressure (hPa)
");
		printf(" -u	Show humidity
");
		printf(" -r	Show rain
");
		printf(" -w	Show wind
");
		printf(" -o	other 

");
		exit(0);
	}
	if (mempos1!=0) {
	    	mempos = strtol(mempos1, &endptr, 16);
	} else {
		printf("Reading last updated record from device
");
	}
}
// Initialize XML file
void initfile() {
	file = fopen("weather.xml","w+");
	fprintf(file, "%s", "<weather>");
	fclose(file);
}
// Add closing tag to XML file
void finishfile() {
	file = fopen("weather.xml", "a+");
	fprintf(file, "%s", "</weather>");
	fclose(file);
}
// Append to XML file
void appendfile(char *line){
	file = fopen("weather.xml","a+");
	fprintf(file, "%s", line);
	fclose(file);
}

int main(int argc, char **argv) {
    int		buftemp;
    char ec='n';
    struct tempstat buf5;

    read_arguments(argc,argv);
    _open_readw();
   _init_wread();
    initfile();
   
if (resetws==1) {
     printf(" Resetting WetterStation history
");
     printf("Sure you want to reset wetter station (y/N)?");
     fflush(stdin);
     scanf("%c",&ec);
     if ( (ec=='y') || (ec=='Y') ) {
   	_send_usb_msg("\xa0","\x00","\x00","\x20","\xa0","\x00","\x00","\x20");
    	_send_usb_msg("\x55","\x55","\xaa","\xff","\xff","\xff","\xff","\xff");
	usleep(28*1000);
     	_send_usb_msg("\xff","\xff","\xff","\xff","\xff","\xff","\xff","\xff");
	usleep(28*1000);
     	_send_usb_msg("\x05","\x20","\x01","\x38","\x11","\x00","\x00","\x00");
	usleep(28*1000);
    	_send_usb_msg("\x00","\x00","\xaa","\x00","\x00","\x00","\x20","\x3e");
	usleep(28*1000);
     } else {
     	printf(" Aborted reset of history buffer
");
     }
     _close_readw();
     return 0;
   }
   _send_usb_msg("\xa1","\x00","\x00","\x20","\xa1","\x00","\x00","\x20");
   _read_usb_msg(buf2);
   if ( ( pdebug==1) ) 
   {
      printf("000-031: ");
      print_bytes(buf2, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\x20","\x20","\xa1","\x00","\x20","\x20");
   _read_usb_msg(buf2+32);
   if ( ( pdebug==1) ) 
   {
      printf("032-063: ");
      print_bytes(buf2+32, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\x40","\x20","\xa1","\x00","\x40","\x20");
   _read_usb_msg(buf2+64);
   if ( ( pdebug==1) ) 
   {
      printf("064-095: ");
      print_bytes(buf2+64, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\x60","\x20","\xa1","\x00","\x60","\x20");
   _read_usb_msg(buf2+96);
   if ( ( pdebug==1) ) 
   {
      printf("096-123: ");
      print_bytes(buf2+96, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\x80","\x20","\xa1","\x00","\x80","\x20");
   _read_usb_msg(buf2+128);
   if ( ( pdebug==1) ) 
   {
      printf("124-159: ");
      print_bytes(buf2+128, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\xa0","\x20","\xa1","\x00","\xa0","\x20");
   _read_usb_msg(buf2+160);
   if ( ( pdebug==1) ) 
   {
      printf("160-191: ");
      print_bytes(buf2+160, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\xc0","\x20","\xa1","\x00","\xc0","\x20");
   _read_usb_msg(buf2+192);
   if ( ( pdebug==1) ) 
   {
      printf("192-223: ");
      print_bytes(buf2+192, 32);
      printf("
");
   }
   _send_usb_msg("\xa1","\x00","\xe0","\x20","\xa1","\x00","\xe0","\x20");
   _read_usb_msg(buf2+224);
   if ( ( pdebug==1) ) 
   {
      printf("224-255: ");
      print_bytes(buf2+224, 32);
      printf("
");
   }


 //  buf4.noffset = (unsigned char) buf2[22] + ( 256 * buf2[23] );
   buf4.noffset = (unsigned char) buf2[30] + ( 256 * buf2[31] );
   if (mempos!=0) buf4.noffset = mempos;
   buftemp = 0;
   if (buf4.noffset!=0) buftemp = buf4.noffset - 0x10;
   buf[1] = ( buftemp >>8 & 0xFF ) ;
   buf[2] = buftemp & 0xFF;
   buf[3] = ( buftemp >>8 & 0xFF ) ;
   buf[4] = buftemp & 0xFF;
   _send_usb_msg("\xa1",buf+1,buf+2,"\x20","\xa1",buf+3,buf+4,"\x20");
   _read_usb_msg(buf2+224);
   if ( ( pdebug==1) ) 
   {
      printf("224-255: ");
      print_bytes(buf2+224, 32);
      printf("
");
   }

ret = usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE, 0x0000009, 0x0000200, 0x0000000, buf, 0x0000008, 1000);
// usleep(8*1000);
ret = usb_interrupt_read(devh, 0x00000081, buf, 0x0000020, 1000);
memcpy(buf2+256, buf, 0x0000020);
if ( ( pdebug==1) )
{
   printf("256-287: ");
   print_bytes(buf2+256, 32);
   printf("
");
}

buf4.delay1 = buf2[224];
buf4.tempi=buf2[236];
	if (buf4.tempi==0) strcpy(buf4.winddirection,"N");
	if (buf4.tempi==1) strcpy(buf4.winddirection,"NNE");
	if (buf4.tempi==2) strcpy(buf4.winddirection,"NE");
	if (buf4.tempi==3) strcpy(buf4.winddirection,"ENE");
	if (buf4.tempi==4) strcpy(buf4.winddirection,"E");
	if (buf4.tempi==5) strcpy(buf4.winddirection,"ESE");
	if (buf4.tempi==6) strcpy(buf4.winddirection,"SE");
	if (buf4.tempi==7) strcpy(buf4.winddirection,"SSE");
	if (buf4.tempi==8) strcpy(buf4.winddirection,"S");
	if (buf4.tempi==9) strcpy(buf4.winddirection,"SSW");
	if (buf4.tempi==10) strcpy(buf4.winddirection,"SW");
	if (buf4.tempi==11) strcpy(buf4.winddirection,"WSW");
	if (buf4.tempi==12) strcpy(buf4.winddirection,"W");
	if (buf4.tempi==13) strcpy(buf4.winddirection,"WNW");
	if (buf4.tempi==14) strcpy(buf4.winddirection,"NW");
	if (buf4.tempi==15) strcpy(buf4.winddirection,"NNW");
buf4.hindoor = buf2[225];
buf4.tindoor =( (unsigned char) buf2[226] + (unsigned char) buf2[227] *256);
buf4.houtdoor = buf2[228];
buf4.toutdoor =( (unsigned char) buf2[229] + (unsigned char) buf2[230] *256);
buf4.pressure = (unsigned char) buf2[231] + ( 256*buf2[232]);
buf4.swind = buf2[233];
buf4.swind2 = buf2[234];
buf4.oth1  = buf2[235];
buf4.rain2 = (unsigned char) buf2[237];
buf4.rain =( (unsigned char) buf2[238] + (unsigned char) buf2[239] *256);
buf4.rain1 = buf2[238];
buf4.oth2 = buf2[239];

//------------------
buf5.delay1 = buf2[240];
buf5.tempi=buf2[252];
	if (buf5.tempi==0) strcpy(buf5.winddirection,"N");
	if (buf5.tempi==1) strcpy(buf5.winddirection,"NNE");
	if (buf5.tempi==2) strcpy(buf5.winddirection,"NE");
	if (buf5.tempi==3) strcpy(buf5.winddirection,"ENE");
	if (buf5.tempi==4) strcpy(buf5.winddirection,"E");
	if (buf5.tempi==5) strcpy(buf5.winddirection,"ESE");
	if (buf5.tempi==6) strcpy(buf5.winddirection,"SE");
	if (buf5.tempi==7) strcpy(buf5.winddirection,"SSE");
	if (buf5.tempi==8) strcpy(buf5.winddirection,"S");
	if (buf5.tempi==9) strcpy(buf5.winddirection,"SSW");
	if (buf5.tempi==10) strcpy(buf5.winddirection,"SW");
	if (buf5.tempi==11) strcpy(buf5.winddirection,"WSW");
	if (buf5.tempi==12) strcpy(buf5.winddirection,"W");
	if (buf5.tempi==13) strcpy(buf5.winddirection,"WNW");
	if (buf5.tempi==14) strcpy(buf5.winddirection,"NW");
	if (buf5.tempi==15) strcpy(buf5.winddirection,"NNW");
buf5.hindoor = buf2[241];
buf5.tindoor =( (unsigned char) buf2[242] + (unsigned char) buf2[243] *256);
buf5.tindoor &= 32767;
//buf5.tindoor = (unsigned char) buf2[242];
buf5.houtdoor = buf2[244];
buf5.toutdoor =( (unsigned char) buf2[245] + (unsigned char) buf2[246] *256);
buf5.toutdoor &= 32767;
//buf5.toutdoor = (unsigned char) buf2[245];
buf5.pressure = (unsigned char) buf2[247] + ( 256*buf2[248]);
buf5.swind = buf2[249];
buf5.swind2 = buf2[250];
buf5.oth1  = buf2[251];
buf5.rain2 = (unsigned char) buf2[253];
buf5.rain =( (unsigned char) buf2[254] + (unsigned char) buf2[255] *256);
buf5.rain1 = buf2[254];
buf5.oth2 = buf2[255];
//------------------
/*
buf4.delay1 = buf2[272];
buf4.tempi=buf2[284];
	if (buf4.tempi==0) strcpy(buf4.winddirection,"N");
	if (buf4.tempi==1) strcpy(buf4.winddirection,"NNE");
	if (buf4.tempi==2) strcpy(buf4.winddirection,"NE");
	if (buf4.tempi==3) strcpy(buf4.winddirection,"ENE");
	if (buf4.tempi==4) strcpy(buf4.winddirection,"E");
	if (buf4.tempi==5) strcpy(buf4.winddirection,"SEE");
	if (buf4.tempi==6) strcpy(buf4.winddirection,"SE");
	if (buf4.tempi==7) strcpy(buf4.winddirection,"SSE");
	if (buf4.tempi==8) strcpy(buf4.winddirection,"S");
	if (buf4.tempi==9) strcpy(buf4.winddirection,"SSW");
	if (buf4.tempi==10) strcpy(buf4.winddirection,"SW");
	if (buf4.tempi==11) strcpy(buf4.winddirection,"SWW");
	if (buf4.tempi==12) strcpy(buf4.winddirection,"W");
	if (buf4.tempi==13) strcpy(buf4.winddirection,"NWW");
	if (buf4.tempi==14) strcpy(buf4.winddirection,"NW");
	if (buf4.tempi==15) strcpy(buf4.winddirection,"NNW");
buf4.hindoor = buf2[273];
buf4.tindoor =( (unsigned char) buf2[274] + (unsigned char) buf2[275] *256);
buf4.houtdoor = buf2[276];
buf4.toutdoor =( (unsigned char) buf2[277] + (unsigned char) buf2[278] *256);
buf4.pressure = (unsigned char) buf2[279] + ( 256*buf2[280]);
buf4.swind = buf2[281];
buf4.swind2 = buf2[282];
buf4.oth1  = buf2[283];
buf4.rain2 = (unsigned char) buf2[285];
buf4.rain =( (unsigned char) buf2[286] + (unsigned char) buf2[287] *256);
buf4.rain1 = buf2[286];
buf4.oth2 = buf2[287];
*/



printf("Last saved values:
");
unsigned int remain;
if ( (showall==1) | ( o1==1) ) printf("224:		interval:		%5d
", buf4.delay1);
if ( (showall==1) | ( o2==1) ) { 
	printf("225:		indoor humidity		%5d
", buf4.hindoor);
	char string1[255];
	sprintf(string1, "<indoor humidity>%d</indoor humidity>", buf4.hindoor);
	appendfile(string1);	
}
if ( (showall==1) | ( o2==1) ) {
	printf("228:		outdoor humidity	%5d
", buf4.houtdoor);
	char string2[255];
	sprintf(string2, "<outdoor humidity>%d</outdoor humidity>", buf4.houtdoor);
	appendfile(string2);
}
remain = buf4.tindoor%10;
if ((signed) remain<0) remain = remain * -1;
if ( (showall==1) | ( o3==1) ) {
	printf("226 227:	indoor temperature	%5d.%d
", buf4.tindoor / 10 ,remain);
	char string3[255];
	sprintf(string3, "<indoor temperature>%d.%d</indoor temperature>", buf4.tindoor / 10 ,remain);
	appendfile(string3);
}
remain = buf4.toutdoor%10;

if ((signed) remain<0) remain = remain * -1;
if ( (showall==1) | ( o3==1) ) {
	printf("229 230:	outdoor temperature	%5d.%d
", buf4.toutdoor / 10 ,remain);
	char string4[255];
        sprintf(string4, "<outdoor temperature>%d.%d</outdoor temperature>", buf4.toutdoor / 10 ,remain);
        appendfile(string4);
}
remain = buf4.swind%10;
if ( (showall==1) | ( o4==1) ) {
	printf("233:		wind speed		%5d.%d
", buf4.swind / 10 , remain);
	char string5[255];
        sprintf(string5, "<wind speed>%d.%d</wind speed>", buf4.swind / 10 ,remain);
        appendfile(string5);
}
remain = buf4.swind2%10;
if ( (showall==1) | ( o4==1) ) printf("234:		wind gust		%5d.%d
", buf4.swind2 / 10 , remain);
if ( (showall==1) | ( o4==1) ) {
	printf("236:		wind direction		%5s
", buf4.winddirection);
	char string6[255];
        sprintf(string6, "<wind direction>%s</wind direction>", buf4.winddirection);
        appendfile(string6);
}
remain = buf4.rain%10;
if ( (showall==1) | ( o5==1) ) printf("238 239:	rain?			%5d.%d
", buf4.rain / 10 , remain);
remain = (buf4.rain2)%10;
if ( (showall==1) | ( o5==1) ) printf("237:		rain - ??		%5d.%d
", buf4.rain2 / 10 , remain);
if ( (showall==1) | ( o5==1) ) printf("248:		rain1			%5d
", buf4.rain1);
if ( (showall==1) | ( o5==1) ) printf("		rain2			%5d
", buf4.rain2);
if ( (showall==1) | ( o6==1) ) printf("235:		other 1			%5d
", buf4.oth1);
if ( (showall==1) | ( o6==1) ) printf("239:		other 2			%5d
", buf4.oth2);
remain = buf4.pressure%10;
if ( (showall==1) | ( o9==1) ) {
	printf("231 232:	pressure(hPa)		%5d.%d
", buf4.pressure / 10 , remain);
	char string7[255];
        sprintf(string7, "<pressure>%d.%d</pressure>", buf4.pressure / 10 ,remain);
        appendfile(string7);
}
if ( (showall==1) | ( o7==1) ) printf("		Current history pos:	%5x
", buf4.noffset);
printf("
");

//------------------
printf("Current values:
");
if ( (showall==1) | ( o1==1) ) printf("240:		Since last save:	%5dmin
", buf5.delay1);
if ( (showall==1) | ( o2==1) ) printf("241:		indoor humidity		%5d
", buf5.hindoor);
if ( (showall==1) | ( o2==1) ) printf("244:		outdoor humidity	%5d
", buf5.houtdoor);
remain = buf5.tindoor%10;
if ((signed) remain<0) remain = remain * -1;
if ( (showall==1) | ( o3==1) ) printf("242 243:	indoor temperature	%5d.%d
", buf5.tindoor / 10 ,remain);
remain = buf5.toutdoor%10;
if ((signed) remain<0) remain = remain * -1;
if ( (showall==1) | ( o3==1) ) printf("245 246:	outdoor temperature	%5d.%d
", buf5.toutdoor / 10 ,remain);
remain = buf5.swind%10;
if ( (showall==1) | ( o4==1) ) printf("249:		wind speed		%5d.%d
", buf5.swind / 10 , remain);
remain = buf5.swind2%10;
if ( (showall==1) | ( o4==1) ) printf("250:		wind gust		%5d.%d
", buf5.swind2 / 10 , remain);
if ( (showall==1) | ( o4==1) ) printf("252:		wind direction		%5s
", buf5.winddirection);
remain = buf5.rain%10;
if ( (showall==1) | ( o5==1) ) printf("254 255:	rain? this is always zero %5d.%d
", buf5.rain / 10 , remain);
remain = (buf5.rain2)%10;
if ( (showall==1) | ( o5==1) ) printf("253:		rain - 24h?		%5d.%d
", buf5.rain2 / 10 , remain);
if ( (showall==1) | ( o5==1) ) printf("254:		rain1			%5d
", buf5.rain1);
if ( (showall==1) | ( o5==1) ) printf("		rain2			%5d
", buf5.rain2);
if ( (showall==1) | ( o6==1) ) printf("251:		other 1			%5d
", buf5.oth1);
if ( (showall==1) | ( o6==1) ) printf("255:		other 2			%5d
", buf5.oth2);
remain = buf5.pressure%10;
if ( (showall==1) | ( o9==1) ) printf("247 248:	pressure(hPa)		%5d.%d
", buf5.pressure / 10 , remain);
if ( (showall==1) | ( o7==1) ) printf("		Current history pos:	%5x
", buf5.noffset);
printf("
");


//The only difference is the order of words in printf. This changes the description of values in graphs. Values are processed correctly anyway.
if (postprocess==1) {
printf ("For postprocessing
");
printf ("Interval	%d min
", buf5.delay1);
printf ("Indoor humidity	%d %%
", buf5.hindoor);
printf ("Outdoor humidity	%d %%
", buf5.houtdoor);
if ((buf2[243] & 128) > 0) {
	printf ("Indoor temperature	-%d.%d C
", buf5.tindoor / 10, abs(buf5.tindoor % 10));
} else {
	printf ("Indoor temperature	%d.%d C
", buf5.tindoor / 10, abs(buf5.tindoor % 10));
};
if ((buf2[246] & 128) > 0) {
	printf ("Outdoor temperature	-%d.%d C
", buf5.toutdoor / 10, abs(buf5.toutdoor % 10));
} else {
	printf ("Outdoor temperature	%d.%d C
", buf5.toutdoor / 10, abs(buf5.toutdoor % 10));
};
printf ("Wind speed	%d.%d m/s
", buf5.swind / 10, abs(buf5.swind %10));
printf ("Wind gust	%d.%d m/s
", buf5.swind2 / 10, abs(buf5.swind %10));
printf ("Wind direction	%d %s
", buf2[252], buf5.winddirection);
if (buf5.delay1 != 0) {
	printf ("Rain 1h	%.1f mm/h
", (double)((buf5.rain2 - buf4.rain2) + (buf5.rain1 - buf4.rain1)*256)*0.3*(60/buf5.delay1) );
} else {
	printf ("Rain 1h	%.1f mm/h
", 0.0);
}
printf ("Rain total	%.1f  mm
", (double)(buf5.rain2 + buf5.rain1*256) * 0.3);
printf ("Air pressure	%d.%d hPa
", buf5.pressure / 10, buf5.pressure % 10);
printf ("
");
}
//------------------

_close_readw();
time_t     now;
struct tm  ts;
char       buf[80];
// Get current time
time(&now);
// Format time, "ddd yyyy-mm-dd hh:mm:ss zzz"
// %a %Y-%m-%d %H:%M:%S %Z
ts = *localtime(&now);
strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &ts);
printf("%s
", buf);
char strtime[255];
sprintf(strtime, "<last update>%s</last update>", buf);
appendfile(strtime);
finishfile();
return 0;
}

Das kompilierte Tool starte ich dann über einen Cronjob alle 5 Minuten.
Der Cronjob sieht so aus


*/5 * * * * /root/weather.sh

Das Bashscript weather.sh hat folgenden Inhalt.

/root/weather -a
echo "Habe das Abholen der Wetterdaten gestartet."
cp weather.xml /var/www/html

Die weather.xml sieht so aus und kann im C Code beliebig erweitert werden.

<weather><indoor humidity>60</indoor humidity><outdoor humidity>49</outdoor humidity><indoor temperature>19.9</indoor temperature><outdoor temperature>23.6</outdoor temperature><wind speed>0.0</wind speed><wind direction>E</wind direction><pressure>967.0</pressure><last update>2014-07-03 09:55:03</last update></weather>

Wo sehe ich die Vorteile:

  • Der IP-Symcon Server bleibt von „laufenden“ Programmen (Easyweather oder Cumulus) befreit.
  • Der Raspberry Pi kann via WLAN angebunden werden und liegt nahe bei der Basisstation
  • Kein USB Device Server (Silex) notwendig. Der Raspberry Pi kostet mit Gehäuse und Netzteil fast weniger.
  • Der Raspberry Pi kann noch andere Aufgaben übernehmen. z.B. Asterisk PBX oder OwnCloud.

ToDo:

  • XML Erweitern um Regen (da werde ich aus den Variablen noch nicht schlau)
  • IPS Scripte schreiben und „last update“ auswerten.

Hat jemand eine Idee wie ich evtl. via wget auf dem Raspberry Pi IPS triggern kann die neue XML zu holen?
d.h. ich stelle mir vor, dass ich in das Shellscript einen wget Befehl einbaue, der in IPS die Aktualisierung der Variablen triggert, dann könnte auch „last update“ entfallen.

Viele Grüße
Chris

ich mache bei meinem Wetterscript ,btw in Perl geschrieben, einen netcat nach IPS

Also schreibe die Ausgabe direkt auf einen Socket. So werden die Daten neartime in IPS eingelesen…

und man braucht nur einen Job der sich drum kümmert - klappt sogar über VPN problemlos…

eine Frage habe ich noch: Bekommt das Script auch öfter mal „Got dud block - reconnecting“ odfer so ähnlich ???

Bei hängt es sich damit gut einmal die Woche auf…

Kann ich noch nicht sagen. Läuft noch keine Woche. Ich melde mich sollte ich etwas feststellen.

Hallo JPaeper,
bei mir steht der Luftdruck auch seit 6 Monaten konstant auf 1013,2mbar …anfangs wurde der Luftdruck noch einwandfrei angezeigt…irgendwann war das dann vorbei …ich denke das ist der „Preis für den Preis“:frowning:

Hallo JoeB,

hast Du mal versucht das zu beheben? Manchmal sind es ja ganz einfache Dinge?

Joachim

Hallo Joachim,
ich wollte bisher keine Schraube dafür lösen…hast Du den Drucksensor wieder zum Leben erwecken können?

Danke
Joe

von JoeB
Gesendet mit Tapatalk

…Nö…:smiley:

Ohne einen Ansatz was es denn sein könnte, traue ich mich da nicht ran - ist nicht meine „Fachrichtung“…:wink:

Joachim

Hallo,

Ich möchte auch soeine Wetterstation.
ist denn die WS-0101 noch zu empfehlen oder gibt es mittlerweile eine bessere? Ich möchte die auswertung nur unter windows laufen lassen geht das mit comulus jetzt stabil?

Danke

Ich habe damals die PCE-FWS 20 vom Weihnachtsmann bekommen, das ist mittlerweile 4 Jahre her ( 2010).
Sieht baugleich aus und Cumulus hat in den Jahren nicht einen Fehler gemacht.

Die Wetterstation selbst aber schon:

  • in sehr selten Faellen Ausfall der Funkverbindung
  • Niederschlag sehr haeufig mit utopischen Spitzenwerten
  • Windgeschwindigkeit ab und zu mit utopischen Spitzenwerten
  • mittlerweile haengt der Windgeschwindigkeitssensor ab und zu mal fest (ich gehe dann hoch, drehe leicht (kurzes knacken) und dann geht es wieder), das ist aber erst seit einem halben Jahr der Fall

ansonsten fuer den Preis schon recht in Ordnung.
Das Display habe ich über USB / LAN Adapter am Server.

mfg Benny

Danke für die infos…
meint ihr das neue modell funktioniert auch mit der Software?Wetterstation WH3080 ?

Nochmal ein kurzes Update zum Erfahrungsbericht:

Wetterstation (PCE-FWS 20) funktioniert immer noch gut, also jetzt nach 6 Jahren sage ich mal, die ist ihr Geld wert.

die wirklich sehr seltenen Ausfälle der Funkverbindung scheinen an zu niedriger Batteriespannung zu liegen, seit dem ich mir angewöhnt habe, vor dem Winter einen Satz volle Batterien einzubauen ist mir ein Ausfall nicht mehr aufgefallen.

die Spitzenwerte sind immer noch vorhanden

der Windsensor funktioniert wieder, das Kugellager war defekt, hab ich getauscht. Kosten 4 Euro.

Dem Fazit schließe ich mich an.

Als Problem kann ich aber für mich sogar nur die seltenen Fehlmessungen bestätigen. Dazu kommen zwei, drei kleine Schwächen der Basisstation: Sie (bzw. die USB-Verbindung) friert aller paar Monate mal ein und muss dann neu gestartet werden. Dabei gibt es regelmäßig Probleme, die Funkuhr zu synchronisieren und einige Einstellungen sind „vergessen“. Aber alles kein großer Ärger. :slight_smile:

Grüße
galleto