1. Do you actually have a port /dev/ttyUSB0? This should have been set up
long before weewx was launched.

2. Unless you actually own a modem, you should remove the modem manager. It
will compete with the weewx process for control of /dev/ttyUSB0.

sudo apt-get remove modemmanager


-tk

On Thu, Mar 23, 2017 at 12:03 PM, <bgrat...@umw.edu> wrote:

> Tom,
>
> I have attached parts of the syslog file which cover your questions below.
> These are not filtered, but if you need more on either end I can send more.
> I tried to cut them down as close as I could by time because of the size. I
> did reboot at the times you ask about. I have only one instance of weewx
> that I know of.
> If I can do any more testing then please let me know as I will be happy to
> help in any way I can.  Thanks.
> Bob
>
> On Thursday, March 23, 2017 at 11:44:00 AM UTC-4, Tom Keffer wrote:
>>
>> Bob,
>>
>> Before chasing theories, let's make sure we understand exactly what's in
>> the log.
>>
>> 1. Did the computer reboot somewhere between 15:29:02 and 15:29:33 on
>> March 22?
>>
>> 2. At Mar 22 15:29:33 I am seeing three weewx processes: 810, 1025, and
>> 1006. I can imagine their being two just after the daemon fork, but there
>> should never be three. Did you have another weewx process running?
>>
>> 3. Did the computer reboot between March 23 10:02:00 and 10:05:01?
>>
>> General: if the computer was rebooting at the indicated times, we should
>> be seeing some evidence in the logs. Did you filter them in some way? If
>> so, please don't. In this case, we are looking at interactions between the
>> OS and weewx, so it's critical we see log entries from both.
>>
>> -tk
>>
>>
>>
>> On Thu, Mar 23, 2017 at 7:56 AM, <bgra...@umw.edu> wrote:
>>
>>> Tom,
>>>
>>> I have attached the weewx.log portion which contains the info you
>>> requested. The system is Ubuntu 16.04.1 running on an Intel i5 (Intel NUC
>>> box). I tried rebooting again this morning and had some new results:
>>>
>>> root@nuc:~# service weewx status
>>> ? weewx.service - weewx weather system
>>>    Loaded: loaded (/etc/systemd/system/weewx.service; enabled; vendor
>>> preset: enabled)
>>>    Active: failed (Result: exit-code) since Thu 2017-03-23 10:05:01 EDT;
>>> 37s ago
>>>   Process: 1076 ExecStart=/home/weewx/bin/weewxd --daemon
>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf (code=exited, status=4)
>>>  Main PID: 1076 (code=exited, status=4)
>>> Mar 23 10:05:01 nuc weewx[891]: engine: pid file is /var/run/weewx.pid
>>> Mar 23 10:05:01 nuc systemd[1]:* weewx.service: Supervising process
>>> 1076 which is not our child. We'll most likely not notice when it exits.*
>>> Mar 23 10:05:01 nuc weewx[1076]: engine: Using configuration file
>>> /home/weewx/weewx.conf
>>> Mar 23 10:05:01 nuc weewx[1076]: engine: Loading station type Vantage
>>> (weewx.drivers.vantage)
>>> Mar 23 10:05:01 nuc weewx[1076]: import of driver failed: [Errno 2]
>>> could not open port /dev/ttyUSB0: [Errno 2] No such file or directory:
>>> '/dev/ttyUSB0' (<class 'serial.s
>>> Mar 23 10:05:01 nuc weewx[1076]: engine: Unable to load driver: [Errno
>>> 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory:
>>> '/dev/ttyUSB0'
>>> Mar 23 10:05:01 nuc weewx[1076]:     ****  Exiting...
>>> Mar 23 10:05:01 nuc systemd[1]: weewx.service: Main process exited,
>>> code=exited, status=4/NOPERMISSION
>>> Mar 23 10:05:01 nuc systemd[1]: weewx.service: Unit entered failed state.
>>> Mar 23 10:05:01 nuc systemd[1]: weewx.service: Failed with result
>>> 'exit-code'.
>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> ? weewx.service - weewx weather system
>>>    Loaded: loaded (/etc/systemd/system/weewx.service; enabled; vendor
>>> preset: enabled)
>>>    Active: failed (Result: timeout) since Thu 2017-03-23 10:08:16 EDT;
>>> 1min 14s ago
>>>   Process: 2348 ExecStart=/home/weewx/bin/weewxd --daemon
>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf (code=exited,
>>> status=0/SUCCESS)
>>>  Main PID: 2348 (code=exited, status=0/SUCCESS)
>>> Mar 23 10:06:46 nuc weewx[2352]: restx: PWSWeather: Data for station
>>> N4MRV will be posted
>>> Mar 23 10:06:46 nuc weewx[2352]: restx: CWOP: Data for station N4MRV-1
>>> will be posted
>>> Mar 23 10:06:46 nuc weewx[2352]: restx: WOW: Data for station 964806001
>>> will be posted
>>> Mar 23 10:06:46 nuc weewx[2352]: restx: AWEKAS: Data will be uploaded
>>> for user bgrattan
>>> Mar 23 10:06:46 nuc weewx[2352]: engine: Starting up weewx version 3.7.0
>>> Mar 23 10:06:46 nuc weewx[2352]: engine: Clock error is -1.64 seconds
>>> (positive is fast)
>>> Mar 23 10:06:46 nuc weewx[2352]: engine: Starting main packet loop.
>>> Mar 23 10:08:16 nuc systemd[1]: weewx.service: State 'stop-sigterm'
>>> timed out. Killing.
>>> Mar 23 10:08:16 nuc systemd[1]: weewx.service: Unit entered failed state.
>>> Mar 23 10:08:16 nuc systemd[1]: weewx.service: Failed with result
>>> 'timeout'.
>>>
>>> In the first listing, ttyUSB0 didn't load fast enough (haven't seen this
>>> before). I restarted the service and it seems to start but crash on it's
>>> own (second listing). I restarted again and it seemed to take off and stay
>>> running. Susan's comment below seems to make sense that things that weewx
>>> needs aren't starting fast enough. Is there a way to initiate the restart
>>> but delay it to wait for what it needs?
>>> Thanks for your help and thanks to Susan who made the suggestion below.
>>> Bob
>>>
>>> On Wednesday, March 22, 2017 at 6:36:02 PM UTC-4, Tom Keffer wrote:
>>>
>>>> Hi, Bob
>>>>
>>>> What kind of operating system is this? I'm wondering if it is having a
>>>> reaction to the daemonizing strategy weewx uses.
>>>>
>>>> I would also like to see a bit more of the log, starting with the first
>>>> weewx log entry, through the 15:39:33 termination.
>>>>
>>>> -tk
>>>>
>>>> On Wed, Mar 22, 2017 at 12:52 PM, <bgra...@umw.edu> wrote:
>>>>
>>>>> Andrew,
>>>>>
>>>>> I rebooted with debug on weewx and nothing showed up in syslog or
>>>>> weewx.log. I searched around for the "(/etc/systemd/system/*weewx.se
>>>>> <http://weewx.se>rvice; disabled*; vendor preset: enabled)" message
>>>>> and tried the command "*systemctl enable weewx*." The result after
>>>>> reboot was this:
>>>>>
>>>>> root@nuc:~# service weewx status
>>>>> ? weewx.service - weewx weather system
>>>>>    Loaded: loaded (/etc/systemd/system*/weewx.service; enabled*;
>>>>> vendor preset: enabled)
>>>>>    Active: inactive (dead) since Wed 2017-03-22 15:29:33 EDT; 38s ago
>>>>>   Process: 810 ExecStart=/home/weewx/bin/weewxd --daemon
>>>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf (code=exited,
>>>>> status=0/SUCCESS)
>>>>>  Main PID: 810 (code=exited, status=0/SUCCESS)
>>>>>
>>>>> Mar 22 15:29:33 nuc weewxd[810]: Traceback (most recent call last):
>>>>> Mar 22 15:29:33 nuc weewxd[810]:   File "/home/weewx/bin/weewxd", line
>>>>> 64, in <module>
>>>>> Mar 22 15:29:33 nuc weewxd[810]:     weewx.engine.main(options, args)
>>>>> Mar 22 15:29:33 nuc weewxd[810]:   File "/home/weewx/bin/weewx/engine.py",
>>>>> line 833, in main
>>>>> Mar 22 15:29:33 nuc weewxd[810]:     daemon.daemonize(pidfile=optio
>>>>> ns.pidfile)
>>>>> Mar 22 15:29:33 nuc weewxd[810]:   File "/home/weewx/bin/daemon.py",
>>>>> line 79, in daemonize
>>>>> Mar 22 15:29:33 nuc weewxd[810]:     os.dup2(si.fileno(),
>>>>> sys.stdin.fileno())
>>>>> Mar 22 15:29:33 nuc weewxd[810]:   File "/home/weewx/bin/weewx/engine.py",
>>>>> line 803, in sigTERMhandler
>>>>> Mar 22 15:29:33 nuc weewxd[810]:     raise Terminate
>>>>> Mar 22 15:29:33 nuc weewxd[810]: weewx.engine.Terminate
>>>>>
>>>>> It started fine manually:
>>>>>
>>>>> root@nuc:~# service weewx restart
>>>>> root@nuc:~# service weewx status
>>>>> ? weewx.service - weewx weather system
>>>>>    Loaded: loaded (/etc/systemd/system/weewx.service; enabled; vendor
>>>>> preset: enabled)
>>>>>    Active: active (running) since Wed 2017-03-22 15:31:08 EDT; 3s ago
>>>>>  Main PID: 2519 (weewxd)
>>>>>    CGroup: /system.slice/weewx.service
>>>>>            mq2519 /usr/bin/python /home/weewx/bin/weewxd --daemon
>>>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
>>>>>
>>>>> There must be some conflict between in the systemctl startup process.
>>>>> I moved the "weewx.service" (no modifications) according to directions in
>>>>> startup.
>>>>> I'm now wise enough in the ways of linux to figure this one out.
>>>>>
>>>>> Thanks for the quick reply.
>>>>>
>>>>> Bob
>>>>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>> ++++++++++++++
>>>>>
>>>>> On Wednesday, March 22, 2017 at 11:55:30 AM UTC-4, Andrew Milner wrote:
>>>>>>
>>>>>> what does the weewx log say??  is weewx waiting for the time to be
>>>>>> set correctly, or a network to be available perhaps??  The key should lie
>>>>>> in the weewx log (or/and system startup log - syslog)
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wednesday, 22 March 2017 16:44:50 UTC+2, bgra...@umw.edu wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I've about finished moving weewx to a new computer and from debian
>>>>>>> to Ubuntu. Everything seems to be working correctly except the auto 
>>>>>>> restart
>>>>>>> after reboot. I can stop/start/restart from the service or init.d 
>>>>>>> commands
>>>>>>> and all works correctly. There is something incorrect with my 
>>>>>>> configuration
>>>>>>> for startup. Here are some log messages:
>>>>>>>
>>>>>>> *After computer reboot weewx fails to start:*
>>>>>>> root@nuc:~# service weewx status
>>>>>>> ? weewx.service - weewx weather system
>>>>>>>    Loaded: loaded (/etc/systemd/system/weewx.service; disabled;
>>>>>>> vendor preset: enabled)
>>>>>>>    Active: inactive (dead)
>>>>>>> +++++++++++++++++++++++++++++++++++++++
>>>>>>> *Manual restart of weewx service:*
>>>>>>> root@nuc:~# service weewx restart
>>>>>>> root@nuc:~# service weewx status
>>>>>>> ? weewx.service - weewx weather system
>>>>>>>    Loaded: loaded (/etc/systemd/system/weewx.service; disabled;
>>>>>>> vendor preset: enabled)
>>>>>>>    Active: active (running) since Wed 2017-03-22 10:11:05 EDT; 7s ago
>>>>>>>  Main PID: 2398 (weewxd)
>>>>>>>    CGroup: /system.slice/weewx.service
>>>>>>>            mq2398 /usr/bin/python /home/weewx/bin/weewxd --daemon
>>>>>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
>>>>>>> +++++++++++++++++++++++++++++++++++++++
>>>>>>> *Manual stop/start from init.d:*
>>>>>>> root@nuc:/etc/init.d# ./weewx stop
>>>>>>> [ ok ] Stopping weewx (via systemctl): weewx.service.
>>>>>>> root@nuc:/etc/init.d# ./weewx start
>>>>>>> [ ok ] Starting weewx (via systemctl): weewx.service.
>>>>>>> root@nuc:/etc/init.d# ./weewx status
>>>>>>> ? weewx.service - weewx weather system
>>>>>>>    Loaded: loaded (/etc/systemd/system/weewx.service; disabled;
>>>>>>> vendor preset: enabled)
>>>>>>>    Active: active (running) since Wed 2017-03-22 10:13:08 EDT; 13s
>>>>>>> ago
>>>>>>>  Main PID: 2491 (weewxd)
>>>>>>>    CGroup: /system.slice/weewx.service
>>>>>>>            mq2491 /usr/bin/python /home/weewx/bin/weewxd --daemon
>>>>>>> --pidfile=/var/run/weewx.pid /home/weewx/weewx.conf
>>>>>>>
>>>>>>> Any suggestions will be appreciated.  Thanks in advance.
>>>>>>>
>>>>>>> Bob
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>> 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.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>> --
>>> 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.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to