Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#13

AW: Gibt es Wetterstation mit dokumentierten API?

  Alt 20. Sep 2013, 14:59
Ich habe hier ein LINUX-Programm gefunden, das direkt über den USB-Port ausliest:
Fine Offset Weather Station Reader - Lightweight Linux USB Wireless Weather Station Reader
https://code.google.com/p/fowsr/down....130910.tar.gz

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. Adding a 3G USB modem to an embedded device such as the NSLU2 or Fritz!Box makes it possible to receive weather data from remote weather stations with very limited hardware.


Code:
After sending the read command, the device will send back 32 bytes data wihtin 100ms.
If not, then it means the command has not been received correctly.
*/
   char buf_1 = (char)(ptr / 256);
   char buf_2 = (char)(ptr & 0xFF);
   char tbuf[8];
   tbuf[0] = 0xA1;      // READ COMMAND
   tbuf[1] = buf_1;   // READ ADDRESS HIGH
   tbuf[2] = buf_2;   // READ ADDRESS LOW
   tbuf[3] = 0x20;      // END MARK
   tbuf[4] = 0xA1;      // READ COMMAND
   tbuf[5] = 0;      // READ ADDRESS HIGH
   tbuf[6] = 0;      // READ ADDRESS LOW
   tbuf[7] = 0x20;      // END MARK

Geändert von hathor (20. Sep 2013 um 15:15 Uhr)
  Mit Zitat antworten Zitat