I know I’ve asked before but I am wondering if there has been any progress running WXSim and its associated programs under Linux either using Wine or Mono? I am getting fed up with my Windows 7 box and at some stage it is going to fail so I need to move it to Linux. Please do not suggest I either upgrade Windows (not affordable) or use VirtualBox as well since I need a working Windows install for that. There are plenty of solutions for running weather programs under Linux so that is not an issue. I have tried to run WXSim using Wine but either nothing happens or in the case of WXSimate it errors but does display the gui.
I know the same executable can be created to run under both Linux/Mono and Windows (CumulusMX does this) and I have suggested this to Tom in the past but I understand this is more of a hobby than a business for him so he probably does not have time.
If I cannot find a solution using Wine then sadly sooner rather than later I will have to cease creating my own forecasts when I eventually have to ditch Windows 7 and migrate to Linux.
Funny, I was just talking to Sam Bohler on the phone about this idea a few minutes ago! I don’t have Linux myself, but several years ago, my son was playing around with it (he knows way more about such things than I do) and I think I recall he had WXSIM running under WINE. Maybe that also involved something called “WINE tricks” (that’s from memory). It may be worth a shot!
I tried with winetricks but still no luck. I’d also be interested in Linux (Ubuntu) version. “Weather” laptop is the only machine I still run Windows OS on.
Tom I will do some more testing. I have a second small PC which I can install and run Linux on. I know at present my openSUSE Tumbleweed distro is not a good option as it is very leading edge so I’ll try another more stable one and see how it goes.
It might be worth contacting Mark Crossley (the author of CumulusMX) to see how he manages to create one single image which runs on both Windows and Linux (using Mono a .net compatibility program). I have no idea if it is straight forward or not all I know is that CumulusMX runs out of the box on both OSes.
I have been having a play with Wine on openSUSE Leap14 on my Gigabyte Brix small format PC. Having used winetricks to add some extra support DLLs etc I have now managed to get WXSim, WXSimate WXSimlite and Wret all starting under wine and WXSimate downloads all the files including Ozone! However this is only the start but it does look promising. I now need to copy my live WXSim folder across to this PC and test the latest beta build and actually see how much I can get to work running a real forecast. I’ll update further as soon as I have any news.
I am making slow progress on this. Right now I have an issue with WXSim not being registered despite having my correct 9 digit code entered. I have emailed Tom about this and until I can resolve this I can do no more testing.
I think I might have solved my issue with registration now. Still have further issues to resolve though. Seems like it does not l;ike the paths to the data under wine. More work to do!
I have managed to make some progress but in order to do this I needed to actually install WXSim under Wine and configure it rather than simply copy over my working directory from my weather PC. A potentially much bigger issue is one of performance. I am running this on one of two Gigabyte Brix PCs with a Celeron chip and although I have yet to manage a full forecast it looks like it might take maybe 5 or more times longer than it does on my main Brix PC running WD, CMX, Apache and a few PHP scripts where WXSim forecasts take 4-5 minutes. This Linux PC is only running WXSim under Wine nothing else.
Anyway testing continues to try and obtain some accurate run times etc…
So far I’ve been able to get pretty much everything starting OK I’ve even managed to run a forecast in auto mode although not without errors. I can confirm at present the forecast run takes about 20-25 minutes under Wine on this small footprint PC with a 1900mhz Celeron processor as compared to 5-8 minutes native on an identical PC running Windows 7. I may find ways to speed this up but right now the main concern is getting everything to run error free. I am talking to Tom about these issues and hopefully they will get resolved.
Also right now I run CumulusMX as well on this PC natively under Linux and use the data from that for WXSim rather than network this PC to my WD PC for the data, I have several months worth of CMX data so that is not an issue for running WXSim.
Once it all works OK error free I’ll see what can be done about performance. Considering I think most people run not more than about 4 forecasts per day I suspect this adequate on this PC but I have no idea if say an RPi would cope.
Further testing has shown that if the option to run WXSim on autorun with the forms minimised then the run time is comparable to my Windows version run time around 5-8 minutes so it shows how much overhead there is with running under Wine with heavy graphics being used!
So now I have to get autolearn and WXSimlite both working, the programs open ok but there are a few issues which I need to resolve.
I know Tom wants to publicise running WXSim under Linux using Wine and I agree it does look feasible but there is a little way to go yet before it is straight forward. Because I have been playing with the wine settings and extra installs so much I have not saved a comprehensive list of what needs to be done under Wine to make it all work. I’ll do my best to get a list but it may have some errors or omissions in it. Certainly for an experienced Linux person it should give no insurmountable problems. I do still think that running on an Raspberry Pi might not be feasible but I don’t have one to test with, as for normal PCs the faster the processor the better it will run because of the overheads of translating all the calls.
It’s a while since I updated this thread so though I should do it now.
I have got WXSim running now well under Linux but there is a big issue which I am talking to Tom about. It is the thorny issue of Linux vs Windows line endings. For a few who may not know what this is Unix uses a LF (line feed) character only as the end of line and Windows uses CR/LF (Carriage Return/Line Feed) character pair.
Now WXSim runs under Wine in Linux but it has to process (in my case) CumulusMX log files and CumulusMX runs in native Linux mode using Mono, so while all the files WXSim creates under Wine contain the Windows line ending CumulusMX creates them with Unix line endings. I have found that WRET and WXSimLite cannot handle Unix line endings on the log files, however WXSimate seems to have no such issues when reading log files to load local data.
The upshot of all this is that Autolearn and WXSimLite analysis cannot run error free because of this issue.
I have been discussing this with Tom and hope he will come up with a solution for it.
I thought it an appropriate time to update this thread again.
The big stumbling block in getting WXSim fully working on Linux has been the thorny old issue of CR/LF versus LF line endings. But now I think we have a workable resolution to it. However it does mean a bit of extra work in setting it all up. Basically we have had to copy the relevant log files from the Linux directory where they are created to a new directory for WRET and WXSimlite to read from using the unix2dos command in a cron job. I realise this doubles the amount of disk storage needed but it is the only way. I must add that WXSimate does not have this issue reading log files because it was written in VB.Net which handles the data fine, it is only WRET and WXSimLite which have the issue and it stops autolearn and the analysis in WXSimLite.
A bit of background as to why we are where we are with this. Tom is not a professional programmer and when he started WXSim many years ago he wrote it all in VB6 which at the time was OK. Now he is in a position where it is not possible for him to re-write this huge suite in a later programming language which is supported, and frankly I completely understand, after all it works fine on Windows still today and he knows his code so it is fixable if/when there are issues and his main concern is getting it to forecast weather in the best possible way. He has done quite a bit of work to see if he could do this inside his code but the only way he found took 45 minutes to read 16 days worth of log data so as you can imagine this is a non-starter.
So in my testing a unix2dos command runs so quickly as to seem to be instantaneous and is capable of taking the Linux created log file and making a copy in a new directory with CR/LF line endings which can be processed by the WXSim suite.
I have created a basic PHP script which can be run as a cron job in Linux and will be testing this as a cron later today followed by autolearn and analysis in WXSimLite. I will update again in a couple of days with the results of my testing.
Then I will put together a complete (hopefully ) a set of instructions on how this was done for those who would like to do this.
Well I now have the complete WXSim suite running under Linux and using data in this case from CumulusMX although I see no reason why data from Weather Display could not be used either running on the same Linux system or network connected from a Windows system. In my view it is probably simpler to run all Linux versions. The beauty of running CumulusMX is that the same executable runs on Linux and Windows so the setup is easily transferable.
There are a few minor twists to doing this but it is not difficult and only uses freely available functions in Linux. I will be documenting how I did all this in the next few days (as I recover from Covid ). Once complete I will make it available for anyone who wants to do this. I know people are looking at running things on smaller and lower powered PC like RPi, to be honest I have no experience of the RPi and while I think a top end one might cope I have only done this on a small footprint Gigabyte Brix PC with a Celeron chip and that copes easily.
My objective from the start was to be able to remove my last and rather old Windows 7 system and only have Linux running in this household!
I assume this is running with a Linux GUI frontend rather than just a command line interface? All of my regular Linux servers are command line only so I might have to investigate how to run a GUI version in the cloud.
I’m not worried about overhead. The servers I’ll be running this on are 16 core with 128GB of RAM so a little bit of GUI shouldn’t be a problem
I just don’t have suitable software installed right now to run a secure GUI connection and I’ll need to investigate how to do that. I’m busy working out how to completely containerise my remote systems and I intend creating a VPN tunnel from my home to the containers but haven’t done that yet. I can probably run a VNC connection across a VPN to give me secure access.
The more I think about it the more I’m convinced you need a gui as all the WXSim programs open windows to set up etc. I don’t think Tom ever envisaged running without a gui, one of the lightweight options (lxde etc) might well work. Although mine all runs with a Windows Wine Desktop open on Linux I run with everything minimised on that as that does reduce the overhead as it is not actually updating the screens all the time. The two things which take a while to run are autolearn and WXSimLite analyse but they run overnight. The only programs I have on this PC are CumulusMX and the WXSim stuff. I also run this Brix box through a KVM switch so no permanently connected real screen, keyboard or mouse.
A further update on this. I noticed that I had the occasional problem where WXSIM etc would fail and seemed to crash Linux. I think I tracked it down to running all the WXSIM suite 24x7 as there is no task scheduler which can run under Wine and they were running out of various system resources.
To resolve this for now I have created a php script which can run each program at the appropriate time and I now set each WXSIM program schedule to close after running. This way each run starts with a fresh copy of the program and hopefully cleans up all used resources when it exits. I’ve only been running this for a couple of days so it needs time to find out if it solves all the resource issues, so far so good (when I don’t have a typo in the script )
I did try a cron job but in Linux trying to run a cron job which requires a GUI program to start is problematic because it does cannot access a screen easily, and so far I’ve not cracked it.