Ser2Net and ADS-WS1

180 views
Skip to first unread message

mi...@walkertechnology.ca

unread,
Mar 17, 2016, 9:16:40 AM3/17/16
to weewx-user
All

I've burned out so many PI cards with the WeeWx logging and WS1 errors that are logged that I have decided to us the PI as serial tunnel and move the wx data to a full blown cloud based Linux box.  I can't get a class 10 card to last more than 6 months.

I can figure out how to get Ser2net functional on the Pi that connects to the WS1 but I am having a mental cramp on how to configure Weewx for the ADS-WS1 to make it call ipaddress:port.

I did some searching, but I have yet to find the answer yet.

For the port statement, how would I specify it?


    # Serial port such as /dev/ttyS0, /dev/ttyUSB0, or /dev/cuaU0
       port = /dev/ttyUSB0

Or, do I need something else to connect the IP ports and present a dev port to WeeWx host?

Thanks

Mike

Thomas Keffer

unread,
Mar 17, 2016, 9:49:06 AM3/17/16
to weewx-user
Can't really answer your question, but perhaps you could pass on to Vince what brands of cards have not worked for you.

One thing worth noting: the "class" of a card is a measure of its speed, not its longevity.

I have a Sandisk Extreme Plus still going strong after 15 months of continuous use.

-tk


--
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.
For more options, visit https://groups.google.com/d/optout.

mi...@walkertechnology.ca

unread,
Mar 17, 2016, 10:00:27 AM3/17/16
to weewx-user
What I am finding is the the cards are hit and miss and there are Chinese clones of what are supposed to be the best (even the Sandisk ones).

Going back to running in on the card is not the way I want to go at this time (unless we can turn off all logging).

I don't log my data locally anyway and I prefer just to push it all to Weather Underground.  I let them store it for free.  :)

I do have a Pi running a Peet station and that card has been running for 3 years, but all I have is a script that reads the data and pushes it to WU.  There is very limited writing to the card.

Mike

Thomas Keffer

unread,
Mar 17, 2016, 10:19:25 AM3/17/16
to weewx-user
It's easy enough to turn off all logging, or to filter it for just the most important stuff.


-tk

mwall

unread,
Mar 17, 2016, 10:32:21 AM3/17/16
to weewx-user
mike,

see the weewx wiki for general suggestions about reducing writes:

https://github.com/weewx/weewx/wiki/Minimize%20writes%20on%20SD%20cards

i have weewx running on plug computers (since 2011) and pi (since 2014) that save to local sqlite database, but do their logging and html generation to tmpfs.  they all upload data to numerous services (emoncms, seg, remote mysql, etc).

setting up tmpfs is trivial.  i usually make a /var/weewx tmpfs and direct the log to /var/weewx/log and the html pages to /var/weewx/www.

on some systems i put the sqlite database in /var/weewx/db then run a cron job every hour to rsync the /var/weewx/db directory to local sd and/or remote storage.  (this assumes that it is better to do fewer, larger writes than to do many, smaller writes - unfortunately i don't know of any generic tools for sd cards that would actually measure this)

while developing the ws28xx driver i learned the hardware way about sd burnout: the (soldered on) sd in one of the plug computers burned out in 6 months when i mistakenly left the debug level set to high with logging to the sd instead of tmpfs.

with only a 5 minute write to sqlite database, the other systems have been chugging along nicely.

it would be nice if there were some way to know how much life is left in an sd card, or at least have some indication of when a failure is pending (a la smart for spinning disks).

m


mwall

unread,
Mar 17, 2016, 10:40:35 AM3/17/16
to weewx-user
On Thursday, March 17, 2016 at 9:16:40 AM UTC-4, mike wrote:
I can figure out how to get Ser2net functional on the Pi that connects to the WS1 but I am having a mental cramp on how to configure Weewx for the ADS-WS1 to make it call ipaddress:port.

I did some searching, but I have yet to find the answer yet.

For the port statement, how would I specify it?


    # Serial port such as /dev/ttyS0, /dev/ttyUSB0, or /dev/cuaU0
       port = /dev/ttyUSB0

Or, do I need something else to connect the IP ports and present a dev port to WeeWx host?

mike,

nominally the ws1 driver tries to open the port as a serial device.

however, kevin and paul caccamo recently added serial-to-tcp capability to the ws1 driver.  the 'mode' option determines whether the driver will use tcp, udp, or serial as the source.  look at the bin/weewx/drivers/ws1.py source and comments for details.

try setting mode=tcp and port=address:port

kevin and paul's testing was done with a specific type of serial-to-tcp hardware, but it just might work with the pi implementation as well.

m

Michael Walker

unread,
Mar 17, 2016, 10:52:35 AM3/17/16
to weewx...@googlegroups.com
Let me check with Paul.  He is a good friend of mine.

thanks


--
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/fjjVpAXjidI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Michael Walker

unread,
Mar 17, 2016, 11:14:01 AM3/17/16
to weewx...@googlegroups.com
This might be the clue I need.  :)  

thanks


DEFAULT_SER_PORT = '/dev/ttyS0'
DEFAULT_TCP_ADDR = '192.168.36.25'
DEFAULT_TCP_PORT = 3000
PACKET_SIZE = 50
DEBUG_READ = 0

Michael Walker

unread,
Mar 17, 2016, 1:51:37 PM3/17/16
to weewx...@googlegroups.com
I got it working, but I will have to redirect messages as these will fill.  For some reason, the buffer reading on the WS1 can be an issue.  While this is more than expected (I'm still working on it), it is a lot.


==> /var/log/syslog <==
Mar 17 13:47:42 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 1
Mar 17 13:47:52 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 5
Mar 17 13:48:02 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 9
Mar 17 13:48:15 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: timed out
Mar 17 13:48:25 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 11
Mar 17 13:48:35 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 16
Mar 17 13:48:45 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 19
Mar 17 13:48:55 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 17
Mar 17 13:49:05 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 26
Mar 17 13:49:15 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 31
Mar 17 13:49:25 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 35
Mar 17 13:49:35 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 38
Mar 17 13:49:45 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 42
Mar 17 13:49:55 va3mw-spider weewx[15922]: ws1: Failed to get data for some reason: Unexpected buffer length 44

mi...@walkertechnology.ca

unread,
Mar 28, 2016, 10:28:02 AM3/28/16
to weewx-user
Thanks to Paul VA3PC and his son Kevin, this works beautifully.  

Do a very basic ser2net config (the port to listen to and the address of the serial device).  

Almost no I/O on the PI (and no load).   Lots of 802.11 network traffic, but that is free for me.  

Later, I did figure out it was best to do a wee_config for the WS1 and it prompted me for the ports and source IP address.


Mike va3mw


wee_config --reconfigure --driver=weewx.drivers.ws1

Reply all
Reply to author
Forward
0 new messages