aboutsummaryrefslogtreecommitdiff
path: root/astro/fowsr
diff options
context:
space:
mode:
authorAlexander Leidinger <netchild@FreeBSD.org>2010-09-01 10:35:12 +0000
committerAlexander Leidinger <netchild@FreeBSD.org>2010-09-01 10:35:12 +0000
commitcd20669ff6bd14550c473d23522ffa8eb58a82fe (patch)
tree8a2a1736096cc988fb8d2eb289b36e380b344bb7 /astro/fowsr
parent065c12ba87df1e72f9b6f87c113b23d208253858 (diff)
downloadports-cd20669ff6bd14550c473d23522ffa8eb58a82fe.tar.gz
ports-cd20669ff6bd14550c473d23522ffa8eb58a82fe.zip
Fine Offset Weather Station Reader
Notes
Notes: svn path=/head/; revision=260351
Diffstat (limited to 'astro/fowsr')
-rw-r--r--astro/fowsr/Makefile37
-rw-r--r--astro/fowsr/distinfo3
-rw-r--r--astro/fowsr/files/patch-fowsr-c43
-rw-r--r--astro/fowsr/pkg-descr23
4 files changed, 106 insertions, 0 deletions
diff --git a/astro/fowsr/Makefile b/astro/fowsr/Makefile
new file mode 100644
index 000000000000..ae3e62d55d55
--- /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 000000000000..336958f5d1e2
--- /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 000000000000..d7eb95d15757
--- /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 000000000000..57469b5921b8
--- /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.