The Weather with Raspberry Pi – unsettled but brightening up later

9 06 2012

Well, my Raspberry Pi weather station project has been stumbling along. So, first, a little update on where I am at with it.

pywws doesn’t work with my weather station, ws2350, not unexpected and a quick chat with its author confirmed it. There are a few other weather enthusiasts out thee who are trying to get it working on the RPi so check on the forums. I will be keeping an eye on progress as getting basic comms working is a common problem, as you will see….

Open2300 has been most successful at this point, its a simple set of programs that will obtain and decode the weather station data and help you use it, there is even a program that will update Weather Underground for you. Compilation on RPi did kick out some warnigns, but I had similar warnings when I compiled it on Ubuntu. The bad news, I am still not able to confirm this works on RPI, because…

Serial/USB converters – as you would expect, take two well defined standards, the latter of which was ushered in as the replacement for the former and connect them together, yeah, it was never going to just work was it! Lets be clear this is NOT a RPi issue, it’s bigger than that.

So my weather station, an entry level consumer product, about a hundred quid, has a serial link. It also comes with a serial to USB adapter as very few modern computers come with an old RS232 serial port. The USB adapter is well known as a source of endless data trouble with even the most reliable connections producing corrupt data from time to time.

Plugging this adapter, which identifies itself as FTDI, seems fine, its recognised but trying to run Open2300 with it hangs the RPi. hard to know which bit is at fault or if all of it is contributing. Running the same adapter and Open2300 under Ubuntu (on a PC not RPi) works fine though, the weather station data is retrieved and decoded.. Using a powered USB hub makes no difference in this case, the adapter is drawing around 25ma at most so power shouldn’t be the issue anyway.

To see if it was the weather station on the end of the wire causing the problem I dusted off a Psion Series 5 and serial cable, plugged it in to the RPi via said adapter and tried the terminal program, nothing, dead, hung RPi.

A second adapter arrived this morning, this time using the Prolifc PL2303 chipset (or rip off of), first off, as it was still sat on the desk, I plugged in the Psion Series 5 and, LIFE! The terminal app on the Psion communicated with the RPi.

Encouraged by some communications success I plugged in the weather station and tried Open2300, nothing for a few minutes then a time out of sorts. Moving the test to an Ubuntu PC produced the same disappointing result, it seems that although RPi is happy with the PL2303 the weather station is not.

So two different types (chipset) of Serial/USB converters and different failures. At this point I started to look for any other adapter types but on such cheap items expecting a datasheet is a little too much.

Clearly the combination of things is a key and finding an adapter that both the RPi and the WS2350 are happy with is critical, it could also be like looking for a very specific bit of hay in a haystack (I always thought that looking for a needle in a haystack sounded quite do abel to me, big magnet, little needle, problem solved)

It was time to start exploring alternative options and RPi is not without some, namely the GPIO header.

Next step, obtain or build an RS232 interface for the GPIO header, the good news is others are way ahead of me and it looks like it should be fairly straight forward, though I cant find anything pre-made for the RPi, yet.

After some hours trying to find out more about the issue via the RPi forums, lots of folks with similar issues, and more generally looking for Debian, Arm, FTDI and so on it would seem that the FTDI drivers are not ARM compatible, so if this is correct the FTDI based adapters are not going to work. I think them being identified by RPi when plugged in and checked means nothing at this point as that’s not using the driver it’s just listing the USB data, but I don’t know.

Advertisements




Raspberry Pi and the weather

29 05 2012

Ever since I heard about the Raspberry Pi project I knew that it would potentially be the ideal always on low power ‘pc’ to hook up to a weather station and fire data off to a web site. Realising that project has taken its first step with delivery of my first Raspberry Pi this week.

RaspberryPi

RaspberryPi

In outline the project is simple enough, use the Raspberry Pi device with a combination of pywws and Open2300 to read the data from my WS2350 weather station and ftp a data stream to my web site. Currently this is done using the excellent Cumulus software from Sandaysoft but this runs on a Windows based PC and finding a mini pc suitable isn’t cheap (which I regard as one of the main tenets of a hobby).

Currently my web site is built using various Cumulus bits but the principle is that Cumulus feeds a simple, structured text file every 15 seconds or so, via ftp, and the web site reads it and uses some basic JavaScript to dynamically update the page. A principle requirement of this project is that it either writes a compatible text file (in fact various text files for gauges and graphs etc) or I code a web site based converter that can take the Raspberry Pi feed and translate it.

