Interceptor working standalone but not with Weewx

252 views
Skip to first unread message

Jos Bredek

unread,
Aug 25, 2019, 11:01:08 AM8/25/19
to weewx-user
Hi everyone,

i'm new into the world weewx. Looking for some help....

My setup is:
- ambient ws2902 CLONE
- interceptor driver in listen mode, port 8000
- weather station is set to send data to my server, on port 8000

My first step looked good! The command:
python interceptor.py --mode=listen --port=8000 --debug

worked excellent, although it did report in the logs that 4 parameters were not being recognized (no big deal).
Here is the output
identifiers: {'bridge_id': None, 'sensor_type': None, 'sensor_id': None} raw data: ID=xxxxxxx&PASSWORD=xxxxxxxx&indoortempf=77.4&tempf=88.9&dewptf=59.4&windchillf=88.9&indoorhumidity=58&humidity=37&windspeedmph=0.9&windgustmph=1.1&winddir=138&absbaromin=30.107&baromin=30.071&rainin=0.000&dailyrainin=0.000&weeklyrainin=0.000&monthlyrainin=0.020&solarradiation=332.63&UV=3&dateutc=2019-08-25%2014:57:04&softwaretype=EasyWeatherV1.4.0&action=updateraw&realtime=1&rtfreq=5 raw packet: {'temperature_in..': 77.4, 'winddir..': 138.0, 'dateTime': 1566745024, 'usUnits..': 1, 'pressure..': 30.071, 'humidity_in..': 58.0, 'temperature..': 88.9, 'dateTime..': 1566745024, 'windspeed..': 0.9, 'rainfall..': None, 'usUnits': 1, 'humidity..': 37.0} mapped packet: {'pressure': 30.071, 'inHumidity': 58.0, 'inTemp': 77.4, 'usUnits': 1, 'dateTime': 1566745024}

Then.. i tried to run weewx (from commandline) with the interceptor-driver. My config for the interceptor is like this:
[Interceptor] # This section is for the network traffic interceptor driver. # The driver to use: driver = user.interceptor # Specify the hardware device to capture. Options include: # acurite-bridge - acurite internet bridge, smarthub, or access # observer - fine offset WH2600/HP1000/HP1003, ambient WS2902 # lw30x - oregon scientific LW301/LW302 # lacrosse-bridge - lacrosse GW1000U/C84612 internet bridge # wu-client - any hardware that uses the weather underground protocol device_type = wu-client port = 8000 ##############################################################################

It looks like weeewx starts the Interceptor listening server on 8000 but within the same second it shuts the serverport again. Weewx keeps doing this every 300 seconds (probably since that is the archive interval).

Here's my output from the log (debug set to 1):

Aug 25 16:48:54 weerstation weewx[9422]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 25 16:48:54 weerstation weewx[9422]: engine: Loading station type Interceptor (user.interceptor)
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: driver version is 0.46
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: device type: wu-client
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: sensor map: None
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: mode is listen
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: listen on :8000
Aug 25 16:48:54 weerstation weewx[9422]: engine: StdConvert target unit is 0x1
Aug 25 16:48:54 weerstation weewx[9422]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 25 16:48:54 weerstation weewx[9422]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 25 16:48:54 weerstation weewx[9422]: engine: Archive will use data binding wx_binding
Aug 25 16:48:54 weerstation weewx[9422]: engine: Record generation will be attempted in 'software'
Aug 25 16:48:54 weerstation weewx[9422]: engine: Using archive interval of 300 seconds (software record generation)
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: shutting down server thread

Is there something (simple) i've been missing? The server should keep listening on port 8000 all the time not just a the every 3 minutes for just a second....

My database is on a different server. So far there is no data at all pushed into the db.... 

I've read the documentation on both weewx and the interceptor driver, but i can't find anything wrong....

Any hints/tips?

CIao,
Jos

mwall

unread,
Aug 25, 2019, 7:41:23 PM8/25/19
to weewx-user


On Sunday, August 25, 2019 at 11:01:08 AM UTC-4, Jos Bredek wrote:

It looks like weeewx starts the Interceptor listening server on 8000 but within the same second it shuts the serverport again. Weewx keeps doing this every 300 seconds (probably since that is the archive interval).

Here's my output from the log (debug set to 1):

Aug 25 16:48:54 weerstation weewx[9422]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 25 16:48:54 weerstation weewx[9422]: engine: Loading station type Interceptor (user.interceptor)
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: driver version is 0.46
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: device type: wu-client
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: sensor map: None
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: mode is listen
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: listen on :8000
Aug 25 16:48:54 weerstation weewx[9422]: engine: StdConvert target unit is 0x1
Aug 25 16:48:54 weerstation weewx[9422]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 25 16:48:54 weerstation weewx[9422]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 25 16:48:54 weerstation weewx[9422]: engine: Archive will use data binding wx_binding
Aug 25 16:48:54 weerstation weewx[9422]: engine: Record generation will be attempted in 'software'
Aug 25 16:48:54 weerstation weewx[9422]: engine: Using archive interval of 300 seconds (software record generation)
Aug 25 16:48:54 weerstation weewx[9422]: interceptor: MainThread: shutting down server thread

