Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

New input mode for homebrew station?

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
LA1HSA
Posts: 5
Joined: Sun 02 Aug 2015 3:29 pm
Weather Station: Argent Data
Operating System: Linux
Location: Oslo, Norway

New input mode for homebrew station?

Post by LA1HSA »

Hi all,

I've been a lurker here for some time and I've been using Cumuls MX on a Pi together with a Fine Offset station. Big success so far and I'm thankful for all the work steve put into this! It does the job without any major issues, although my Fine Offset is another matter.

I can't say that I've seen other threads about this, but I have tried to search for it. On my own wishlist, I'd love to have an input to Cumulux MX that supports basic clear text serial data, probably CSV or something that is easy to manage and send from a microcontroller. Why? As I'd love to modify my own homebrew station to be able to talk to Cumulus without having to implement the Davis protocol.

My own station is based on several MCUs (AVR) and will gather and display data on my own console, not too different from Weatherduino, but incorporates a lot of extra sensors for indoor climate control and future outside sensors. I can imagine that more people would be able to make their own station if they could export their data in a more common format, at least I do :)

So steve; I'm not sure how hard it would be to implement this? I don't think it would require too much effort compared to the Davis and Fine Offset protocols, as you wouldn't have to all the magic with the data coming in. You're the programmer here, so this is just my impression of how things are done.

I'm really sorry if this has been asked before, I just couldn't find anything about it. Anyway, thanks a lot for Cumulus MX :D
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: New input mode for homebrew station?

Post by steve »

What other people have done quite successfully is to generate a file in easyweather.dat format. Cumulus repeatedly reads the last (or only) line in the file, watching for the timestamp changing, then uses the new data as input. This is described in the wiki - http://wiki.sandaysoft.com/a/EasyWeather_Format
Steve
LA1HSA
Posts: 5
Joined: Sun 02 Aug 2015 3:29 pm
Weather Station: Argent Data
Operating System: Linux
Location: Oslo, Norway

Re: New input mode for homebrew station?

Post by LA1HSA »

Thank you steve, that is of course a way to do it. Have thought of using it, but it limits me to only use data that Fine Offset normally provides (no "extra sensors" in Cumulus).

I can use that approach until I manage to put out some Davis data so I can get soil temp, moisture etc.
LA1HSA
Posts: 5
Joined: Sun 02 Aug 2015 3:29 pm
Weather Station: Argent Data
Operating System: Linux
Location: Oslo, Norway

Re: New input mode for homebrew station?

Post by LA1HSA »

So, I've been trying to fight the Davis protocol for some time now, but it seems I need to study it some more, not getting the proper results yet.

Meanwhile, I could try to use the Easyweather.dat approach so I at least get some data flowing. What I need to do to get that working, is saving serial input on the Pi to that file, but unfortunately I can't find any way of doing that unless I program it myself. I'm not into Python or any other way of programming on Linux (yet), so I wonder if anyone can give me a hint or help me out how I should approach this. I made an app for this on Windows (.NET) which works perfectly, but it would be hard getting that to run on Linux, especially when there's no running X-server on it.

What I need it to do:
A program running all the time (manually started), waiting for a string on /dev/ttyUSB0 and saves that string to Easyweather.dat, deleting/overwriting the old contents.

It should be simple, but I'm pretty clueless when it comes to Python.

Any help would be greatly appreciated :)
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: New input mode for homebrew station?

Post by steve »

Won't your .NET app run under mono?
Steve
LA1HSA
Posts: 5
Joined: Sun 02 Aug 2015 3:29 pm
Weather Station: Argent Data
Operating System: Linux
Location: Oslo, Norway

Re: New input mode for homebrew station?

Post by LA1HSA »

Unfortunately not, as it's a form and I have no way of displaying a form on a text-only console.
LA1HSA
Posts: 5
Joined: Sun 02 Aug 2015 3:29 pm
Weather Station: Argent Data
Operating System: Linux
Location: Oslo, Norway

Re: New input mode for homebrew station?

Post by LA1HSA »

I had to tinker a bit with Python so this could be done. It was actually quite easy and it works just fine with Cumulus now. Examples and manuals I found on the net helped me a lot.

Posting the script here if anyone happens to be in the same situation as me:
Note: This may be awful code for anyone who knows Python, but this is my first attempt, so please don't hang me ;)

Code: Select all

import serial

con = False

port='/dev/ttyAMA0'

try:
    print "Connecting to ",port
    ser = serial.Serial(port, 19200)
except:
    print "Could not connect to ",port

## Waiting for connection
while not con:
    serin = ser.read()
    con = True

## Save incoming data to this file    
weatherdata = open("Easyweather.dat", 'w')

## Data is available and will be saved to file
## Note: For my purpose I will only have one single line of data in the file at all times
while 1:
    if ser.inWaiting():
        x=ser.readline()
        print(x) 
        text_file.seek(0)
        text_file.truncate()
        text_file.write(x)
        text_file.flush()

## Close file and serial port
weatherdata.close()
ser.close()
Locked