Search

Recent Posts

Tags


« | Main

Fedora 24 and weexd Weather software

By Dale Reagan | July 17, 2016

I recently upgraded to Fedora 24 Workstation.   I typically start my Linux builds with a ‘live’ image and then add what I need/want, including things that you might normally only run on a ‘pure’ server.  Note that I do NOT suggest doing this for any system that is ‘on the Internet’…. 🙂  Among the issues I encountered were getting the weather software Weewx to work while running as a local user, AND, as a daemon process (auto-start on boot-up.)

Weewx is a well documented Python solution with active development.  In a future post I may explore it further; in this post, I am focused on the problems I encountered and solutions I found for these problems.

A reminder –  as with many ‘resources’ you find on the web, it is easy to be mis-directed when problem solving – if you stay close to your ‘errors’ and close to your problem descriptions then you should be able to resolve the issue yourself;  unless you get lucky and the first ‘I solved this’ post you encounter gets things working (usually, without really explaining how the ‘solution’ resolves the issue [see my post about ‘Airprint’ issues.]

First Problem – installing ‘missing’ software

# required packages - most of this from the Weewx docs
 sudo pip install configobj
 sudo pip install Cheetah
 sudo pip install pillow

# required if hardware is serial or USB:
 sudo pip install pyserial
 sudo pip install pyusb

# optional for extended almanac information:
 sudo pip install pyephem

### if errors w/reports you may need to add these (not in the docs)
 sudo pip install image

Second problem – Weewx local user USB Device access

If you are directly connecting your USB weather station, then one custom Udev rule may work for you.  If, however, if, like me, you are using an ‘external’ USB hub connected to your Linux system, and then connecting your USB weather station to the external HUB you may need to create TWO udev rules: one for the eXT HUB and one for the WX device…

Example custom Udev rule (your setup will most likely VARY…) allowing ‘group’ access to the devices. (i.e. create/edit file: /etc/udec/rules.d/70-persistent-YOUR_DEVICE)

## rule for the 4-port-hub - using 'plugdev' group 
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="2046", GROUP="plugdev", MODE="0660", LABEL="4-port-hub_wx"
## rule for Acturite weather station
SUBSYSTEM=="usb", ATTRS{idVendor}=="24c0", ATTRS{idProduct}=="0003", GROUP="wx-user", MODE="0660", LABEL="Acurite_Wx

Note: you may need to create new 'groups' for the above, i.e. 'plugdev' and 'wx-user' or whatever you use. Once groups are created you then need to add users to the group(s).  MODE 660 ~= read/write access for the device 'owner' (usually 'root') and for the group you specify...

Third problem – installing weewx as systemd ‘service’

The Weewx example ‘service file’ did not work for my FC 24 install (~/weewx/util/systemd/weewx.service).  However, with a few tweaks it is now working well.

I installed a ‘missing’ service, and edited a ‘mismatch’ service name in the example weewx.services file:

# install ntp, configure, enable and start – missing from my FC 24 install? (perhaps due to the ‘spin’ that I started with…)

dnf install ntp
# check/modify config for ntp and then load, enable, start, check
systemctl daemon-reload
systemctl enable ntpdate.service
systemctl start ntpdate.service
systemctl status ntpdate.service

# modify /etc/systemd/system/weewx.services

change ‘ntp.service’ to ‘ntpdate.service’

So, BEFORE working on the systemd config, I was able to start Weewx as daemon from the command line – so I knew that it should work – still, systemd was complaining… The error message that I was getting from the systemctl command ended with:

(code=exited, status=203/EXEC)

Ok, first try at searching for something like:  weewx systemd 203/exec;   search results were somewhat helpful, but did not lead to a solution.  The documentation for systemd was also not helpful, until I ‘thought about it’…  The fix for me – modify the file weewx.services – tweak the Systemd ExecStart command to INCLUDE the path to Python (or whatever other command you are trying to get working; seems that shebang lines are ‘ignored’ by Systemd?), i.e.:

ExecStart=/bin/python /WEEwxd_Path –daemon –pidfile=/PID_Path/  /Weewxd_CONF_PATH

On a typical install, the above would be something like:

ExecStart=/bin/python /home/weewx/bin/weewxd –daemon –pidfile=/var/run/weather/weewx.pid /home/weewx/weewx.conf

Once above changes were made, then ‘tell’ systemd about the updates and start the service, i.e.

systemctl enable weewx
systemctl daemon-reload
systemctl start  weewx
systemctl status weewx

Now check for syslog entries and updated web pages (generated by Weewx.)

Of course, your mileage should vary – good luck! 🙂

Topics: Computer Technology, Hardware, Problem Solving, Sensors, Unix-Linux-Os | Comments Off on Fedora 24 and weexd Weather software

Comments are closed.


________________________________________________
YOUR GeoIP Data | Ip: 73.21.121.1
Continent: NA | Country Code: US | Country Name: United States
Region: | State/Region Name: | City:
(US only) Area Code: 0 | Postal code/Zip:
Latitude: 38.000000 | Longitude: -97.000000
Note - if using a mobile device your physical location may NOT be accurate...
________________________________________________

Georgia-USA.Com - Web Hosting for Business
____________________________________