Page 1 of 1
Recovering MX properly from locale issues
Posted: Wed 05 Aug 2020 6:57 pm
by SamiS
I have been running Cumulus 1 on windows since 2010, and migrated to MX on Raspberry Pi many years ago. Until recently, I was running MX build 3062 on Raspbian Stretch with Mono 4.0.5.1. My locale is finnish, meaning my date separator has always been [.] and time separator [:], and this is still the way win10 handles finnish locale by default afaik.
However, officially finnish time separator is [.], and after upgrading my Pi to Raspbian Buster and Mono 6.10, for some reason my Cumulus installation wants to use the official time separator instead of the "commonly used" colon. This of course makes all my old data problematic.
I got Cumulus 3.7.0 up and running quite properly just by replacing time colons with dot on this current monthly datafile. But I presume, that this was only a very partial fix, since all monthly logfiles contain times with wrong separator, as does dayfile.txt. Should I edit and replace all data txt files? And what about monthly and yearly ini-files?
Or should I still try to re-configure my raspbian so that it uses colon as time separator like most of my data? And is this even possible, or are the locale settings coming from mono package and hardcoded inside it?
Re: Recovering MX properly from locale issues
Posted: Wed 05 Aug 2020 7:19 pm
by sfws
SamiS wrote: ↑Wed 05 Aug 2020 6:57 pm
Should I edit and replace all data txt files? And what about monthly and yearly ini-files?
I can't answer this and most of your other questions, but
SamiS wrote: ↑Wed 05 Aug 2020 6:57 pm
And is this even possible, or are the locale settings coming from mono package and hardcoded inside it?
you can over-ride the mono locale - see
https://cumuluswiki.org/a/Cumulus_3_(MX ... ing_Locale EDIT: Corrected link
Whether that is a sensible way forward for you, I also do not know. Hopefully, someone else will give you the advice you need.
Re: Recovering MX properly from locale issues
Posted: Wed 05 Aug 2020 8:49 pm
by mcrossley
Unfortunately mono uses its own hardcode locale settings and ignores the system values

And yes the latest version of mono changed lots of locales to match the "official" definitions.
Changing the locale you start CumulusMX with to one that uses your previous [.] and [:] separators sounds attractive, but be aware the locale also defines the decimal and list separators, and the month names. So probably a non starter.
So I think you are stuck with editing the files. As you are on Linux "sed" will be your friend I think!
Re: Recovering MX properly from locale issues
Posted: Sat 08 Aug 2020 4:44 pm
by SamiS
Ok, thank you Mark, you confirmed what I already had kind of prepared myself into. As a windows guy from my background I'll maybe take look at powershell's import-csv and export-csv-functions. It is quite good on handling structured data on scripts, but I never have tried to actually manipulate the input data before exporting it. Sed is a tool I have never touched in any occasion.
However after reading wiki about log files, I am still a bit confused.
On wiki both
Standard log files and
Dayfile.txt do state very clearly, that colon is the only time separator accepted by MX. So if I edit all my data and logs to use [.] as time separator, all will not fall apart?
Could you also please confirm which files I absolutely must repair, and which are basically only "history" that is not processed by cumulus in any situation?
dayfile.txt - yes
mmmyyylog.txt - yes
alltimelog.txt and monthlyalltimelog - not necessary (looks like it just logs if something changed ?)
monthly and yearly ini files - (?)
The time and date format on ini files is different than in other files. Does this matter anything or should I edit all of those also?
One thing also came to my mind... One solution would be downgrading and freezing my mono version to a older one which still uses colon as finnish time separator. But this might cause problems later if you implement some new dotnet features in future builds? And of course it still would mean some editing to my data to remove all the time marking which are presently written with dot separator...
Re: Recovering MX properly from locale issues
Posted: Mon 10 Aug 2020 9:29 am
by mcrossley
If it is writing the "." time separator in the file, then that is what it uses.
The ini files use their own date/time/decimal formats independent of your locale (hurrah!).