What directory are the drivers stored in? Texas Wx Intruments driver question

53 views
Skip to first unread message

DR

unread,
Mar 22, 2023, 1:39:44 PM3/22/23
to weewx...@googlegroups.com
I am hoping this is an easy question to answer.

I have Python 3 running on a Raspberry 400 with the Raspbian OS.

I used the setup program to install WeeWX that leaves the majority of
stuff in the /etc/weewx directory.

I am trying to get the driver for the Texas Weather Instruments system
running over a /ttyUSB0 port.  I have the port at 9600 baud, and have
used PuTTY to talk to the station and get back expected data sentences.


I have installed the latest (I hope) version of Matthew Wall's TWI
driver from GitHub, and I think that Tom had tweaked a few things about
6 months ago after the 4.9 release of WeeWX came out.


Having installed it, I did a sudo wee_config  --reconfigure command and
ran through the questions, but choosing the TWI option rather than the
simulator which I had used to verify that the WeeWX was running OK in
the environment, letting it run for a couple days and looking at the
index.html file that it produced to show the graphs and statistics.

I used sudo tail -f /var/log/syslog to monitor what was being written to
that file, and see every 15 seconds a command 'b r' which should be
right according to the command looking for the current conditions (and
was what I used to verify with PuTTY that the connection to the station
was working.


The next line on the display says that the station responded with:  and
is blank.  I watched the blinky lights on the USB dongle and there is no
change, unlike when I did PuTTY and the transmit/receive and say them
change with the command and when I received the data sentence.


My concern is that there is something that the driver is needing, like
the baud rate, and while WeeWX is asking for data via the driver, the
station isn't seeing it and not responding.  I have changed the baud
rate to other values, like the native 19.2kBaud that the station uses by
default but can obviously be changed otherwise.  I did set the PuTTY to
9600 baud in the start up screen for it and that is how I know that part
works.


So I have been searching for where the installed driver is kept on the
Raspberry 400 file structure to look there to see if there is something
I'm missing, but doesn't seem to be anywhere in the /etc/WeeWX directory
where the skins are kept.


One more question:  When I do some tinkering, I usually shut down ( I
think) WeeWX by saying in a terminal window:  "sudo /etc/init.d/weewx
stop" and then restart with "sudo /etc/init.d/weewx start"

Should I be using 'sudo weewxd" instead?

Dale


vince

unread,
Mar 22, 2023, 5:41:52 PM3/22/23
to weewx-user
See https://weewx.com/docs/usersguide.htm#Where_to_find_things - drivers are under the executables tree so look in /usr/share/weewx/weewx/drivers for the core drivers.  If you added them as an extension they'd be under /usr/share/weewx/user and the extension would show as installed if you run "wee_extension --list".

The init.d command runs the service like it does at boot.  The 'sudo weewxd' command runs the executable in the foreground, typically for debugging problems.

The sources for weewx-twi seem to say the baud rate is hard-set to 19200 in the twi.py file.  It looks like you can run the driver in a diagnostic mode if you look at the __main__ part at the bottom of the file.  I'd say set debug=1 in weewx.conf as well as a best practice at least until you get it running.


DR

unread,
Mar 22, 2023, 7:02:00 PM3/22/23
to weewx...@googlegroups.com
This is very helpful, thank you.

Dale


pannetron

unread,
Mar 23, 2023, 10:32:08 AM3/23/23
to weewx-user
Dale,

If you replace your /usr/share/weewx/user/twi.py with the one I emailed you a while back, you should be good to go.  I created a pull request to have my fixes incorporated into the official version, you can find my fork at https://github.com/pannetron/weewx-twi.  Both versions hard code the baud rate at 19200.  Make sure you can putty to the station at that baud rate.  If you're stuck on 9600, simply change the string "19200" in twi.py to "9600".  After copying and/or changing twi.py, I restart weewx using the "sudo /etc/init.d/weewx restart" method.  My corrected version of twi.py has been working perfectly for me for several months now.  If you're in an area where you experience negative outdoor temperatures, you'll also benefit from a bug fix for TWI firmware that I developed years ago for wview and ported into the weewx twi.py driver.  I poll my station every 5 seconds vs. the default 15 so my MQTT real-time stream is updated more often to display more of our crazy winds.  You can see my data at https://panneton.net/weather.

Cheers,

Russ

Reply all
Reply to author
Forward
Message has been deleted
0 new messages