Stage 1 will be to get the Raspberry Pi up and running with a stable OS, this should be fairly straightforward

Stage 2 will be interfacing the Ws2350 to the Raspberry Pi via USB (possibly via serial later)

Stage 3 will be seeing if pywws will run and read the ws2350, if not then some lower level investigation using Open2300 is going to be needed

Stage 4 will be to extract from Stage 3 a suitable file on a regular (cron) basis and ftp it to a web server (the web server will initially be one in my office, it may even be on the Raspberry Pi or another Raspberry Pi)

Each stage will be liberally inter spaced with as yet undefined quantities of alcohol which will be at various times proportional to success or inversely proportional to failure.

If any fellow weather geeks want to help out or just see how it goes I will try to blog progress here and no doubt on twitter via @stevewardell. If anyone has any ideas or suggestions or anything that may help this little venture I would be interested in hearing from you.

Let the hacking commence…

Update 30/5/12

Stage 1 held up a little awaiting some essential parts that I forgot to order initially then forgot again when I eventually got a shipping notice. Anyway, parts en route. I started to look in more detail at pywws and a few other similarly minded weather geeks have embarked on similar projects, so far it looks like the usb libs in the debian distro are dropping packets on the Raspberry Pi so there may be some issues there, also I still don’t know if pywws will even read my weather station at all.

In order to get things moving and determine if pywws was an option I set up on one of my Ubuntu servers in the office, after some fiddling to get the weather station recognised via usb/serial converter (Raspberry Pi has USB) and a few hours playing with pywws I’ve concluded it either doesn’t work with a WS2350 or I cannot get the right combination’s of usb libs to play with python. So pywws question passed to its author, in the meantime Open2300 checked out and compiled, a little configuration and success, a simple cron job has the weather station updating my Weather Underground site, all mostly thanks to the Open2300 code I have to say.

If I can decode the full memory map from the station with Open2300, which I think I can, then this looks like it should work out quite well, assuming it can be compiled on the RPi ofcourse





Installing Zend Optimizer Red Hat Enterprise Linux 5

24 08 2010

I recently had to install Zend Optimizer for a client using a particular WordPress plugin on one of the hosting severs I run. The plugin was encoded with Zend Guard and the optimizer provides run time decoding as well as some (questionable in my opinion) performance optimizations.

All my hosting servers run Red Hat Enterprise Linux and Plesk as the hosting control panel so I set about looking up something a little more informative than Zends pathetic notes on installation. This is where I started to come a little unstuck and found myself going backwards and forwards between different sets of installations instructions and a segmentation fault problem. Now typically when I get to this point I remember that Atomic Rocket Turtle has usually not only been there and done that, they also have a installation for it and a simple yum repo waiting, as always they did. I wont detail this method as its easy to find and anyone who should be doing it will know what to do and where to look.

After installing Zend Optimizer via Atomics repo I then looked at what it had actually done, to reverse engineer the install if you like, this I hoped would leave me with a simple way to install the required module without having to add the Atomic repos to servers that are under full patch management.

So  here are my simple notes.

These are based on using Red Hat Enterprise Linux 5 (or equivalent CentOS 5), PHP 5.1 (the standard PHP build for this distro) and Plesk 8.6. If you are using anything different you’ll need to adjust things in what I hope is a fairly obvious manner.

Firstly download the right Zend Optimizer package. Upload it to your server (Zend unhelpfully do not provide a direct download link) and unpack the tar ball.

Now find the right version for your version of PHP in the ‘data’ folder, for PHP 5.1 it’s in ‘5_1_x_comp’ inside will be a ‘ZendOptimizer.so’ this is the PHP module you will need to install, rename it to ‘ZendOptimizer-5.1.so’ then we will know which PHP version it’s for (Zend if you are reading this please try to follow some simple accepted standards with your naming).

In this environment PHP loads modules from ‘/usr/lib/php’ create a sub folder called ‘zend’ and copy the module into it.

Now create a file called ‘zend.ini’ in ‘/etc/php.d’ the file needs to contain the instruction to load the module ‘zend_extension=/usr/lib/php/zend/ZendOptimizer-5.1.so’.

Check things are ok with ‘php -v’ at the command line, if all is well you’ll get

PHP 5.1.6 (cli) (built: Mar 31 2010 02:44:37)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Now restart Apache and check the Zend Optimizer module is loaded with a simple phpinfo() script and make sure that your PHP scripts and so on are all still working.

