WeeWX 4.0.0.7a with SDS011 driver

126 views
Skip to first unread message

steeple ian

unread,
Aug 28, 2019, 7:19:41 AM8/28/19
to weewx-development
Tom,

I am testing WeeWX 4.0.0.a7 with the SDS011 driver.

I am getting the following error: -

weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (exited) since Wed 2019-08-28 12:07:31 BST; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1449 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)

Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/DEBUG weewx.engine: Debug is 1
Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/DEBUG weewx.engine: Initializing engine
Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/INFO weewx.engine: Loading station type SDS011 (user.sds011)
Aug 28 12:07:31 DietPi weewxd[1463]: SDS011: driver version is 0.2
Aug 28 12:07:31 DietPi weewxd[1463]: SDS011: model is NovaPM
Aug 28 12:07:31 DietPi weewxd[1463]: SDS011: port is /dev/ttyUSB0
Aug 28 12:07:31 DietPi weewxd[1463]: SDS011: poll interval is 10
Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/ERROR weewx.engine: Import of driver failed: Port is already open. (<class 'serial.serialutil.SerialException'>)
Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/CRITICAL weewx.engine: Unable to load driver: Port is already open.
Aug 28 12:07:31 DietPi weewxd[1463]: weewx[1463]/CRITICAL weewx.engine:     ****  Exiting...

RaspberryPi 3, running DietPi Buster (Debian 10).

Nothing else connected to the USB ports.

The driver works fine with 3.9.2

Thanks,
Ian

Thomas Keffer

unread,
Aug 28, 2019, 8:51:27 AM8/28/19
to steeple ian, weewx-development
I doubt this has anything to do with V4, but I could be wrong. Check to see which process has the port open:

lsof /dev/ttyUSB0

I'm betting there's another process holding on to the port.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/7e25db58-909c-4ca3-a5bb-0beda4cd2458%40googlegroups.com.

steeple ian

unread,
Aug 28, 2019, 9:35:15 AM8/28/19
to weewx-development
lsof /dev/ttyUSB0 shows nothing at all.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-de...@googlegroups.com.

Leon Shaner

unread,
Aug 28, 2019, 9:46:09 AM8/28/19
to steeple ian, weewx-development
What about:

pi@DietPi:~ $ sudo fuser -v /dev/ttyUSB0
                     USER        PID ACCESS COMMAND
/dev/tty/USB0:
                     pi          400 F.... weewxd

In any case, maybe weewx is running more than once?
Try stopping it and then:

$ ps -ef | grep weewx

And see if there is another weewxd process still running and kill it (simple kill {pid} first, then kill -9 {pid} if it doesn't go away on the simple kill).

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad)

On Aug 28, 2019, at 9:35 AM, steeple ian <steep...@gmail.com> wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/584076e2-278f-45b8-9d2b-d94306ecc9d3%40googlegroups.com.

steeple ian

unread,
Aug 30, 2019, 6:21:45 PM8/30/19
to weewx-development
I have checked everything but nothing shows up. Have stripped everything back to the bare minimum and only have the sds011 driver running. Only one instance of WeeWX running and nothing else connected but still it locks up. The device works fine outside of WeeWX using aqi.py from here: - https://github.com/zefanja/aqi/blob/master/python/aqi.py

Thomas Keffer

unread,
Aug 30, 2019, 6:56:39 PM8/30/19
to steeple ian, weewx-development
Can you try changing something in your copy of aqi.py? I know the pyserial docs say that if port is None the serial port will not be opened, but let's see if that's true.

Change this

ser = serial.Serial()
ser.port = "/dev/ttyUSB0"
ser.baudrate = 9600

ser.open()
ser.flushInput()

to this

ser = serial.Serial(port='/dev/ttyUSB0', baudrate=9600)
ser.flushInput()

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/439d0a36-97be-44a9-aeef-be69a3ea2a8e%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages