Getting pyephem to generate more extensive values in the Celestial module

362 views
Skip to first unread message

D R

unread,
Aug 10, 2021, 8:49:13 PM8/10/21
to weewx-user
I've started a new install with a RaspPi4, 64 Gig memory, latest Debian install, with updates, then latest WeeWx, selected the emulator to get some reports, then when working went through the install of pyephem, since when I expanded the Celestial .inc it told me for more info I needed that. I went to the site to install the pip dev package, then ran 
pip3 install ephem and got
Successfully installed ephem-4.0.0.2 message 
then ran
python3 -m unittest discover ephem 
which game me, eventually, Ran 160 tests in 7.843s
OK, skipped =2.

I then restarted weewx with the 
sudo  /etc/init.d/weewx stop
sudo  /etc/init.d/weewx start 

and since I have my ftp turned on my
sudo tail -f /var/log/syslog 

gives me streams telling me main Starting up weewx version 4.5.1
with clock correct, wx_binding to database weewx.sdb
then starting main packet loop.

After a period of time,  there are cheetah reports of generations and uploads to the ftp site which do show up.

However, when I try to expand the Celestial area on the left of the screen, I still get the very basic couple of lines and the message that I need to install pyephem if I want more detailed informatiion.

There isn't much info in the syslog/log that shows me what's going on and it is getting longer, but I will be willing to attach that if it is the right log, or is there a different log that is more helpful in trying to figure out what I need to do in order to  have WeeWx know that ephem is loaded?

I see that it is referred to as pyephem in some places with internet searches, and in others ephem, so I may have done something wrong.

In addition, once when I started WeeWx, I got about three lines of 'dummy' information displayed on the screen about every two seconds, but I don't see that in the log anywhere, but it seems to be generating the information to try things out before attaching a real weather station to the program.

If hints are available for me to try, please let me know.  If there are other logs to capture and load, let me know that otherwise I'll be happy to load /var/log/syslog for inspection.

Dale

vince

unread,
Aug 10, 2021, 9:14:33 PM8/10/21
to weewx-user
On my raspi I did 'apt-get install python3-ephem' which did install something.

# dpkg -l python3-ephem
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-========================================================
ii  python3-ephem  3.7.6.0-7+b1 armhf        Compute positions of the planets and stars with Python 3