You should have now successfully installed Zend Optimizer.





Google android on the HTC HD2

23 08 2010

I’ve been using the excellent HTC HD2 for quite a while now and its proven
to be a first class smart phone, with one black mark against it, it runs
Windows Mobile.

winmo, as it has become known has been around for years and has been a truly
awful operating system in its exposed form, its true value has been when
used on embedded systems which have hidden it from view and review.

With the arrival of iphone, android and even when compared to nokia symbian
or even blackberry its the outright loser by a long way. So it was quite a
surprise when HTC launched the HD2 and hobbled it out of the gate.

The HD2 hardware is leading edge and the screen is still one of the largest
on any smartphone. Which makes it even more bizarre to see the disappointing
Windows boot screen when you power it on.

To be fair to HTC they did an amazing job layering a very bespoke front end
on to of the awful Windows UI, Sense was lipstick on the pig. It was very
good lipstick but it was still a pig underneath.

As HTC continued to launch new phones, mostly running android the inevitable
calls for an upgrade from winmo to android started to be heard, HTC actually
said they could do it, then cruelly didn’t!

Rumors started to spread of a band of developers working on porting android to
the HD2, XDA soon had posts with devs making progress and soon after there
were videos showing work in progress android running on HD2 hardware.

I was watching carefully, but I use my phone everyday and couldn’t afford for it to
be sacrificed to a partially working android or worse a complete bricking.

Then in the last few days it looked like they had cracked it, android was
working. I downloaded the latest version, upgraded the phones radio and
carefully followed the simple instructions.

There it was, android. I did a lot of testing then started to select the
applications I would need. Everything was working, I decided to trial it for
reliability and stability for a week.

Here we are on day three and I can’t see what could happen now to make me
want to go back to winmo.

It feels like I have a new phone, probably the phone the HD2 should have
always been.

Hats off to the devs at XDA.





Ubuntu 10.04 Desktop and Netbook

1 05 2010

With the arrival of the Ubuntu 10.04 Release Candidate I took the plunge and did fresh installations on both my Desktop and Netbook. I’ve previously tried the Alpha and Beta and was generally impressed with the evolution of Ubuntu. My netbook is a ‘never leaves my side’ kind of thing and has to be 100% reliable and operational. My desktop is a compliment to my main desktop, which out of necessity, runs windows. The linux desktop provides my media, social networking, chat/IM, browsing/monitoring and secure access to numerous systems.

10.04 is an evolution but one in an evolutionary process that has visibly slowed down recently.That’s not to say there has not been a lot of work going on or that 10.04 is not impressive, there has and it is. When I say visibly I do mean visibly. Yes its a prettier place to live but, for example, its not got the next generation of Gnome. For that we will wait, hopefully for the next version of Ubuntu, however I do wonder how many who have opted for this latest LTS will not upgrade until the next LTS?

So, what was the install like? Well, it was pretty painless. The Operating System installed quickly, booted with no trouble (and booted fast but don’t believe the hype, its not that fast!). Sound, graphics, media cards all played nicely out of the box. It only took a short while to replace the now, quite frankly, hopeless FireFox with Opera, install the other usual suspects of my daily desktop life and be operational. I’ve always preferred a simple dock to desktop shortcuts or quick launch icons so I installed (as usual) Avant Window Navigator (0.4.0) and replaced the lower panel. I have to say AWN has improved, it feels a little more together than it used to and its not like it was bad before.

My only gripe with the new look and feel is that on a multi desktop system the close, min, max buttons are missing a menu drop down to send the window to another desktop. A right click on the title bar takes care of it but this is something that needs to be covered in the next release when, hopefully, we will see the reason why controls are on the left (ala Mac) and not the right (ala Windows), that space thats opened up on the right is going to have purpose soon we are told.

Media playback is sadly still not there out of the box, licensing and re-distribution can be blamed for this I think. Happily its not difficult to quickly have your MP3’s and DVD’s spinning away. I had one issue with Handbrake, but this was resolved by using the latest snapshot and should be resolved now that 10.04 is on general release. GIMP had to be pulled out of the repo’s as its not part of the standard install, no big deal really but silly in my opinion

BBC iPlayer, Tweetdeck, Filezilla, Dropbox and Skype all worked fine. I installed Sunbird, a screenlet I use to provide weather updates from Weather Underground and my own weather station and that was more or less that, desktop done.

