Trouble getting GW1000 driver to work

286 views
Skip to first unread message

Evan Kimberly

unread,
Sep 24, 2021, 12:00:30 PM9/24/21
to weewx-user
Hi all,

I am running weewx on TrueNAS / freebsd. I have the latest version installed and have connected it to apache2.4. I've tested everything with the simulator and it looks good. I've started the process of installing the GW1000 driver to speak to my ecowitt gw1000, however I can't seem to get it to work. I deleted my archive file and the public_html directory after working with the simulator and restarted the weewx service. The archive file and public_html directory repopulate, but the database is empty and in the directory there is no html index file.

Additionally, I am having trouble with troubleshooting the driver itself. in the install script (https://github.com/gjr80/weewx-gw1000), there is a bit about testing the driver:

Test the GW1000 driver by running the driver file directly using the --test-driver command line option:

$ PYTHONPATH=/home/weewx/bin python -m user.gw1000 --test-driver

for setup.py installs or for package installs use:

$ PYTHONPATH=/usr/share/weewx python -m user.gw1000 --test-driver

this doesn't seem to be written with freebsd in mind. I have done the setup.py install but the /usr/share/weewx directory doesn't exist.

Has anyone running a freebsd system been able to get this driver functional? Any suggestions?

Thanks!

matthew wall

unread,
Sep 24, 2021, 12:11:03 PM9/24/21
to weewx-user
hi evan,

the operating system does not matter - the paths matter.  assuming that you installed weewx to /home/weewx/bin, you should use this form:

PYTHONPATH=/home/weewx/bin python -m user.gw1000 --test-driver

however, that assumes that there is an executable called 'python' in your PATH.  if you are using python3, then you should replace 'python' with 'python3'.  and if 'python3' is not in your PATH, then you should use '/usr/local/bin/python3' or whatever the full path is to the python that you are using.

m

Evan Kimberly

unread,
Sep 24, 2021, 2:24:09 PM9/24/21
to weewx-user
Hi Matt,

Thanks for the answer. I guess I'm not understanding something about this command. I installed weewx to '/home/weewx/bin', and my python is python3 and is installed at the path you mentioned, '/usr/local/bin/python3'

So to my understanding that command should become 'PYTHONPATH=/home/weewx/bin /usr/local/bin/python3 -m user.gw1000 --test-driver'

but when i enter that command i receive 'PYTHONPATH=/home/weewx/bin: Command not found.'

matthew wall

unread,
Sep 24, 2021, 2:28:29 PM9/24/21
to weewx-user
On Friday, September 24, 2021 at 2:24:09 PM UTC-4 Evan Kimberly wrote:
So to my understanding that command should become 'PYTHONPATH=/home/weewx/bin /usr/local/bin/python3 -m user.gw1000 --test-driver'

but when i enter that command i receive 'PYTHONPATH=/home/weewx/bin: Command not found.'

what shell are you using?  default on bsd systems is often ksh.  so you would have to do this:

PYTHONPATH=/home/weewx/bin; /usr/local/bin/python3 -m user.gw1000 --test-driver

(notice the semicolon)

matthew wall

unread,
Sep 24, 2021, 2:39:38 PM9/24/21
to weewx-user
actually, i get the same behavior with either bash or ksh, at least on an old macos system (10.14.6) - the semicolon is necessary.  same thing on a modern debian system.

so i guess the semicolon is necessary!  all the many times i have done that before i must have been in the PYTHONPATH directory, or in a directory that weewx resolves in its sys/os path magic at the beginning of each entry point.

Evan Kimberly

unread,
Sep 24, 2021, 3:02:30 PM9/24/21
to weewx-user
I actually wasn't sure, haha. I am currently working out of the shell built into the GUI of TrueNAS. I just checked using 'ps -p$$ -ocommand=' and it came back as csh.

But you are correct! I put the semicolon in and I got output. So thank you for that! I wasn't aware it was missing.

As for the actual output here,

I receive:

root@weewx:/home/weewx/bin # PYTHONPATH=/home/weewx/bin; /usr/local/bin/python3 -m user.gw1000 --test-driver

PYTHONPATH=/home/weewx/bin: Command not found.

Using configuration file /home/weewx/weewx.conf

--- Logging error ---

Traceback (most recent call last):

File "/usr/local/lib/python3.8/logging/handlers.py", line 934, in emit

self.socket.send(msg)

OSError: [Errno 40] Message too long


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

File "/usr/local/lib/python3.8/logging/handlers.py", line 938, in emit

self.socket.send(msg)

OSError: [Errno 40] Message too long

Call stack:

File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main

return _run_code(code, main_globals, None,

File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code

exec(code, run_globals)

File "/home/weewx/bin/user/gw1000.py", line 5906, in <module>

main()

File "/home/weewx/bin/user/gw1000.py", line 5900, in main

direct_gw100.process_options()

File "/home/weewx/bin/user/gw1000.py", line 4833, in process_options

self.test_driver()

File "/home/weewx/bin/user/gw1000.py", line 5640, in test_driver

driver = Gw1000Driver(**self.stn_dict)

File "/home/weewx/bin/user/gw1000.py", line 1909, in __init__

super(Gw1000Driver, self).__init__(**stn_dict)

File "/home/weewx/bin/user/gw1000.py", line 1030, in __init__

loginf('field map is %s' % natural_sort_dict(self.field_map))

File "/home/weewx/bin/user/gw1000.py", line 537, in loginf

log.info(msg)

Message: "field map is {'co2': 'co2', 'co2_24h_avg': 'co2_24h_avg', 'dateTime':'datetime', 'daymaxwind': 'daymaxwind', 'dayRain': 'rainday', 'dewpoint': 'dewpoint', 'extraHumid1': 'humid1', 'extraHumid2': 'humid2', 'extraHumid3': 'humid3', 'extraHumid4': 'humid4', 'extraHumid5': 'humid5', 'extraHumid6': 'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8', 'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 'temp2', 'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 'temp5', 'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 'temp8', 'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 'extraTemp11':'temp11', 'extraTemp12': 'temp12', 'extraTemp13': 'temp13', 'extraTemp14': 'temp14', 'extraTemp15': 'temp15', 'extraTemp16': 'temp16', 'extraTemp17': 'temp17','heatindex': 'heatindex', 'hourRain': 'rainhour', 'inHumidity': 'inhumid', 'inTemp': 'intemp', 'leafWet1': 'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3', 'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 'leafwet6', 'leafWet7': 'leafwet7', 'leafWet8': 'leafwet8', 'leak1': 'leak1', 'leak2': 'leak2', 'leak3': 'leak3', 'leak4': 'leak4', 'lightning_distance': 'lightningdist', 'lightning_last_det_time': 'lightningdettime', 'lightning_strike_count': 'lightning_strike_count', 'lightningcount': 'lightningcount', 'luminosity': 'light', 'monthRain': 'rainmonth', 'outHumidity': 'outhumid', 'outTemp': 'outtemp', 'pm2_5':'pm251', 'pm2_51_24h_avg': 'pm251_24h_avg', 'pm2_52': 'pm252', 'pm2_52_24h_avg': 'pm252_24h_avg', 'pm2_53': 'pm253', 'pm2_53_24h_avg': 'pm253_24h_avg', 'pm2_54': 'pm254', 'pm2_54_24h_avg': 'pm254_24h_avg', 'pm2_55': 'pm255', 'pm2_55_24h_avg': 'pm255_24h_avg', 'pm10': 'pm10', 'pm10_24h_avg': 'pm10_24h_avg', 'pressure':'absbarometer', 'rain': 'rain', 'rainRate': 'rainrate', 'relbarometer': 'relbarometer', 'soilMoist1': 'soilmoist1', 'soilMoist2': 'soilmoist2', 'soilMoist3': 'soilmoist3', 'soilMoist4': 'soilmoist4', 'soilMoist5': 'soilmoist5', 'soilMoist6': 'soilmoist6', 'soilMoist7': 'soilmoist7', 'soilMoist8': 'soilmoist8', 'soilMoist9': 'soilmoist9', 'soilMoist10': 'soilmoist10', 'soilMoist11': 'soilmoist11','soilMoist12': 'soilmoist12', 'soilMoist13': 'soilmoist13', 'soilMoist14': 'soilmoist14', 'soilMoist15': 'soilmoist15', 'soilMoist16': 'soilmoist16', 'soilTemp1': 'soiltemp1', 'soilTemp2': 'soiltemp2', 'soilTemp3': 'soiltemp3', 'soilTemp4': 'soiltemp4', 'soilTemp5': 'soiltemp5', 'soilTemp6': 'soiltemp6', 'soilTemp7': 'soiltemp7', 'soilTemp8': 'soiltemp8', 'soilTemp9': 'soiltemp9', 'soilTemp10': 'soiltemp10', 'soilTemp11': 'soiltemp11', 'soilTemp12': 'soiltemp12', 'soilTemp13': 'soiltemp13', 'soilTemp14': 'soiltemp14', 'soilTemp15': 'soiltemp15', 'soilTemp16': 'soiltemp16', 'stormRain': 'rainevent', 'totalRain': 'raintotals', 'UV': 'uvi', 'uvradiation': 'uv', 'weekRain': 'rainweek', 'wh25_batt': 'wh25_batt', 'wh25_sig': 'wh25_sig', 'wh26_batt': 'wh26_batt', 'wh26_sig': 'wh26_sig', 'wh31_ch1_batt': 'wh31_ch1_batt', 'wh31_ch1_sig': 'wh31_ch1_sig', 'wh31_ch2_batt': 'wh31_ch2_batt', 'wh31_ch2_sig': 'wh31_ch2_sig', 'wh31_ch3_batt': 'wh31_ch3_batt', 'wh31_ch3_sig': 'wh31_ch3_sig', 'wh31_ch4_batt': 'wh31_ch4_batt', 'wh31_ch4_sig': 'wh31_ch4_sig', 'wh31_ch5_batt': 'wh31_ch5_batt', 'wh31_ch5_sig': 'wh31_ch5_sig', 'wh31_ch6_batt': 'wh31_ch6_batt', 'wh31_ch6_sig': 'wh31_ch6_sig', 'wh31_ch7_batt': 'wh31_ch7_batt', 'wh31_ch7_sig': 'wh31_ch7_sig', 'wh31_ch8_batt': 'wh31_ch8_batt', 'wh31_ch8_sig': 'wh31_ch8_sig', 'wh35_ch1_batt': 'wh35_ch1_batt', 'wh35_ch1_sig': 'wh35_ch1_sig', 'wh35_ch2_batt': 'wh35_ch2_batt', 'wh35_ch2_sig': 'wh35_ch2_sig', 'wh35_ch3_batt': 'wh35_ch3_batt', 'wh35_ch3_sig': 'wh35_ch3_sig', 'wh35_ch4_batt': 'wh35_ch4_batt', 'wh35_ch4_sig': 'wh35_ch4_sig', 'wh35_ch5_batt':'wh35_ch5_batt', 'wh35_ch5_sig': 'wh35_ch5_sig', 'wh35_ch6_batt': 'wh35_ch6_batt', 'wh35_ch6_sig': 'wh35_ch6_sig', 'wh35_ch7_batt': 'wh35_ch7_batt', 'wh35_ch7_sig': 'wh35_ch7_sig', 'wh35_ch8_batt': 'wh35_ch8_batt', 'wh35_ch8_sig': 'wh35_ch8_sig', 'wh40_batt': 'wh40_batt', 'wh40_sig': 'wh40_sig', 'wh41_ch1_batt': 'wh41_ch1_batt', 'wh41_ch1_sig': 'wh41_ch1_sig', 'wh41_ch2_batt': 'wh41_ch2_batt', 'wh41_ch2_sig': 'wh41_ch2_sig', 'wh41_ch3_batt': 'wh41_ch3_batt', 'wh41_ch3_sig': 'wh41_ch3_sig', 'wh41_ch4_batt': 'wh41_ch4_batt', 'wh41_ch4_sig': 'wh41_ch4_sig', 'wh45_batt': 'wh45_batt', 'wh45_sig': 'wh45_sig', 'wh51_ch1_batt': 'wh51_ch1_batt', 'wh51_ch1_sig': 'wh51_ch1_sig', 'wh51_ch2_batt': 'wh51_ch2_batt', 'wh51_ch2_sig': 'wh51_ch2_sig', 'wh51_ch3_batt': 'wh51_ch3_batt', 'wh51_ch3_sig': 'wh51_ch3_sig', 'wh51_ch4_batt': 'wh51_ch4_batt', 'wh51_ch4_sig': 'wh51_ch4_sig', 'wh51_ch5_batt': 'wh51_ch5_batt', 'wh51_ch5_sig': 'wh51_ch5_sig', 'wh51_ch6_batt': 'wh51_ch6_batt', 'wh51_ch6_sig': 'wh51_ch6_sig', 'wh51_ch7_batt': 'wh51_ch7_batt', 'wh51_ch7_sig': 'wh51_ch7_sig', 'wh51_ch8_batt': 'wh51_ch8_batt', 'wh51_ch8_sig': 'wh51_ch8_sig', 'wh51_ch9_batt': 'wh51_ch9_batt', 'wh51_ch9_sig': 'wh51_ch9_sig', 'wh51_ch10_batt': 'wh51_ch10_batt', 'wh51_ch10_sig': 'wh51_ch10_sig', 'wh51_ch11_batt': 'wh51_ch11_batt', 'wh51_ch11_sig': 'wh51_ch11_sig', 'wh51_ch12_batt': 'wh51_ch12_batt', 'wh51_ch12_sig': 'wh51_ch12_sig', 'wh51_ch13_batt': 'wh51_ch13_batt', 'wh51_ch13_sig': 'wh51_ch13_sig', 'wh51_ch14_batt': 'wh51_ch14_batt', 'wh51_ch14_sig': 'wh51_ch14_sig', 'wh51_ch15_batt': 'wh51_ch15_batt', 'wh51_ch15_sig': 'wh51_ch15_sig', 'wh51_ch16_batt': 'wh51_ch16_batt', 'wh51_ch16_sig': 'wh51_ch16_sig', 'wh55_ch1_batt': 'wh55_ch1_batt', 'wh55_ch1_sig': 'wh55_ch1_sig', 'wh55_ch2_batt': 'wh55_ch2_batt', 'wh55_ch2_sig': 'wh55_ch2_sig', 'wh55_ch3_batt': 'wh55_ch3_batt', 'wh55_ch3_sig': 'wh55_ch3_sig', 'wh55_ch4_batt': 'wh55_ch4_batt', 'wh55_ch4_sig': 'wh55_ch4_sig', 'wh57_batt': 'wh57_batt', 'wh57_sig': 'wh57_sig', 'wh65_batt': 'wh65_batt', 'wh65_sig': 'wh65_sig', 'wh68_batt': 'wh68_batt', 'wh68_sig': 'wh68_sig', 'windchill': 'windchill', 'windDir': 'winddir', 'windGust': 'gustspeed', 'windSpeed': 'windspeed', 'ws80_batt': 'ws80_batt', 'ws80_sig': 'ws80_sig', 'yearRain': 'rainyear'}"

Arguments: ()


Interrogating GW1000 at 192.168.0.200:45000


Where it then sits. It looks like this is still not finding the command, but it is outputting now instead of just telling me command not found then stopping. I am in the /home/weewx/bin directory when I execute this command. It doesn't seem to work when I am sitting at root.


matthew wall

unread,
Sep 24, 2021, 3:09:50 PM9/24/21
to weewx-user
On Friday, September 24, 2021 at 3:02:30 PM UTC-4 Evan Kimberly wrote:
I actually wasn't sure, haha. I am currently working out of the shell built into the GUI of TrueNAS. I just checked using 'ps -p$$ -ocommand=' and it came back as csh.

csh *definitely* has a different syntax than ksh or bash.  for csh, you must do this:

env PYTHONPATH=/home/weewx/bin /usr/local/bin/python3 -m user.gw1000 --test-driver

or use s subshell:

(setenv PYTHONPATH /home/weewx/bin; /usr/local/bin/python3 -m user.gw1000 --test-driver)

welcome to shell hell (or command-line freedom :)
 

matthew wall

unread,
Sep 24, 2021, 3:16:12 PM9/24/21
to weewx-user
On Friday, September 24, 2021 at 3:02:30 PM UTC-4 Evan Kimberly wrote:
Using configuration file /home/weewx/weewx.conf

--- Logging error ---

Traceback (most recent call last):

File "/usr/local/lib/python3.8/logging/handlers.py", line 934, in emit

self.socket.send(msg)

OSError: [Errno 40] Message too long

this will take more sleuthing - apparently the gw1000 driver is sending too much data to the socket? 

 

During handling of the above exception, another exception occurred:

...

File "/home/weewx/bin/user/gw1000.py", line 1030, in __init__

loginf('field map is %s' % natural_sort_dict(self.field_map))

File "/home/weewx/bin/user/gw1000.py", line 537, in loginf

this looks like a problem with the logger - the logging initialization might need some tweaks for your bsd flavor?
 

Interrogating GW1000 at 192.168.0.200:45000

so the gw1000 code is running, but it is also failing.  maybe gary can look into this.  i suspect that the logger needs to be set up explicitly in the gw1000.py entry point, and some sleuthing is required to see why the socket is complaining...

vince

unread,
Sep 24, 2021, 4:05:34 PM9/24/21
to weewx-user
We have seen lots of instances saying you need to run 'some' kind of logger in modern versions of weewx.   I just typically install rsyslog and everything seems to work fine after that.  The issue typically pops up when running a very minimal os or VM or container.

Evan Kimberly

unread,
Sep 24, 2021, 4:57:04 PM9/24/21
to weewx-user
I installed rsyslog to check it out and it popped up the following message:

Message from rsyslog-8.2104.0:


--

To start using rsyslogd(8), stop syslogd(8) if it's running and

add the following lines to rc.conf(5):


syslogd_enable="NO"

rsyslogd_enable="YES"


It's recommended to copy syslog.conf(5) to

/usr/local/etc/rsyslog.conf and edit it there. Otherwise add

this:


rsyslogd_config="/etc/syslog.conf"


Add the following (3) lines to the beginning of the config file, for

basic functionality:


module(load="immark") # provides --MARK-- message capability

module(load="imuxsock") # provides support for local system logging

module(load="imklog") # kernel logging


newsyslog(8) has the path of syslogd's pid file hardcoded. To

make it work seamlessly with rsyslog, add this:


rsyslogd_pidfile="/var/run/syslog.pid"


Is syslog not already a logger? Is it not adequate and rsyslog more capable?

vince

unread,
Sep 24, 2021, 6:04:16 PM9/24/21
to weewx-user
On Friday, September 24, 2021 at 1:57:04 PM UTC-7 Evan Kimberly wrote:
Is syslog not already a logger? Is it not adequate and rsyslog more capable?

Hard to say, I'd like to say they are equivalent, but perhaps not necessarily.

I got a lot of rsyslogd whining about my config files when I started that up, but I suspect I edited incorrectly.  I found the rsyslogd instructions you quoted to be a bit cryptic so I might have messed it up.  I get the message too long with rsyslogd too.

Here's the weewx driver test once rsyslogd started.

[root@freebsd /etc]# PYTHONPATH=/home/weewx/bin /usr/local/bin/python3 -m user.gw1000 --test-driver
Using configuration file /home/weewx/weewx.conf
debug level is '1'

IP address to be obtained by discovery
Port number set to default port number
Battery state filtering ('False') using the default
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/logging/handlers.py", line 934, in emit
    self.socket.send(msg)
OSError: [Errno 40] Message too long

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/logging/handlers.py", line 938, in emit
    self.socket.send(msg)
OSError: [Errno 40] Message too long
Call stack:
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/weewx/bin/user/gw1000.py", line 5843, in <module>
    main()
  File "/home/weewx/bin/user/gw1000.py", line 5837, in main
    direct_gw100.process_options()
  File "/home/weewx/bin/user/gw1000.py", line 4760, in process_options
    self.test_driver()
  File "/home/weewx/bin/user/gw1000.py", line 5571, in test_driver
    driver = Gw1000Driver(**self.stn_dict)
  File "/home/weewx/bin/user/gw1000.py", line 1928, in __init__
    super(Gw1000Driver, self).__init__(**stn_dict)
  File "/home/weewx/bin/user/gw1000.py", line 1049, in __init__
    loginf('field map is %s' % natural_sort_dict(self.field_map))
  File "/home/weewx/bin/user/gw1000.py", line 549, in loginf
    log.info(msg)
Message: "field map is {'co2': 'co2', 'co2_24h_avg': 'co2_24h_avg', 'dateTime': 'datetime', 'daymaxwind': 'daymaxwind', 'dayRain': 'rainday', 'dewpoint': 'dewpoint', 'extraHumid1': 'humid1', 'extraHumid2': 'humid2', 'extraHumid3': 'humid3', 'extraHumid4': 'humid4', 'extraHumid5': 'humid5', 'extraHumid6': 'humid6', 'extraHumid7': 'humid7', 'extraHumid8': 'humid8', 'extraHumid17': 'humid17', 'extraTemp1': 'temp1', 'extraTemp2': 'temp2', 'extraTemp3': 'temp3', 'extraTemp4': 'temp4', 'extraTemp5': 'temp5', 'extraTemp6': 'temp6', 'extraTemp7': 'temp7', 'extraTemp8': 'temp8', 'extraTemp9': 'temp9', 'extraTemp10': 'temp10', 'extraTemp11': 'temp11', 'extraTemp12': 'temp12', 'extraTemp13': 'temp13', 'extraTemp14': 'temp14', 'extraTemp15': 'temp15', 'extraTemp16': 'temp16', 'extraTemp17': 'temp17', 'heatindex': 'heatindex', 'hourRain': 'rainhour', 'inHumidity': 'inhumid', 'inTemp': 'intemp', 'leafWet1': 'leafwet1', 'leafWet2': 'leafwet2', 'leafWet3': 'leafwet3', 'leafWet4': 'leafwet4', 'leafWet5': 'leafwet5', 'leafWet6': 'leafwet6', 'leafWet7': 'leafwet7', 'leafWet8': 'leafwet8', 'leak1': 'leak1', 'leak2': 'leak2', 'leak3': 'leak3', 'leak4': 'leak4', 'lightning_distance': 'lightningdist', 'lightning_last_det_time': 'lightningdettime', 'lightning_strike_count': 'lightning_strike_count', 'lightningcount': 'lightningcount', 'luminosity': 'light', 'monthRain': 'rainmonth', 'outHumidity': 'outhumid', 'outTemp': 'outtemp', 'pm2_5': 'pm251', 'pm2_51_24h_avg': 'pm251_24h_avg', 'pm2_52': 'pm252', 'pm2_52_24h_avg': 'pm252_24h_avg', 'pm2_53': 'pm253', 'pm2_53_24h_avg': 'pm253_24h_avg', 'pm2_54': 'pm254', 'pm2_54_24h_avg': 'pm254_24h_avg', 'pm2_55': 'pm255', 'pm2_55_24h_avg': 'pm255_24h_avg', 'pm10': 'pm10', 'pm10_24h_avg': 'pm10_24h_avg', 'pressure': 'absbarometer', 'rain': 'rain', 'rainRate': 'rainrate', 'relbarometer': 'relbarometer', 'soilMoist1': 'soilmoist1', 'soilMoist2': 'soilmoist2', 'soilMoist3': 'soilmoist3', 'soilMoist4': 'soilmoist4', 'soilMoist5': 'soilmoist5', 'soilMoist6': 'soilmoist6', 'soilMoist7': 'soilmoist7', 'soilMoist8': 'soilmoist8', 'soilMoist9': 'soilmoist9', 'soilMoist10': 'soilmoist10', 'soilMoist11': 'soilmoist11', 'soilMoist12': 'soilmoist12', 'soilMoist13': 'soilmoist13', 'soilMoist14': 'soilmoist14', 'soilMoist15': 'soilmoist15', 'soilMoist16': 'soilmoist16', 'soilTemp1': 'soiltemp1', 'soilTemp2': 'soiltemp2', 'soilTemp3': 'soiltemp3', 'soilTemp4': 'soiltemp4', 'soilTemp5': 'soiltemp5', 'soilTemp6': 'soiltemp6', 'soilTemp7': 'soiltemp7', 'soilTemp8': 'soiltemp8', 'soilTemp9': 'soiltemp9', 'soilTemp10': 'soiltemp10', 'soilTemp11': 'soiltemp11', 'soilTemp12': 'soiltemp12', 'soilTemp13': 'soiltemp13', 'soilTemp14': 'soiltemp14', 'soilTemp15': 'soiltemp15', 'soilTemp16': 'soiltemp16', 'stormRain': 'rainevent', 'totalRain': 'raintotals', 'UV': 'uvi', 'uvradiation': 'uv', 'weekRain': 'rainweek', 'wh25_batt': 'wh25_batt', 'wh25_sig': 'wh25_sig', 'wh26_batt': 'wh26_batt', 'wh26_sig': 'wh26_sig', 'wh31_ch1_batt': 'wh31_ch1_batt', 'wh31_ch1_sig': 'wh31_ch1_sig', 'wh31_ch2_batt': 'wh31_ch2_batt', 'wh31_ch2_sig': 'wh31_ch2_sig', 'wh31_ch3_batt': 'wh31_ch3_batt', 'wh31_ch3_sig': 'wh31_ch3_sig', 'wh31_ch4_batt': 'wh31_ch4_batt', 'wh31_ch4_sig': 'wh31_ch4_sig', 'wh31_ch5_batt': 'wh31_ch5_batt', 'wh31_ch5_sig': 'wh31_ch5_sig', 'wh31_ch6_batt': 'wh31_ch6_batt', 'wh31_ch6_sig': 'wh31_ch6_sig', 'wh31_ch7_batt': 'wh31_ch7_batt', 'wh31_ch7_sig': 'wh31_ch7_sig', 'wh31_ch8_batt': 'wh31_ch8_batt', 'wh31_ch8_sig': 'wh31_ch8_sig', 'wh35_ch1_batt': 'wh35_ch1_batt', 'wh35_ch1_sig': 'wh35_ch1_sig', 'wh35_ch2_batt': 'wh35_ch2_batt', 'wh35_ch2_sig': 'wh35_ch2_sig', 'wh35_ch3_batt': 'wh35_ch3_batt', 'wh35_ch3_sig': 'wh35_ch3_sig', 'wh35_ch4_batt': 'wh35_ch4_batt', 'wh35_ch4_sig': 'wh35_ch4_sig', 'wh35_ch5_batt': 'wh35_ch5_batt', 'wh35_ch5_sig': 'wh35_ch5_sig', 'wh35_ch6_batt': 'wh35_ch6_batt', 'wh35_ch6_sig': 'wh35_ch6_sig', 'wh35_ch7_batt': 'wh35_ch7_batt', 'wh35_ch7_sig': 'wh35_ch7_sig', 'wh35_ch8_batt': 'wh35_ch8_batt', 'wh35_ch8_sig': 'wh35_ch8_sig', 'wh40_batt': 'wh40_batt', 'wh40_sig': 'wh40_sig', 'wh41_ch1_batt': 'wh41_ch1_batt', 'wh41_ch1_sig': 'wh41_ch1_sig', 'wh41_ch2_batt': 'wh41_ch2_batt', 'wh41_ch2_sig': 'wh41_ch2_sig', 'wh41_ch3_batt': 'wh41_ch3_batt', 'wh41_ch3_sig': 'wh41_ch3_sig', 'wh41_ch4_batt': 'wh41_ch4_batt', 'wh41_ch4_sig': 'wh41_ch4_sig', 'wh45_batt': 'wh45_batt', 'wh45_sig': 'wh45_sig', 'wh51_ch1_batt': 'wh51_ch1_batt', 'wh51_ch1_sig': 'wh51_ch1_sig', 'wh51_ch2_batt': 'wh51_ch2_batt', 'wh51_ch2_sig': 'wh51_ch2_sig', 'wh51_ch3_batt': 'wh51_ch3_batt', 'wh51_ch3_sig': 'wh51_ch3_sig', 'wh51_ch4_batt': 'wh51_ch4_batt', 'wh51_ch4_sig': 'wh51_ch4_sig', 'wh51_ch5_batt': 'wh51_ch5_batt', 'wh51_ch5_sig': 'wh51_ch5_sig', 'wh51_ch6_batt': 'wh51_ch6_batt', 'wh51_ch6_sig': 'wh51_ch6_sig', 'wh51_ch7_batt': 'wh51_ch7_batt', 'wh51_ch7_sig': 'wh51_ch7_sig', 'wh51_ch8_batt': 'wh51_ch8_batt', 'wh51_ch8_sig': 'wh51_ch8_sig', 'wh51_ch9_batt': 'wh51_ch9_batt', 'wh51_ch9_sig': 'wh51_ch9_sig', 'wh51_ch10_batt': 'wh51_ch10_batt', 'wh51_ch10_sig': 'wh51_ch10_sig', 'wh51_ch11_batt': 'wh51_ch11_batt', 'wh51_ch11_sig': 'wh51_ch11_sig', 'wh51_ch12_batt': 'wh51_ch12_batt', 'wh51_ch12_sig': 'wh51_ch12_sig', 'wh51_ch13_batt': 'wh51_ch13_batt', 'wh51_ch13_sig': 'wh51_ch13_sig', 'wh51_ch14_batt': 'wh51_ch14_batt', 'wh51_ch14_sig': 'wh51_ch14_sig', 'wh51_ch15_batt': 'wh51_ch15_batt', 'wh51_ch15_sig': 'wh51_ch15_sig', 'wh51_ch16_batt': 'wh51_ch16_batt', 'wh51_ch16_sig': 'wh51_ch16_sig', 'wh55_ch1_batt': 'wh55_ch1_batt', 'wh55_ch1_sig': 'wh55_ch1_sig', 'wh55_ch2_batt': 'wh55_ch2_batt', 'wh55_ch2_sig': 'wh55_ch2_sig', 'wh55_ch3_batt': 'wh55_ch3_batt', 'wh55_ch3_sig': 'wh55_ch3_sig', 'wh55_ch4_batt': 'wh55_ch4_batt', 'wh55_ch4_sig': 'wh55_ch4_sig', 'wh57_batt': 'wh57_batt', 'wh57_sig': 'wh57_sig', 'wh65_batt': 'wh65_batt', 'wh65_sig': 'wh65_sig', 'wh68_batt': 'wh68_batt', 'wh68_sig': 'wh68_sig', 'windchill': 'windchill', 'windDir': 'winddir', 'windGust': 'gustspeed', 'windSpeed': 'windspeed', 'ws80_batt': 'ws80_batt', 'ws80_sig': 'ws80_sig', 'yearRain': 'rainyear'}"
Arguments: ()

Interrogating GW1000 at 192.168.1.129:45000

2021-09-24 21:51:55 UTC (1632520315): dateTime: 1632520315, extraHumid1: 50, extraHumid2: 50, extraHumid3: 57, extraHumid4: 57, extraTemp1: 22.7, extraTemp2: 21.9, extraTemp3: 22.5, extraTemp4: 22.8, inHumidity: 55, inTemp: 22.2, outHumidity: 59, outTemp: 22.3, pressure: 1003.6, relbarometer: 1015.1, soilMoist1: 58, usUnits: 17, wh26_batt: 0, wh26_sig: 4, wh31_ch1_batt: 0, wh31_ch1_sig: 4, wh31_ch2_batt: 0, wh31_ch2_sig: 4, wh31_ch3_batt: 0, wh31_ch3_sig: 4, wh31_ch4_batt: 0, wh31_ch4_sig: 4, wh51_ch1_batt: 1, wh51_ch1_sig: 4
2021-09-24 21:52:15 UTC (1632520335): dateTime: 1632520335, extraHumid1: 50, extraHumid2: 50, extraHumid3: 57, extraHumid4: 57, extraTemp1: 22.7, extraTemp2: 21.9, extraTemp3: 22.5, extraTemp4: 22.8, inHumidity: 55, inTemp: 22.2, outHumidity: 59, outTemp: 22.3, pressure: 1003.6, relbarometer: 1015.1, soilMoist1: 58, usUnits: 17, wh26_batt: 0, wh26_sig: 4, wh31_ch1_batt: 0, wh31_ch1_sig: 4, wh31_ch2_batt: 0, wh31_ch2_sig: 4, wh31_ch3_batt: 0, wh31_ch3_sig: 4, wh31_ch4_batt: 0, wh31_ch4_sig: 4, wh51_ch1_batt: 1, wh51_ch1_sig: 4
2021-09-24 21:52:35 UTC (1632520355): dateTime: 1632520355, extraHumid1: 50, extraHumid2: 50, extraHumid3: 57, extraHumid4: 57, extraTemp1: 22.7, extraTemp2: 21.9, extraTemp3: 22.5, extraTemp4: 22.8, inHumidity: 55, inTemp: 22.2, outHumidity: 59, outTemp: 22.3, pressure: 1003.6, relbarometer: 1015.1, soilMoist1: 58, usUnits: 17, wh26_batt: 0, wh26_sig: 4, wh31_ch1_batt: 0, wh31_ch1_sig: 4, wh31_ch2_batt: 0, wh31_ch2_sig: 4, wh31_ch3_batt: 0, wh31_ch3_sig: 4, wh31_ch4_batt: 0, wh31_ch4_sig: 4, wh51_ch1_batt: 1, wh51_ch1_sig: 4

gjr80

unread,
Sep 24, 2021, 9:02:06 PM9/24/21
to weewx-user
> this doesn't seem to be written with freebsd in mind

Correct. Call in unintentionally intentional if you like but I don't use BSD and nor do I see any other driver/extension including specific BSD instructions. That said I am happy to get a freebsd VM up and running if need be to deal with any gw1000 issues, keep in mind though that I am coming off a zero BSD knowledge baseline so don't expect an answer overnight :)

That being said, and noting the issue above re log message lines line being too long (the gw1000 driver field map is really looong), I have patched the current GW1000 driver release file (v0.3.1) to limit the log entry to less than 80 characters (well 60 characters plus some other bits and pieces depending on your python version). You can try it if you want, to install it:

1. move aside your present gw1000.py (sorry but I have lost track where it is)
2. download the patched gw1000.py from https://raw.githubusercontent.com/gjr80/weewx-gw1000/bsd_issues/bin/user/gw1000.py and save it in place of your previous gw1000.py. I would use $ wget https://raw.githubusercontent.com/gjr80/weewx-gw1000/bsd_issues/bin/user/gw1000.py to download it directly on my Debian system but I have no idea what you need do on BSD.
3. restart WeeWX

I have versioned this patched file as v0.3.1special and fior want of a better place have it in the bsd_issues branch in the GW100 driver GitHub repo, don't use this branch for anything as it will likely be deleted in the near future.

Gary

vince

unread,
Sep 24, 2021, 9:05:51 PM9/24/21
to weewx-user
Gary - this seems to be a freebsd limitation (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241937)

Evan Kimberly

unread,
Sep 24, 2021, 10:22:37 PM9/24/21
to weewx-user
Gary,

Thanks so much! That's cleared the error. Now when I run the driver test, I get no block of text, just the following message:
'Using configuration file /home/weewx/weewx.conf

Interrogating GW1000 at 192.168.0.200:45000'

Still not sure why I'm not seeing any activity, but at least the errors are cleared! Thank you!

Evan Kimberly

unread,
Sep 24, 2021, 11:49:06 PM9/24/21
to weewx-user
So now that I have the driver working, I decided to poke through some of the options. I was able for the driver to see the IP, port, MAC address, firmware version, and calibrations off of my GW1000. However, when I try to see the sensors I get this error:

Interrogating GW1000 at 192.168.0.200:45000

Traceback (most recent call last):

File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main

return _run_code(code, main_globals, None,

File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code

exec(code, run_globals)

File "/home/weewx/bin/user/gw1000.py", line 5906, in <module>

main()

File "/home/weewx/bin/user/gw1000.py", line 5900, in main

direct_gw100.process_options()

File "/home/weewx/bin/user/gw1000.py", line 4858, in process_options

self.sensors()

File "/home/weewx/bin/user/gw1000.py", line 5432, in sensors

collector.update_sensor_id_data()

File "/home/weewx/bin/user/gw1000.py", line 2344, in update_sensor_id_data

self.sensors_obj.set_sensor_id_data(sensor_id_data)

File "/home/weewx/bin/user/gw1000.py", line 4108, in set_sensor_id_data

batt_fn = Gw1000Collector.sensor_ids[data[index:index + 1]]['batt_fn']

KeyError: b'0'

If I try to see live data I get a similar error.

Interrogating GW1000 at 192.168.0.200:45000

Traceback (most recent call last):

File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main

return _run_code(code, main_globals, None,

File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code

exec(code, run_globals)

File "/home/weewx/bin/user/gw1000.py", line 5906, in <module>

main()

File "/home/weewx/bin/user/gw1000.py", line 5900, in main

direct_gw100.process_options()

File "/home/weewx/bin/user/gw1000.py", line 4860, in process_options

self.live_data()

File "/home/weewx/bin/user/gw1000.py", line 5497, in live_data

live_sensor_data_dict = collector.get_live_sensor_data()

File "/home/weewx/bin/user/gw1000.py", line 2329, in get_live_sensor_data

self.update_sensor_id_data()

File "/home/weewx/bin/user/gw1000.py", line 2344, in update_sensor_id_data

self.sensors_obj.set_sensor_id_data(sensor_id_data)

File "/home/weewx/bin/user/gw1000.py", line 4108, in set_sensor_id_data

batt_fn = Gw1000Collector.sensor_ids[data[index:index + 1]]['batt_fn']

KeyError: b'0'


Does this help clarify my problem at all?



gjr80

unread,
Sep 25, 2021, 12:05:21 AM9/25/21
to weewx-user
Sorry Ewan, but I don't have any time to look at this further today as I am out the door in 20 minutes. In the interim a couple of questions for you:

1. can you run the commands you have been using but this time with the --debug=3 command line option, eg:

$ PYTHONPATH=/home/weewx/bin python -m user.gw1000 --sensors --debug=3

This will (should) place a whole lot of hex output in the log showing the actual data being sent to and received from the GW1000. Could you post a log extract showing this data for each command? Would be handy to see a couple of successful commands (sounds like --firmware-version and --discover may be working) and some that are not, eg --sensors and maybe --live-data (am guessing these are not working).

2. is this a GW1000 or GW1100 ?

Gary

gjr80

unread,
Sep 25, 2021, 12:16:20 AM9/25/21
to weewx-user
Oh, and one other thing, what firmware version is your GW1000 using?

Gary

Cameron D

unread,
Sep 25, 2021, 9:44:28 AM9/25/21
to weewx-user
I am pretty sure the semicolon is not what you want with Bourne shell syntax.
  1. with no semicolon, the variable is placed in the environment of the program being executed
  2. with a semicolon, it is a simple assignment to a variable in the environment of the current shell and is not passed onto the program being executed
I tend to make things clearer by assigning/exporting it to the environment on a line on its own, then run the command and then, if necessary, remove it if it is going to interfere with subsequent commands.

Evan Kimberly

unread,
Sep 25, 2021, 9:53:22 AM9/25/21
to weewx-user

Hi Gary,


It’s no trouble at all. I sincerely appreciate all the help you are providing and am not in a rush. Truthfully, my time is fairly limited for this. I’ve been trying to respond to everyone as timely as possible. I have a three year old and a 4 month old, so my day time hours to tinker with this are limited!


As for your questions:


It is a GW1100, the newer model. Firmware is GW1100B_V2.0.4


when I run the sensors command with debug 3 I get this output in the debug.log file


Sep 25 09:42:15 weewx weewx[86253] DEBUG __main__: Sending packet 'FF FF 26 03 29' to '192.168.0.200:45000'-truncated by __main__

Sep 25 09:42:15 weewx weewx[86253] DEBUG __main__: Received response 'FF FF 26 09 E8 DB 84 E7 23 6C EC'-truncated by __main__

Sep 25 09:42:15 weewx weewx[86253] DEBUG __main__: Sending packet 'FF FF 30 03 33' to '192.168.0.200:45000'-truncated by __main__

Sep 25 09:42:15 weewx weewx[86253] DEBUG __main__: Received response 'FF FF 30 0B 02 01 61 4F 6E A2 27 01 26'-truncated by __main__

Sep 25 09:42:15 weewx weewx[86253] DEBUG __main__: Sending packet 'FF FF 3C 03 3F' to '192.168.0.200:45000'-truncated by __main__



I don’t see anything in the debug log after running the firmware version command, and I didn’t see anything after running the live data command, which is weird.


Is this the right location for the log?


Thanks


Evan

gjr80

unread,
Sep 25, 2021, 12:04:52 PM9/25/21
to weewx-user
Evan,

Ah, of course, your truncated log is going to truncate all of the hex data I was after! No matter, I think I have the problem sorted. Could you try the v0.3.2 of the driver. You can download it with:


Just replace your existing gw1000.py with this one and fingers crossed it shoudl be good.

Gary

Evan Kimberly

unread,
Sep 25, 2021, 1:05:45 PM9/25/21
to weewx-user
Haha, yes I figured that was what was happening with the truncated debug output, but I thought I'd show it to you regardless.

Hey that did it!!! Thanks so much, Gary! I can see the sensors with the sensor input on the drivers, and I see the LOOP packets now while actively running weewxd. The html page looks more accurate too, although the data hasn't had time to populate yet (it's only been on a couple of minutes).

I did notice that this version of gw1000.py is not truncated on the output. I still get the error message about the log, but it doesn't seem to impede operation. I assume this won't be a problem?
Reply all
Reply to author
Forward
0 new messages