And using your unit test example (pretty cool - I wasn't aware of this before):

# python3 -m unittest discover ephem
..............................................ss.........................................
----------------------------------------------------------------------
Ran 89 tests in 5.137s

OK (skipped=2)

After a few minutes the Seasons skin celestial shows Sunrise/sunset, hours of daylight, and moon phase


Tom Keffer

unread,
Aug 10, 2021, 9:49:00 PM8/10/21
to weewx-user
There are two common reasons why this happens. The diagnosis would have been easier if you had included the log, but no matter.

First, what kind of install did you do? If setup.py, be sure not to run the pip3 command from the weewx directory. It will see the setup.cfg file and try to install pyephem in /home/weewx. Instead, "cd" to some other directory, then do the install.

Second, make sure that the version of python that pip3 used is the same one that weewxd is using. The log will show the latter. For the former, it's best to explicitly invoke python, instead of pip3. For example,

python3 -m pip pyephem

This way, you know for sure which python you are using.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9a344c4c-ab45-4f86-89ca-b7f92fb1bda1n%40googlegroups.com.

D R

unread,
Aug 10, 2021, 11:10:56 PM8/10/21
to weewx-user
I stopped weewx, and got :
pi@raspberrypi:~ $ sudo /etc/init.d/weewx stop
[ ok ] Stopping weewx (via systemctl): weewx.service.
pi@raspberrypi:~ $ sudo tail -f /var/log/syslog
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 208, in run
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****      for packet in self.console.genLoopPackets():
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****    File "/usr/share/weewx/weewx/drivers/simulator.py", line 162, in genLoopPackets
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****      time.sleep(sleep_time)
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****    File "/usr/share/weewx/weewxd", line 260, in sigTERMhandler
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****      raise Terminate
Aug 10 21:41:02 raspberrypi weewx[577] DEBUG __main__:     ****  Terminate
Aug 10 21:41:02 raspberrypi weewx[1007]: Stopping weewx weather system: weewx.
Aug 10 21:41:02 raspberrypi systemd[1]: weewx.service: Succeeded.
Aug 10 21:41:02 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Aug 10 21:48:29 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
Aug 10 21:48:30 raspberrypi systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
Aug 10 21:48:30 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
Aug 10 21:51:52 raspberrypi kernel: [ 1111.695390] v3d fec00000.v3d: MMU error from client L2T (0) at 0x3681000, pte invalid
Aug 10 21:55:00 raspberrypi dbus-daemon[623]: [session uid=1000 pid=623] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service' requested by ':1.7' (uid=1000 pid=684 comm="pcmanfm --desktop --profile LXDE-pi ")
Aug 10 21:55:00 raspberrypi systemd[584]: Starting Virtual filesystem metadata service...
Aug 10 21:55:00 raspberrypi dbus-daemon[623]: [session uid=1000 pid=623] Successfully activated service 'org.gtk.vfs.Metadata'
Aug 10 21:55:00 raspberrypi systemd[584]: Started Virtual filesystem metadata service.

and then ran:
pi@raspberrypi:~ $ sudo pip3 install ephem --user
Requirement already satisfied: ephem in /usr/lib/python3/dist-packages (3.7.6.0)


The odd thing was, that the /var/log/syslog being watched with the sudo tail -f /var/log/syslog command did not show any of this activity with the command line.  That is why I was wondering if there were another log file that would show what was happening?

Nonetheless, the comment back from the terminal implies that the ephem is in /usr/lib/python3/dist-packages (3.7.6.0)

I did the weewx install initially by not using the setup.py, so it went into the /etc/weewx and not the home directory

and when I typed in the python3 -m pip pyephem I got:

pi@raspberrypi:~ $ python3 -m pip pyephem
ERROR: unknown command "pyephem"


These are from the terminal window.  There is only this in my logfile now, after I close the first terminal, started it again and did the tail command:
 $ sudo tail -f /var/log/syslog
Aug 10 21:41:02 raspberrypi systemd[1]: weewx.service: Succeeded.
Aug 10 21:41:02 raspberrypi systemd[1]: Stopped LSB: weewx weather system.
Aug 10 21:48:29 raspberrypi systemd[1]: Starting Cleanup of Temporary Directories...
Aug 10 21:48:30 raspberrypi systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
Aug 10 21:48:30 raspberrypi systemd[1]: Started Cleanup of Temporary Directories.
Aug 10 21:51:52 raspberrypi kernel: [ 1111.695390] v3d fec00000.v3d: MMU error from client L2T (0) at 0x3681000, pte invalid
Aug 10 21:55:00 raspberrypi dbus-daemon[623]: [session uid=1000 pid=623] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service' requested by ':1.7' (uid=1000 pid=684 comm="pcmanfm --desktop --profile LXDE-pi ")
Aug 10 21:55:00 raspberrypi systemd[584]: Starting Virtual filesystem metadata service...
Aug 10 21:55:00 raspberrypi dbus-daemon[623]: [session uid=1000 pid=623] Successfully activated service 'org.gtk.vfs.Metadata'
Aug 10 21:55:00 raspberrypi systemd[584]: Started Virtual filesystem metadata service.


That's why I am wondering if all this is being logged in a different file and I'm just missing sending you important info to help?
Thanks again. 

I certainly can reinstall the Debian system on the SSD once again and start from scratch if you think that might help?

And I'm not sure why your python3 -m..... command gave an error, I did a dir command to make sure I wasn't in the /etc/weewx directory and got pi@raspberrypi:~ $ dir
Bookshelf  Documents  Music Public    Videos
Desktop    Downloads  Pictures Templates

Dale

D R

unread,
Aug 10, 2021, 11:21:09 PM8/10/21
to weewx-user
Tom K.  Do not spend more time on this, I just did a power down and restarted Debian and then went through start up with weewxd and it now works.  I know that Linux is supposed to be vastly different from Windows and 'reboots' not usually needed, but it wasn't working before the restart but does now.  Please use your advising time for someone else, since the problem seems to have been fixed but I have no understanding of why.  I'm just pleased to have Celestial.inc working!  Thank you.
Dale
Reply all
Reply to author
Forward
0 new messages