Ubuntu 10.04 Desktop

Ubuntu 10.04 Desktop

The story was barely any different installing the Netbook Remix onto my EeePC901, though the desktop is, of course, the UNR standard.

Ubuntu 10.04 Netbook

Ubuntu 10.04 Netbook

One of the new features in 10.04 is better integration between the desktop and the various social networking offerings, twitter and facebook really. This takes the form of two tools, yes two, why use one when you can make everyone do everything twice? Emapthy (which replaced Pidgin as the standard IM client back in 9) handles chat and Gwibber takes care of social broadcasting to twitter and facebook.

I have to say its good to have the ability to have a single chat client, Empathy, to work with Yahoo, MSN and Facebook but it does not handle Skype – I’m not blaming anyone but this is really a huge shortcoming now for me. Skype remains outside but has become almost ubiquitous for voice and IM communication. Not having integration into a single messaging client is something that needs to be addressed. Always preferring the open route I would prefer to see Empathy (or other) include at the very least Skype IM if not voice, however, I wonder why Skype has not built the IM ability for the other popular clients?

The ‘broadcast’ client, gwibber (come on guys, time to pay someone to come up with better names) is pretty weak and not without its problems. but it works in a pretty neatly integrated fashion and lets be fair and say that with some TLC it will do the job, but it needs some love pretty soon. No one who uses facebook or twitter much already will bother with it, they will install tweetdeck or whatever. But it might help tempt newer users into the social media and networking club. Its  quick to get something out in a hurry but links, pictures, etc, forget it!

Its pretty ironic to think, again as with all things in computing tech, that we have advanced so far only to be no further forward in real terms. In much the same way that cloud was my old mainframe, the latest fancy Excel spreadsheet fails to better my old Lotus 1-2-3, now the new gwibber and empathy and skype still need as many clients as MSN, Yahoo and AIM did before. Anyway, enough of that….

There is a lot more, people are raving about the Ubuntu One Music store, sorry but I cant think of anything less exciting. I dont use iTunes and I cant see me using this. I would like to see a native Spotify client though.

I mentioned above that I installed Dropbox, Ubuntu One has been around for a while but to be quite honest it still feels unreliable, slow and badly made. However the killer is its not got a Windows client (or anything else for that matter) so its useless for me and I suspect many many others. It does however, if you can use it, allow you to synch ANY folder not just a single specified one like Dropbox. Thats a very nice feature.

Performance wise I would say its too close to call. My desktop is nothing special, its getting on and doesn’t have a spec to die for. 9 was fine, 10 doesn’t feel faster in any tangible way but it does feel a little more together and it does boot that little bit faster too. On my netbook, again not the latest hardware, I would say its the same story. In short it all runs fine and I suspect on more modern tin its going to be a real delight. The bottom line here is that I can continue to take advantage of new features, better looking desktops, without having to shell out on new hardware. Thats a big plus with linux and Ubuntu.

There is no question 10.04 is a good operating system, if you already use Ubuntu its a no brainer upgrade. I usually find problems in a week of use and I’ve not had anything so far. Its been stable and reliable and everything works as it would.

Upgrade now, you wont regret it (however if you do don’t come crying to me!)





Linux Desktop Cohesion part 1

3 01 2010

I’m a big fan of Linux and also Windows, I work on a simple concept of using the right tools for the job. All the servers I work with are Linux based, but that’s because it provides the right environment and performance over Windows (though its a much narrower advantage now than ever before). If Windows turned out to be the right server for as particular deployment, in exactly the same way if a Sun box or iSeries did, then I would use it. Operating System Fundamentalism is pointless and does nothing to drive forward anything useful.

On the desktop it gets more complex. Windows works. OSx works. Linux really struggles. Why does Linux struggle? Well look at Windows and OSx, they do not provide a dozen different window managers, desktop managers, theme engines, windows controllers, widgets, gadgets, thingies, whatsits and godknowswhateles. They do one! I’m all for diversity and choice but how about some natural selection too? (or is that what’s happening and the Linux Desktop is breeding itself out of the gene pool?)