Is there something (simple) i've been missing? The server should keep listening on port 8000 all the time not just a the every 3 minutes for just a second....

it would help to see more of the log, not just one cycle.  and it would help if you set debug=1

however, this smells like an unreported exception - the listening thread is probably raising an exception, but that is getting swallowed.

try running weewx directly - that will show us whether there are any exceptions in the listening (or other) thread.

also, you are probably testing two different things - your weewx.conf uses wu-client as device_type, but since you did not specify a mode in the direct invocation of interceptor.py, the device_type is acurite-bridge.

m

Jos Bredek

unread,
Aug 26, 2019, 6:35:30 AM8/26/19
to weewx-user
 
it would help to see more of the log, not just one cycle.  and it would help if you set debug=1


Hi M,

thank you for your reply. Much appreciated!

At the bottom of this mail i've include a more extensive part of the log file.

 
however, this smells like an unreported exception - the listening thread is probably raising an exception, but that is getting swallowed.
 
try running weewx directly - that will show us whether there are any exceptions in the listening (or other) thread.


well.. this is the way i start(ed) weewx....
sudo weewxd /etc/weewx/weewx.conf

in my weewx config debug is set

(
# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 1
)
 
also, you are probably testing two different things - your weewx.conf uses wu-client as device_type, but since you did not specify a mode in the direct invocation of interceptor.py, the device_type is acurite-bridge.

m


You are right! 

I've added the device parameter. 
(PYTHONPATH=. python user/interceptor.py --device=wu-client --mode=listen --port=8000 --debug)
The output looks (exactly?) the same. Here is a snippet from the log file:

Aug 26 12:24:51 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter monthlyrainin=0.020
Aug 26 12:24:51 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter weeklyrainin=0.000
Aug 26 12:25:20 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter rainin=0.000
Aug 26 12:25:20 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter absbaromin=30.115
Aug 26 12:25:20 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter monthlyrainin=0.020
Aug 26 12:25:20 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter weeklyrainin=0.000
Aug 26 12:25:55 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter rainin=0.000
Aug 26 12:25:55 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter absbaromin=30.115
Aug 26 12:25:55 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter monthlyrainin=0.020
Aug 26 12:25:55 weerstation interceptor[11831]: interceptor: MainThread: unrecognized parameter weeklyrainin=0.000

Looking forward to your reply....

CIao,
Jos
-----
extensive part of logfile

Aug 26 11:54:00 weerstation weewx[9422]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 26 11:54:00 weerstation weewx[9422]: engine: Loading station type Interceptor (user.interceptor)
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: driver version is 0.46
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: device type: wu-client
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: sensor map: None
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: mode is listen
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: listen on :8000
Aug 26 11:54:00 weerstation weewx[9422]: engine: StdConvert target unit is 0x1
Aug 26 11:54:00 weerstation weewx[9422]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 26 11:54:00 weerstation weewx[9422]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 26 11:54:00 weerstation weewx[9422]: engine: Archive will use data binding wx_binding
Aug 26 11:54:00 weerstation weewx[9422]: engine: Record generation will be attempted in 'software'
Aug 26 11:54:00 weerstation weewx[9422]: engine: Using archive interval of 300 seconds (software record generation)
Aug 26 11:54:00 weerstation weewx[9422]: interceptor: MainThread: shutting down server thread
Aug 26 11:56:01 weerstation weewx[9422]: engine: retrying...
Aug 26 11:56:01 weerstation weewx[9422]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 26 11:56:01 weerstation weewx[9422]: engine: Loading station type Interceptor (user.interceptor)
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: driver version is 0.46
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: device type: wu-client
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: sensor map: None
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: mode is listen
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: listen on :8000
Aug 26 11:56:01 weerstation weewx[9422]: engine: StdConvert target unit is 0x1
Aug 26 11:56:01 weerstation weewx[9422]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 26 11:56:01 weerstation weewx[9422]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 26 11:56:01 weerstation weewx[9422]: engine: Archive will use data binding wx_binding
Aug 26 11:56:01 weerstation weewx[9422]: engine: Record generation will be attempted in 'software'
Aug 26 11:56:01 weerstation weewx[9422]: engine: Using archive interval of 300 seconds (software record generation)
Aug 26 11:56:01 weerstation weewx[9422]: interceptor: MainThread: shutting down server thread
Aug 26 11:58:01 weerstation weewx[9422]: engine: retrying...
Aug 26 11:58:01 weerstation weewx[9422]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 26 11:58:01 weerstation weewx[9422]: engine: Loading station type Interceptor (user.interceptor)
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: driver version is 0.46
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: device type: wu-client
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: sensor map: None
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: mode is listen
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: listen on :8000
Aug 26 11:58:01 weerstation weewx[9422]: engine: StdConvert target unit is 0x1
Aug 26 11:58:01 weerstation weewx[9422]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 26 11:58:01 weerstation weewx[9422]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 26 11:58:01 weerstation weewx[9422]: engine: Archive will use data binding wx_binding
Aug 26 11:58:01 weerstation weewx[9422]: engine: Record generation will be attempted in 'software'
Aug 26 11:58:01 weerstation weewx[9422]: engine: Using archive interval of 300 seconds (software record generation)
Aug 26 11:58:01 weerstation weewx[9422]: interceptor: MainThread: shutting down server thread


