Page 1 of 1
Run as Service Question
Posted: Fri 15 Oct 2021 1:33 pm
by Herbaldew
I just set my RPi to run CmX as a service. All appears to work fine so far.
I am curious about one thing though, after about 20 seconds or so I have two files created that are not created when I start CmX manually as I have always done previously.
My CmX folder is located at "/home/pi/CumulusMX". The created files are: /home/pi/CumulusMXrealtime.txt and /home/pi/CumulusMXwxnow.txt (next to my CmX folder, not in it).
Any idea why this is happening? Again, all appears to be working fine.
The attached MXdiags log is from a clean start up until the files are created then shut down.
Edit: Changing "AutoUpdate=1" to "AutoUpdate=0" in the FTP section of Cumulus.ini stops the creation of CumulusMXrealtime.txt (I don't use FTP uploading). No clue on CumulusMXwxnow.txt - the only instance of this on the whole internet seems to be this thread
I still don't see anything not working properly, but am still curious

Re: Run as Service Question
Posted: Sat 16 Oct 2021 10:15 am
by mcrossley
Could you try changing the home path in the service file to "/home/pi/CumulusMX/" and see if that fixes it?
Re: Run as Service Question
Posted: Sat 16 Oct 2021 1:46 pm
by Herbaldew
Already is - Here is my service file, I took it from the pre-made image on the download page and did some editing. The "ExecStartPre" line was added because without it, the sockets would connect on a manually start, but not after a reboot.
The restart entries is what took me down this route to start with. I have always had CmX loose contact with my WifiLogger (and MeteoBridge before that) a couple times a week. But lately it has been happening several times a day. I was thinking about getting a MeteoPi so that the connection was hard wired then saw it mentioned that when CmX is installed as a service, that is can be set to restart on failure - problem solved.
Closing in on 24 hours and still everything seems to be working perfectly.
Code: Select all
[Unit]
Description=CumulusMX service
After=network-online.target
[Service]
User=root
Group=root
ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "systemd-timesyncd.* Synchronized to time server"'
ExecStart=/usr/bin/mono-service -d:/home/pi/CumulusMX CumulusMX.exe -port 8756 -wsport 8888 -service
Type=forking
ExecStopPost=/bin/rm /tmp/CumulusMX.exe.lock
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Re: Run as Service Question
Posted: Sat 16 Oct 2021 9:10 pm
by Cortmalaw
Herbaldew wrote: ↑Fri 15 Oct 2021 1:33 pm
No clue on CumulusMXwxnow.txt - the only instance of this on the whole internet seems to be this thread
If you google wxnow.txt (which is what the filename is meant to be), you'll find plenty hits, including the Cumulus Wiki, where there is a description of the content of that file.
I think the error that you have is a missing '/' between the path and the filename (for both files) - hence Mark suggested checking the path settings - then you should get both files correctly named and correctly located. I don't know the Service file structure, but maybe there is meant to be a closing '/' in your -d parameter to make
I think you can probably turn off creation of wxnow.txt at Settings / Third Party Uploads / APRS/CWOP (set to disable if you don't want it)
Re: Run as Service Question
Posted: Sun 17 Oct 2021 2:52 am
by Herbaldew
The "/" did not make a difference and all uploads were already disabled.
I decided to start CmX the way I always have in the past and discovered that realtime.txt and wxnow.txt were created inside the CmX folder - no CumulusMX in front of the file names. Obviously they have always been created and I just never noticed them beings they are surrounded by other files rather than just the 4 folders I have in /home/pi were they stuck out like sore thumbs.
As suggested, I searched for wxnow.txt and the first hit was the Cumulus Wiki. It said to put "CreateWxnowTxt=0" in the station section of Cumulus.ini to disable its creation. Although it was referring to older versions it worked. I had already figured out how to stop realtime.txt from being created so the mystery is solved
Thanks!
Re: Run as Service Question
Posted: Sun 17 Oct 2021 8:20 am
by mcrossley
You can disable wxnow via the settings... Internet Settings > Interval Configuration > Normal Interval > Standard File Settings
The mystery is why it was not working correctly when running as a service. I have not come across that before. On my rPi I run as a service and the files are created within the CumulusMX folder as expected (though I normally have them disabled).