Under Windows or OSx pretty much every thing works in a similar way, looks the same at the application control level, uses the same mechanisms for interaction. One of Linux’s greatest features is the one thing that continually stops it making any real inroads into the desktop market. Saying Linux allows you to make it work exactly how you want it to is great, pointless, but great. Sadly though no one wants to spend a week building a desktop environment that works and doesn’t hurt their eyes. Even distributions that try to (and continue to) tidy up the mess only get so far and once you go past the very basic and very short list of distributed applications you’re lost in a sea of miss matched GUI’s and bad UX. I think a fair measure of acceptable levels of success would be to be able to move from word processor to email to IM to web to micro blogger without having to adapt to 5 different UI’s for the basic applications.

You would (sensibly) think that this mess should have been resolved by now, but in my opinion its getting worse. Its probably true to say that Gnome and KDE represent the two dominant desktops under Linux and they are both as bad as each other. I love them both but boy they make it hard to create a desktop environment that looks decent and works across all the applications required. And its not just the Linux side that continues to make a mess of it, so called ‘cross platform’ systems like Adobe AIR also make a hash of it, seriously how much of an ask is it to expect a application to use the standard frame buttons for min/max/close?

So how much of this is down to the development philosophy of ‘my way is better’, well possibly all of it. I’m not saying ‘your way’ isn’t better, but if it makes ‘your’ application behave differently then quite likely that’s going to mean it doesn’t get used as much as it would otherwise do.

The UI/UX battleground is a war torn landscape dotted with small victories lost in a mire of defeats.

Perhaps the increasing number of interface systems; desktop, web, mobile, netbook, is making for a problem that is simply too large, too out of anyone’s hands to ever be solved in a meaningful way. Gesture based multi touch can greatly simplify things and if you can think past your preconceived ideas of Windows Icons Mouse Pointer, can be intuitive and productive, but it does not lend itself easily to being a cross device method. We will see multi touch desktop based systems and even if their price makes them real they wont work as the keyboard is the primary interface and ‘touch’, multi or otherwise is a control method.

An early conclusion could be that the reason we have such a diverse ecosystem of interfaces is because no one has got it right yet, I would say that after Xerox got the basics and everyone stole/copied it progress has been very slow.

So, what do I want for my Linux desktop? Well I would like to be able to have a desktop environment where everything worked well, was easy to make it look like it is all part of the same thing (without a degree in astro-emerald-compiz-physics) and looked good out of the box. Until then I will still be using it as a desktop (alongside Windows of course) but I’ll be one where a thousand others will stick to Windows (or OSx) only.

Posted via email from Steve’s Blog





JoliCloud moves into Pre-Beta

29 12 2009

Previously I wrote about Jolicloud while I was testing different Linux distributions on my EeePC netbook. I chose distributions that were, in theory, better suited to life with a netbook. After some basic trial use of Google ChromeOS, Ubuntu Netbook Remix, Moblin and Jolicloud I settled on Ubuntu and for the last month I’ve been using it quite successfully on my little EeePC 901.

The thing I liked about Jolicloud was its ‘Jolicloud application installer’ this provides a whole slew of applications ready to install and not just the off the shelf Linux stuff, this also has applications that would normally require you to compile from source or run through Wine (the pseudo windows emulation library for Linux)

Since that initial look Jolicloud, which is based in Ubuntu so shares the same solid foundation, has gone from alpha to pre-beta. Pre-beta drops the need to be invited to try Jolicloud and opens it up to the wider world, in their words, “We consider the product and its installation stable and simple enough for a broader release.”, I would agree.

Now the thing that potentially interests me again in Jolicloud is the ‘New UI’, reading the Jolicloud blog further reveals this to be a lot of theme and icon redesign with the goal of providing a more consistent feel to the, lets be honest, mixed bag of typical Linux distro’s.

The launcher has been given a HTML5 makeover and looks greatly improved, cleaner, clearer and ultimately more usable. Compare

with the current/old

It seems to me that if Jolicloud roll out the UI update and pull off a good attempt at a cohesive UI for Linux then they will have a success on their hands. Google’s play is to simplify (dumb down?) the UI to a HTML5 browser, but its tomorrow’s toy, Jolicloud looks set to offer this today.

Season the mix with 98% netbook compatibility and a Windows installer that will install Jolicloud alongside Windows on your netbook (assuming you have the disk space) and there might never be a better time to give Jolicloud a spin and see what the latest world of Linux has to offer the daily netbook user.

So I am going to be re-installing Jolicloud soon, once that new UI is available, and quite possibly moving on from Ubuntu Netbook Remix. That is as soon as I get hold of a new SD card to load it onto.

Posted via email from Steve’s Blog