diff options
author | netchild <netchild@FreeBSD.org> | 2010-09-01 18:35:12 +0800 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2010-09-01 18:35:12 +0800 |
commit | 0e8384a71693472e4c924b2f3a63d408938b670f (patch) | |
tree | 43ae4079c539587c9f21ecb1f65beb75da3b413f /astro/fowsr | |
parent | f70969a6a94520e81a09e0abe008cb5ed6ec0247 (diff) | |
download | freebsd-ports-graphics-0e8384a71693472e4c924b2f3a63d408938b670f.tar.gz freebsd-ports-graphics-0e8384a71693472e4c924b2f3a63d408938b670f.tar.zst freebsd-ports-graphics-0e8384a71693472e4c924b2f3a63d408938b670f.zip |
Fine Offset Weather Station Reader
Diffstat (limited to 'astro/fowsr')
-rw-r--r-- | astro/fowsr/Makefile | 37 | ||||
-rw-r--r-- | astro/fowsr/distinfo | 3 | ||||
-rw-r--r-- | astro/fowsr/files/patch-fowsr-c | 43 | ||||
-rw-r--r-- | astro/fowsr/pkg-descr | 23 |
4 files changed, 106 insertions, 0 deletions
diff --git a/astro/fowsr/Makefile b/astro/fowsr/Makefile new file mode 100644 index 00000000000..ae3e62d55d5 --- /dev/null +++ b/astro/fowsr/Makefile @@ -0,0 +1,37 @@ +# ports collection makefile for: fowsr +# Date created: 01 Sep 2010 +# Whom: Alexander Leidinger +# +# $FreeBSD$ +# + +PORTNAME= fowsr +PORTVERSION= ${FILEVER}.${FILEDATE} +CATEGORIES= astro +MASTER_SITES= GOOGLE_CODE +DISTNAME= fowsr-${FILEVER}-${FILEDATE} + +MAINTAINER= netchild@FreeBSD.org +COMMENT= Fine Offset Weather Station Reader + +FILEVER= 1.0 +FILEDATE= 20100718 +WRKSRC= ${WRKDIR}/${PORTNAME}-${FILEVER} + +LICENSE= GPLv3 +USE_GMAKE= yes +MAKE_JOBS_SAFE= yes + +PLIST_FILES= bin/fowsr + +USE_DOS2UNIX= yes + +post-patch: + ${REINPLACE_CMD} 's:gcc:${CC}:g' ${WRKSRC}/Makefile + ${REINPLACE_CMD} 's:/usr/bin/fowsr:fowsr:g ; s://var//://var/tmp//:g' \ + ${WRKSRC}/*.sh ${WRKSRC}/fowsr.c + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/fowsr ${PREFIX}/bin/ + +.include <bsd.port.mk> diff --git a/astro/fowsr/distinfo b/astro/fowsr/distinfo new file mode 100644 index 00000000000..336958f5d1e --- /dev/null +++ b/astro/fowsr/distinfo @@ -0,0 +1,3 @@ +MD5 (fowsr-1.0-20100718.tar.gz) = 34a53f0ba60a62636feef3e09d9e4312 +SHA256 (fowsr-1.0-20100718.tar.gz) = ec43baea6bfe4523f8b5badd62c0adea239012a9bdd4c0d4d0c3fbc1a3e6ecbb +SIZE (fowsr-1.0-20100718.tar.gz) = 35716 diff --git a/astro/fowsr/files/patch-fowsr-c b/astro/fowsr/files/patch-fowsr-c new file mode 100644 index 00000000000..d7eb95d1575 --- /dev/null +++ b/astro/fowsr/files/patch-fowsr-c @@ -0,0 +1,43 @@ +--- fowsr.c.orig 2010-07-18 18:06:30.000000000 +0200 ++++ fowsr.c 2010-09-01 10:59:58.004518772 +0200 +@@ -110,13 +110,17 @@ + + signal(SIGTERM, release_usb_device); + ++#ifdef LIBUSB_HAS_GET_DRIVER_NP + ret = usb_get_driver_np(devh, 0, buf, sizeof(buf)); + printf("usb_get_driver_np returned %d\n", ret); + if (ret == 0) { + printf("interface 0 already claimed by driver \\'%s\\', attempting to detach it\n", buf); ++#ifdef LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP + ret = usb_detach_kernel_driver_np(devh, 0); + printf("usb_detach_kernel_driver_np returned %d\n", ret); ++#endif + } ++#endif + ret = usb_claim_interface(devh, 0); + if (ret != 0) { + printf("claim failed with error %d\n", ret); +@@ -159,12 +163,14 @@ + FILE* f; + if (isStoring == ISREADING) { + if (f=fopen(fname,"rb")) { ++ printf("using cache file %s\n", fname); + n=fread(&m_previous_timestamp,sizeof(m_previous_timestamp),1,f); + n=fread(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); + } + print_bytes((char *)&m_previous_timestamp, sizeof(time_t)); + } else { // ISWRITING + if (f=fopen(fname,"wb")) { ++ printf("updating cache file %s\n", fname); + n=fwrite(&m_timestamp,sizeof(m_timestamp),1,f); + n=fwrite(m_buf,sizeof(m_buf[0]),WS_BUFFER_SIZE,f); + } +@@ -566,6 +572,7 @@ + + FILE* f; + if (f=fopen(fname,"a+s")) { ++ printf("writing to %s\n", fname); + + // Header + switch (arg) { diff --git a/astro/fowsr/pkg-descr b/astro/fowsr/pkg-descr new file mode 100644 index 00000000000..57469b5921b --- /dev/null +++ b/astro/fowsr/pkg-descr @@ -0,0 +1,23 @@ +fowsr is an application that reads from wireless weather stations + * WH1080 / WH1081 / WH1090 / WH1091 / WH2080 / WH2081 + * Watson W-8681 + * Scientific Sales Pro Touch Screen Weather Station + * TOPCOM NATIONAL GEOGRAPHIC 265NE + * PCE-FWS 20 + * ... +and other similar USB devices from Fine Offset Electronics Co., LTD. +compatible with the EasyWeather application . + +The result is a weather history log file that can be uploaded to a central +server for further processing. Example script files for uploads is included. +So far the following formats are supported: + * Weather Underground + * pywws + * XML + +fowsr performs a complete read out of the weather station memory using its +USB port, and stores the result in a cache file to speed up later read-outs. +Rain data is then calculated per hour, day, week and month if data for these +periods exist. No further data processing is performed. This makes fowsr +very small and well suited for running in embedded devices at remote +locations. |