The Computer Corner Take II (#12) by Bill Kibler

To see more Computer Corner articles look here: CCII page or check out the Home Page .

Doing Weather with WS2300, WIZ110SR, RFXcom, heyu, and wview

The Twisted Plot begins.

This whole project uses all past skills and experiences, for something clear out in left field. It all started many weeks back when my wife was suggesting I grown olive trees on our ten acres. We had considered wine grapes, but at $10K and acre, totally out of budget. Olive oil is very much the in-thing these days and as such many have started planting new orchards. I was not convinced until I was trying a new bottle of stuffed olives - I am hooked on them - and had an idea for a killer stuffing. The stuffing project is on a back burner - need time and a good supply of stuffable olives to experiment on - for now. The trees however is the beginning of this story.

I know farming pretty well and was reluctant to do olives knowing that it is never as simple as just putting a few trees in the ground. I checked the web and found several somewhat local suppliers of olive tree stock. I assumed wrongly as it turned out, that I could use a portion of one pasture for the trees, thinking their tap root would get through the poor surface soil - we back filled the low water soaked portion with clay from our pond digging. So next step was education - bought books from ANR - the Davis Ag departments book seller - only to find two issues of big concern. The first is no tap root, olive trees generally spread out their roots and keep within the top two to three feet of good dry and well drained soil. Well that killed my low spot idea, but the upper part of the pasture is good soil and well drained - just relocate them. The next kicker was the lowest temperature that they can withstand - for some types it is 20F.

They group oilve trees in three groups: hardy, moderate, sensitive. Sensitive trees can go just below freezing, but not for long. Moderate trees can survie into mid 20s, while hardy is good to below 20 - some types as low as 14F. The real variable is the size of the wood stock, small stems can be killed easily below freezing, while larger stock and older trees can take longer freezing before any damage. As a side note, olives for stuffing are usually picked in early October, when the fruit is green, while oil olives can be much later in the year - Dec-Jan in some cases. This all means I should know what my low temperature is to help decide which varities to get.

It just so happens I have temperature records on line from 5 years back, all from using my simple temperature recording equipment. I checked my records and see a pretty consistent 23 degrees at least once each December and January for my lows. It looks like we start dipping below freezing sometime in November till late January. Day time highs are well above freezing except for very rare years - in which case all planning is for nothing. The good news is I know my minimum values, or do I? The reading were all done around my shop/office complex and may be higher than what we see in the actual pasture. I don't have sensors where the trees will be. Most likely my readings are only one or two degrees off, but it shouldn't be that hard to find out - or should it?

More Fun Stuff to Play With

I bought, several years back, a La Crosse WS2316 weather station. It was cheap but had wind, temp, and rain guages with a small display that could be connected to a PC. The outdoor items are connected by wireless on 433MHZ and I figured it should be possible to monitor those signals. When I first considered that option, I checked the web and found a linux group doing just that - I think, as I have been unable to find them again. What I did find was a company called RFXcom that sells a reciever that understands X10 and other weather instrument protocols. The price is $150 wether you buy from them in Europe, or their US outlet - CheaperTronics. The price was too high, so I looked at both simple recievers in the Mouser catalog - about $15 to $20 each - and tried to find the actual definitions of the protocols used. At the time I drew a "zip" on finding the protocols, which made me think that maybe paying extra for a working converter was not such a bad idea.

I decided this project was mostly about getting pasture readings and not about doing my own decoding. I ordered from CheaperTronics and a week later had my unit. I opened it, don't, there is nothing to see except one small board with two small chips, and on the main board is the serial to USB converter - that is all. I would have trouble guessing that there is more than $25 in hardware, although their output is probably rather small, so they could have high production costs. Even still I feel their pricing is a bit high. Does it work, not with La Crosse, but it does work with Oregon Scientific sensors.

At the time I didn't have any OSI sensors, but on an errand I stoped at Radio Shack and picked up a wireless temp unit for $21 that had a OSI unit. I popped that unit apart - it has RS IDs on the outside, but inside the board said "THGR122NX". Now that is for a temp and humidity sensor - but this one is missing the humidity sensor, so regular board, just not all there when from RS. I hooked it all up and got nothing I could see and as I started digging it turns out that would be correct. All the communications is some form of binary coding, so no simple minicom for testing - but then what?

heyu to the rescue

Searching for linux and OSI and RFXcom, got me a program called "heyu" that said it can use RFXcom units to talk to X10 units (and control them) as well as use OSI sensors for getting weather data. Just what I needed and when downloaded it looks pretty good - has a mode to just collect OSI sensor data (and others) into a file - perffect! Loaded it all on my SuSE 11.1, compiled and saw tons of ignorable errors go by, but it works. I followed their instructions and was seeing the OSI temperature reading in a couple of hours of going from docs to trying this or that. You have to use an "Alias" which controls how the binary stream is decoded, which I am not sure I like, but it works pretty well and once you have it all setup, it outputs enough information to be worth all the work.

So at this point I have a sensor on my desk talking to the RFX reciever a whole foot away. My pasture is over 300 feet away and everything says about 100 feet range for the sensors. Is that true? I used the wip antenna from RFXcom and yes it seems about 100 feet is it. Being a ham, I have a few unused antennas on my roof, one is a gain 450MHZ mobile whip. Using that I saw an improvement to about 200 feet. While having the unit open, I noticed the antenna was wrapped around a small cardboard tube - would un-rolling it help. Unrolling it worked very well, I could get about 350 feet depending on surrounding objects.

What I did was pop the small plastic cap off the mounting screw hole in the backside of the case, ran the antenna wire through the hole, took a wire wrap in a circle, and looped the end over the wrap. Now it can be hung from the antenna, but just to help take some of the weight off, I glued the cap on the outside squeezing the wire with the glue. So the case takes the weight and yet you have 6.47 inches of antenna to extend the range. It is currently out in the pasture, and I am getting values every 40 seconds into a log file I can later search or parse and put on the web.

I have ordered more sensors from the OSI web site where you can get them for about $15 each depending on how many sensors it has. The heyu docs have a list of supported versions of sensors they support, it is pretty big and includes power (as in house power) sensors, besides weather units. I noticed they support RFXcom sensors, and sure enough RFXcom has a line of sensors that are a bit pricey but could be used as well. While checking out the RFXcom sensors I fond their doc that explains the OSI coding, so I could have done it myself, but I am glad I didn't. I might point out that I moved the program from my work station to the web server - a SuSE 10.3 version, and when compiled there, I got no errors.

La Crosse, WIZ110SR, and wview

I could buy more OSI sensors for wind and rain, but I already have the WS2316 that just needs to be connected to a pc. While finding "heyu", I crossed a linux tool called "wview" or weather view for linux. They said it supported the WS2315 and I figured it would be close enough it should work. At the same time I was doing all this, I was finishing off the buildroot article and the SimpleNET article as well. That work had me looking again at small arm boards and I dropped by Saelig to see what was new. What caught my eye was a new WIZ device - the WIZ110SR - a serial to internet board for $24!

You see my problem is where the WS2316 is located, in our TV room. Nice place but well removed from all my computers in the office. Everything everywhere has a network drop but the WS2316 is serial, so the just found WIZ110SR should do the trick. I order two units and the following week had it in hand. It seems pretty straight forward, a small unit about 2 by 3 inches with power and ethernet on one end, and DB9 on the other. My only complaint is using windows for their configuration setup, although your suppose to be able do it from any terminal connected to the serial port - that failed for me.

So I set the baud rate, 2400 8N1, IP address, and some optional flow control settings and tried it with minicom. Zip, nothing. OK I say, lets try "wview". I loaded it without problems, followed the docs step by step and was up and running somewhat. I tried all sorts of things but nothing using the WIZ worked. I brought the WS2316 to my office and tried it serially, worked fine. Got a nice web page, but had trouble using a soft link path with apache2. Used yast on SuSE and found I had not turned on followlinks properly - seems the web doc directory setting are not in httpd.conf, but in default-server.conf.

So I proved everything works just fine using the serial option, while the WIZ is a no go. I don't give up easily, so I did some digging and found a program and site called open2300. Seems the La Crosse units are called WS2300 as that represents a whole class of the units. There is a page there that explains the protocol used, all from actual testing as the company is not giving it out, and pointed out one fact - DTR/RTS are not handshakes. It seems La Crosse talks serially, but uses DTR/RTS as voltage references, at least that is what the page said.

My major complaint about the WIZ products is their documentation. My complaining about documentaion is nothing new, I find most products well under documented, but for the WIZ folks, English is not their native language and it shows. Put on top of that the lack of a true 110SR schematic and you got issues. The schematic I could find for the 105SR shows that DTR is open, goes nowhere. I ohmed it out and confirmed it is floating. RTS is a control signal.

I followed the article and grounded DTR, tried it nothing. Tried a few other things and know that RS232 mark is negative voltage, so wonder if the article is wrong in some way. Easy to check, just check voltages using the USB adapter that was working earlier. The working unit has DTR as -6v and RTS at +6v. Clearly not the same, but not far off either. Maybe I just need -6v not ground. So I check the schematic again, wish it was the right one, and see that the RS232 chip, has -V on pin 6. At this point I have cut RTS signal, so that I can fix it at some positive voltage, say the 5V supply voltage, and have a wire from pin 6 going to DTR. I try this and everything is working on my desk.

I return the unit back to the TV room and hook it all up again to the WIZ110SR and my network. First that happens is numerous failures and I think the wiz wasn't fully initialized. Being an 8051 based unit it can be slow starting up. Restart wview and it makes the network connection but quickly starts having problems. The unit is now two switches away and the error message look like timeouts? Fire up the WIZ control program and change the handshaking from 300ms to 30ms and all is fine now. The WIZ has three options for sending data, time based, count based, or actual character based. Count is variable depending on command, and everything is binary data, so that leaves timing. I have no idea what the best timing would be, but 30ms worked fine for me and thus that is it.

Happily Working as Planned

At this point I think I have all the basic blocks in place. I can get readings from the future tree locations, I can even add a few more sensors very easily now. I have an online weather station page and can get data from it for other uses. What is left is to intergrate it all into one database system with a searchable web page of weather conditions from over the years. As it stands now I will be able to check several records in the spring to see just how low my pasture temps got over winter. From there I will select some tree type of olives and do my planting once frost danger is over.

My overall experience has been positive, I found two good programs that saved me hours of work and in fact got things working very fast. I found a great new toy in the WIZ110SR and I am already planning on some other tests to do rather soon. The RFXcom products work as advertised, but are a bit pricey for what you get - although I must say in the end the expense proved to be worth it. The bottom line in this case was some good fun, a few problems solved, and lots learned. What more could you ask for.

Check out the results here: WS2300 Weather .

Front side of board with jumper.

Back side of board showing jumpers. Note: trace was cut as pin 7 turns toward edge of board.

Here are some usefull links:

RFXCom home page
CheaperTronics home page
Saelig home page
wview home page
heyu home page
WS2300 protocol page
UC Davis ANR home page
ANR Catalog page some free downloads!

Kibler Electronics, PO Box 535, Lincoln, CA 95648-0535, USA.
Copyright © 2011, Kibler Electronics