Page 1 of 1
Cumulus MX with Swedish locale
Posted: Sat 30 May 2015 8:26 pm
by rogerthn
Almost there
I've Cumulus running on Windows 8.1 and would like to replace it with my Raspberry PI 2.
To transfer "everything" from Windows to Raspberry I did install FileZilla Server on Windows, created a user Cumulus with C:\Cumulus as Home.
On Raspberry I did download CumulusMXDist3025.zip to /home/pi/Download and created the folder /home/pi/Download/CumulusMX
Installed mono according to
https://cumulus.hosiene.co.uk/viewtopic.php?f=27&t=13587
Installed lftp (sudo apt-get install lftp) and created a script as below
Code: Select all
#!/bin/bash
echo $0 started `date +%Y-%m-%d\ %H:%M:%S`
# Fix file owner
sudo chown -R pi:pi /home/pi/Download/CumulusMX/*
HOST="192.168.10.211"
USER="Cumulus"
PASS="password"
FTPURL="ftp://$USER:$PASS@$HOST"
LCD="/home/pi/Download/CumulusMX"
DELETE="--delete"
lftp -c "set ftp:list-options -a;
open '$FTPURL';
lcd $LCD;
cd $RCD;
mirror $DELETE --use-cache --verbose --no-perms --no-umask"
echo $0 done `date +%Y-%m-%d\ %H:%M:%S`
Once Cumulus.ini on my Windows PC was saved as UTF-8 I could use Trollhättan in LocName
Cumulus stopped on Windows and USB moved to Raspberry.
Run my script and then I did sed as below on Cumulus.ini and all ini-files in data/
sed as below was also used on Cumulus.ini
Code: Select all
sed '/C:\\Cumulus\\/s/C:\\Cumulus\\/\/home\/pi\/Download\/CumulusMX\//g'
cd into /home/pi/Download and unzip of CumulusMXDist3025.zip
Starting as below
Code: Select all
sudo su -
export LANG=sv_SE.UTF-8
cd /home/pi/Download/CumulusMX
mono CumulusMX.exe -lang sv-SE
The only? remaining issue is the name on the "month file" i.e. it used to be maj15log.txt but now it is Maj15log.txt and this makes a difference on Linux
Code: Select all
pi@PI2 ~ $ echo $LANG
en_GB.UTF-8
pi@PI2 ~ $ date +%b%y
May15
pi@PI2 ~ $ export LANG=sv_SE.UTF-8
pi@PI2 ~ $ date +%b%y
maj15
Is this configurable for Cumulus MX?
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 6:39 am
by steve
rogerthn wrote:The only? remaining issue is the name on the "month file" i.e. it used to be maj15log.txt but now it is Maj15log.txt and this makes a difference on Linux
Do you mean Maj15log.txt or May15log.txt as below?
pi@PI2 ~ $ echo $LANG
en_GB.UTF-8
pi@PI2 ~ $ date +%b%y
May15
pi@PI2 ~ $ export LANG=sv_SE.UTF-8
pi@PI2 ~ $ date +%b%y
maj15
If you're running it with a Swedish locale, it should get the date formatting from that. What locale do you have the Pi set to? Please attach the latest mxdiags file.
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 7:52 am
by rogerthn
The spelling is correct but not the "shift mode"
maj15 != Maj15
MXdiags.zip attached
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 8:47 am
by steve
If I run MX on my Pi running Raspbian, with "sudo mono CumulusMX.exe -lang sv-SE" it creates a log file called maj15log.txt. I don't know what it is about your system that is causing it to give 'Maj' as the short month name, unless it's something to do with the different way that you have chosen to start MX.
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 8:53 am
by rogerthn
OK, I'll give it a try without export LANG=sv_SE.UTF-8 later today.
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 12:00 pm
by rogerthn
Still Maj15log.txt starting with "sudo mono CumulusMX.exe -lang sv-SE" using PuTTY
I'm running on a PI 2 with mono according to
https://cumulus.hosiene.co.uk/viewtopic.php?f=27&t=13587.
Maybe you are running the older mono?
There seems to be some "issues" with datetime format with mono on Raspberry, are you able to share the
"filename creation code"?
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 12:08 pm
by steve
Yes, I'm still using Mono 3.2.8. The filename creation code just uses the "MMM" date format specifier on a DateTime value:
Code: Select all
return Datapath + logfiledate.ToString("MMMyy")+ "log.txt";
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 1:21 pm
by rogerthn
Some results when running attached HelloWorldMMMyy.exe
Swedish W8.1
C:\>HelloWorldMMMyy.exe
Hello World, below is DateTime.Now.ToString("MMMyy")
maj15
It's the same on English W7 Pro with Swedish Region and Language Formats
pi@PI2 ~ $ mono --version
Mono JIT compiler version 4.0.1 (tarball Tue May 12 17:22:22 UTC 2015)
pi@PI2 ~ $ echo $LANG
en_GB.UTF-8
pi@PI2 ~ $ mono HelloWorldMMMyy.exe
Hello World, below is DateTime.Now.ToString("MMMyy")
May15
pi@PI2 ~ $ mono --version
Mono JIT compiler version 4.0.1 (tarball Tue May 12 17:22:22 UTC 2015)
pi@PI2 ~ $ echo $LANG
sv_SE.UTF-8
pi@PI2 ~ $ mono HelloWorldMMMyy.exe
Hello World, below is DateTime.Now.ToString("MMMyy")
Maj15
Maybe it could be tested on Mono 3.2.8 before and after "export LANG=sv_SE.UTF-8"?
File created with MonoDevelop on my PI 2, code below.
Code: Select all
using System;
namespace HelloWorld
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World, below is DateTime.Now.ToString(\"MMMyy\")");
Console.WriteLine (DateTime.Now.ToString("MMMyy"));
}
}
}
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 1:33 pm
by steve
Code: Select all
pi@raspberrypi /mnt/samsung/steve $ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
pi@raspberrypi /mnt/samsung/steve $ mono HelloWorldMMMyy.exe
Hello World, below is DateTime.Now.ToString("MMMyy")
May15
pi@raspberrypi /mnt/samsung/steve $ export LANG=sv_SE.UTF-8
pi@raspberrypi /mnt/samsung/steve $ mono HelloWorldMMMyy.exe
Hello World, below is DateTime.Now.ToString("MMMyy")
maj15
pi@raspberrypi /mnt/samsung/steve $
Looks like a bug in Mono 4.0.1
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 1:35 pm
by rogerthn
steve wrote:
Looks like a bug in Mono 4.0.1
Yes
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 1:50 pm
by steve
At the time those instructions I posted for getting the later version were written, it appears that 3.10.0 was the latest version -
http://www.hanselman.com/blog/HowToRunA ... ryPi2.aspx
The same steps presumably now install 4.0.1? I wonder if 3.10.0 has the same bug...
Re: Cumulus MX with Swedish locale
Posted: Sun 31 May 2015 4:06 pm
by rogerthn
OK, I'll do some digging.
Re: Cumulus MX with Swedish locale
Posted: Mon 01 Jun 2015 4:24 pm
by rogerthn
Re: Cumulus MX with Swedish locale
Posted: Thu 04 Jun 2015 5:53 pm
by rogerthn
Looks like the bug has been there since version 3.4.0
Correct with 3.2.8
Code: Select all
[roger@CentOS ~]$ mono -V
Mono JIT compiler version 3.2.8 (tarball Thu Jun 4 19:06:42 CEST 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
[roger@CentOS ~]$ mono HelloWorldMMM.exe
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
jun
juni
tor
torsdag
Incorrect with 3.4.0 and later
Code: Select all
[roger@CentOS ~]$ mono -V
Mono JIT compiler version 3.4.0 (tarball Thu Jun 4 18:43:38 CEST 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled
GC: sgen
[roger@CentOS ~]$ mono HelloWorldMMM.exe
Hello World, below is DateTime.Now.ToString MMM, MMMM, ddd and dddd
Jun
Juni
Tor
torsdag
Re: Cumulus MX with Swedish locale
Posted: Sun 20 Dec 2015 5:16 pm
by rogerthn
Looks like Mono 3.2.8 is OK with Swedish locale
https://www2.rogerthn.se/weather/index.htm
Banana PI M1 running Raspbian wheezy with Mono 3.2.8
Locales generated: en_GB.UTF-8 and sv_SE.UTF-8 with en_GB.UTF-8 as default
Starting with
Code: Select all
sudo mono CumulusMX.exe -lang sv-SE
Next step will be to find a PI for the new weather station