import sys
import serial
import numpy as np
print("give /dev/USB0 or /dev/tty0 or /dev/ACM0 as argument to this code")
ser = serial.Serial(sys.argv[1], 9600)
while True:
data=[]
received=ser.readline()
for word in received.split(",")
data.append(word)
array=np.asarray(data)
#Step 1: import array data in SQL and/or
#Step 2: import array data in display library
#Arduino organisation of the output sentence in csv format
#Serial.print("lon,lat,altitude,sats,date,GMTtime,winddir");
#Serial.print(",windspeedms,windgustms,windspdms_avg2m,winddir_avg2m,windgustms_10m,windgustdir_10m");
#Serial.print(",humidity,tempc,raindailymm,rainhourmm,rain5mmm,rainindicate,pressure");
So far I can see only stations and single sensor attempts. Is there an internal Python parser that is configurable to absorb such kind of communication string?
On Mar 7, 2015, at 6:48 PM, mwall <mw...@users.sourceforge.net> wrote:
On Saturday, March 7, 2015 at 12:54:41 AM UTC-5, Yann Chemin wrote:So far I can see only stations and single sensor attempts. Is there an internal Python parser that is configurable to absorb such kind of communication string?
Ah yes indeed, thx for that.
string.split will turn a comma-delimited string into an array of values. but that is probably not the question you are really asking…
is your intent to run weewx on the arduino to which the serial device is attached?
do you intend to have one program write data to a file, then have weewx read from that file? (see the fileparse extension in weewx if you want to do that)
do you intend to create a weewx driver to read directly from the serial device? (see the ws1 driver for the simplest example of how to read from a serial device)
m--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/hB1knRFdSvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Had to put the driver in the SVN tree and build+install again, then add a section [MWS] in weewx.conf with the driver = ... thinggy. Daemon is up, waiting for data...
--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.