mwall

unread,
Aug 26, 2019, 4:39:18 PM8/26/19
to weewx-user
it looks like debug is not enabled - there are no debug messages in the log postings that you made.  it would help to see the debug messages.

what do you see in the shell in which you invoked weewxd?

did weewx run properly with some other driver, such as simulator, before you installed the weewx-interceptor driver?

m

Jos Bredek

unread,
Aug 27, 2019, 4:28:49 PM8/27/19
to weewx-user


Op maandag 26 augustus 2019 22:39:18 UTC+2 schreef mwall:
Sorry... seems like i pasted from the wrong log file.. Here is the syslog output.... and it turns out the connection to my sql db is not properly working. I guess this is the reason van the tcp-server thread quitting? 

Anyhow .. i will try to fix it. Keep you posted.

Ciao,
Jbr

Jos Bredek

unread,
Aug 27, 2019, 4:30:42 PM8/27/19
to weewx-user
Here is the syslog output.... 
 

Aug 27 22:26:09 weerstation weewx[12672]:     ****  Waiting 2 minutes then retrying...
Aug 27 22:28:09 weerstation weewx[12672]: engine: retrying...
Aug 27 22:28:09 weerstation weewx[12672]: engine: Using configuration file /etc/weewx/weewx.conf
Aug 27 22:28:09 weerstation weewx[12672]: engine: Debug is 1
Aug 27 22:28:09 weerstation weewx[12672]: engine: Initializing engine
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading station type Interceptor (user.interceptor)
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: driver version is 0.46
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: device type: wu-client
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: sensor map: None
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: mode is listen
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: listen on :8000
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.engine.StdTimeSynch
Aug 27 22:28:09 weerstation weewx[12672]: engine: Finished loading service weewx.engine.StdTimeSynch
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.engine.StdConvert
Aug 27 22:28:09 weerstation weewx[12672]: engine: StdConvert target unit is 0x1
Aug 27 22:28:09 weerstation weewx[12672]: engine: Finished loading service weewx.engine.StdConvert
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.engine.StdCalibrate
Aug 27 22:28:09 weerstation weewx[12672]: engine: Finished loading service weewx.engine.StdCalibrate
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.engine.StdQC
Aug 27 22:28:09 weerstation weewx[12672]: engine: Finished loading service weewx.engine.StdQC
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.wxservices.StdWXCalculate
Aug 27 22:28:09 weerstation weewx[12672]: wxcalculate: The following values will be calculated: barometer=prefer_hardware, windchill=prefer_hardware, dewpoint=prefer_hardware, appTemp=prefer_hardware, rainRate=prefer_hardware, windrun=prefer_hardware, heatindex=prefer_hardware, maxSolarRad=prefer_hardware, humidex=prefer_hardware, pressure=prefer_hardware, inDewpoint=prefer_hardware, ET=prefer_hardware, altimeter=prefer_hardware, cloudbase=prefer_hardware
Aug 27 22:28:09 weerstation weewx[12672]: wxcalculate: The following algorithms will be used for calculations: altimeter=aaNOAA, maxSolarRad=RS
Aug 27 22:28:09 weerstation weewx[12672]: engine: Finished loading service weewx.wxservices.StdWXCalculate
Aug 27 22:28:09 weerstation weewx[12672]: engine: Loading service weewx.engine.StdArchive
Aug 27 22:28:09 weerstation weewx[12672]: engine: Archive will use data binding wx_binding
Aug 27 22:28:09 weerstation weewx[12672]: engine: Record generation will be attempted in 'software'
Aug 27 22:28:09 weerstation weewx[12672]: engine: Using archive interval of 300 seconds (software record generation)
Aug 27 22:28:09 weerstation weewx[12672]: engine: Use LOOP data in hi/low calculations: 1
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: ServerThread: start tcp server
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: shutting down server thread
Aug 27 22:28:09 weerstation weewx[12672]: interceptor: MainThread: stop tcp server
Aug 27 22:28:09 weerstation weewx[12672]: engine: Database connection exception: (2003, 'Can\'t connect to MySQL server on \'192.168.10.8\' (111 "Connection refused")')
Aug 27 22:28:09 weerstation weewx[12672]:     ****  Waiting 2 minutes then retrying...

Jos Bredek

unread,
Aug 27, 2019, 5:06:08 PM8/27/19
to weewx-user


Op dinsdag 27 augustus 2019 22:28:49 UTC+2 schreef Jos Bredek:
Yes, that did the trick! The portnumber that weewx uses as a default (3306) differed from my port my mariadb was listering on (3307).

I see loop data coming in on the console, and a first row in my db!

I wil continue the rest of the setup and tuning. Thank you so much for helping me out!

Ciao,
Jbr
Reply all
Reply to author
Forward
0 new messages