After installing Texas Weather driver from Matthew's github no in pick list

80 views
Skip to first unread message

D R

unread,
Apr 30, 2022, 3:14:50 PM4/30/22
to weewx-user

I am past testing and now want to connect my Rasp 400 to a real wx station I have running, a Texas Weather Instruments.

I went to github and got the driver that Matthew has furnished, downloaded it and installed with the instructions given into my WeeWx 4.8.

Then I did a wee_config --reconfigure and was stepping through the choices until lI got to the
Installed Drivers choice, and in the 12) shown, there was no mention of the newly installed TWI driver.

Is there a way of making it show up in some way other than wee_config,?

Thanks for any suggestions.  Dale

D R

unread,
Apr 30, 2022, 3:22:02 PM4/30/22
to weewx-user
I did forget to mention that I found twi.py in the /usr/share/weewx/user directory.  It is puzzling to me that there were no other drivers from the list shown during the wee_configure --reconfigure selection shown here, unless they are stored elsewhere or 'built in' and not visible, and the twi.py is added on somehow.  Dale

Tom Keffer

unread,
Apr 30, 2022, 3:54:36 PM4/30/22
to weewx-user
The problem is that the twi driver has not been ported to Python 3. 

I'll do the port and submit a PR to Matthew. Or, you can try Python 2.7.



--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/e84e7fdb-97df-4e1b-bf4b-d59ec0f055cen%40googlegroups.com.

DR

unread,
Apr 30, 2022, 4:05:37 PM4/30/22
to weewx...@googlegroups.com

a) thank you for the very speedy reply.

b) I would have never figured that out, so thank you for sharing your knowledge of all this

c) I am happy with python 3 and the way things run and would be too nervous about goofing something up.   I will wait patiently for the system to work, with revisions being passed along.


Thanks for your attention, I'm anxious to try it, and will see if one of my other stations will work. Do you know off hand if the Peet Brothers driver (another station I have) is working with Python 3?

Dale

Tom Keffer

unread,
Apr 30, 2022, 4:26:25 PM4/30/22
to weewx-user
I just did a quick port. There may be issues with how the driver communicates with the hardware. Give it a try. 

You can find the port at https://github.com/tkeffer/weewx-twi

D R

unread,
Apr 30, 2022, 5:35:04 PM4/30/22
to weewx-user
I downloaded the twi.py which you furnished at the above link, and copied it from the pi/Downloads directory to the /usr/share/weewx/user area and re-ran the wee_config --reconfigure program, but again only 12 choices were shown and the TWI was not one of them.

I'm sure it is my error with the trouble I had trying to move the file from my download directory to the /user area.

I even tried modifying Mathew's install instruction to do so too but it had a run error so I guess that isn't going to work!

I will try later after I rest my brain a bit, but am I correct in assuming the procedure to do is to download the twi.py you provided, move it from the Downloads area into the /usr/share/weewx/user area after removing the previous twi.py file, and then run the wee_config again, or have I missed a step?

Thanks and sorry to be gumming up the works here. Dale

vince

unread,
Apr 30, 2022, 6:08:31 PM4/30/22
to weewx-user
yeah - it's a little more complicated than just grabbing one file.
You want to download it as a package and use the extension installer.

cd
sudo wee_extension --install weewx-twi

then it should appear in the menu.

If 'git' is not present, then "sudo apt-get install git" will install that.

Tom Keffer

unread,
Apr 30, 2022, 6:09:01 PM4/30/22
to weewx-user
Yes, that should have worked. At least, it worked on my test machine. 

Let's make sure it's where it should be. What do you get if you list the contents of the 'user' subdirectory?

ls -l /usr/share/weewx/user

And, let's make sure the correct version is there:

grep VERSION /usr/share/weewx/user/twi.py

-tk

Tom Keffer

unread,
Apr 30, 2022, 6:10:08 PM4/30/22
to weewx-user
The package installer should not be necessary. All the installer does is call the same API as wee_config.

-tk

D R

unread,
Apr 30, 2022, 7:40:00 PM4/30/22
to weewx-user
ls -l /usr/share/weewx/user
total 168
-rw-rw-r-- 1 root root 142476 Apr 25 18:53 belchertown.py
-rw-r--r-- 1 root root    541 Mar  1 17:19 extensions.py
-rw-r--r-- 1 root root    306 Apr 21 19:32 __init__.py
drwxr-xr-x 4 root root   4096 Apr 30 13:57 installer
drwxr-xr-x 2 root root   4096 Apr 25 19:00 __pycache__
-rw-r--r-- 1 root root  10513 Apr 30 18:31 twi.py


then

pi@raspberrypi:~ $ grep VERSION /usr/share/weewx/user/twi.py
DRIVER_VERSION = '0.4'
        loginf('driver version is %s' % DRIVER_VERSION)
        print("twi driver version %s" % DRIVER_VERSION)


And then:


Installed drivers include:
  0) TWI             (user.twi)                
  1) AcuRite         (weewx.drivers.acurite)  
  2) CC3000          (weewx.drivers.cc3000)    
  3) FineOffsetUSB   (weewx.drivers.fousb)    
  4) Simulator       (weewx.drivers.simulator)
  5) TE923           (weewx.drivers.te923)    
  6) Ultimeter       (weewx.drivers.ultimeter)
  7) Vantage         (weewx.drivers.vantage)  
  8) WMR100          (weewx.drivers.wmr100)    
  9) WMR300          (weewx.drivers.wmr300)    
 10) WMR9x8          (weewx.drivers.wmr9x8)    
 11) WS1             (weewx.drivers.ws1)      
 12) WS23xx          (weewx.drivers.ws23xx)    
 13) WS28xx          (weewx.drivers.ws28xx)   

I'm sure I have / had a gremlin.

I am off to try it.  Have to move the RP400 downstairs and make sure I can see he USBtty0 and all that

Thank you for the hand holding, both of you.  You can be pretty certain that the NSA doesn't have me on their radar for hacking into computers!
Dale

Tom Keffer

unread,
Apr 30, 2022, 7:42:47 PM4/30/22
to weewx-user
Let me know if it works. Like I said, there may be a few issues dealing with byte streams coming on and off the hardware.


D R

unread,
Apr 30, 2022, 7:43:37 PM4/30/22
to weewx-user
I perhaps spoke too soon:
I went back to complete the install, and got this:

choose a driver [4]: 0
Specify the serial port on which the station is connected, for
example /dev/ttyUSB0 or /dev/ttyS0.
port [/dev/ttyUSB0]: /dev/ttyUSB0
Traceback (most recent call last):
  File "/usr/lib/python3.9/shutil.py", line 806, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/etc/weewx/weewx.conf' -> '/etc/weewx/weewx.conf.20220430184103'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/weewx/wee_config", line 128, in <module>
    main()
  File "/usr/share/weewx/wee_config", line 122, in main
    config_mgr.run(args, options)
  File "/usr/share/weewx/weecfg/config.py", line 135, in run
    backup_path = weecfg.save(config_dict, output_path, not options.no_backup)
  File "/usr/share/weewx/weecfg/__init__.py", line 167, in save
    backup_path = weeutil.weeutil.move_with_timestamp(config_path)
  File "/usr/share/weewx/weeutil/weeutil.py", line 1467, in move_with_timestamp
    shutil.move(filepath, newpath)
  File "/usr/lib/python3.9/shutil.py", line 820, in move
    copy_function(src, real_dst)
  File "/usr/lib/python3.9/shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/etc/weewx/weewx.conf.20220430184103'
pi@raspberrypi:~ $

D R

unread,
Apr 30, 2022, 7:46:43 PM4/30/22
to weewx-user
And this is what is in my weewx.conf file (or part of it):


 [[CWOP]]
        # This section is for configuring posts to CWOP.
       
        # If you wish to post to CWOP, set the option 'enable' to true,
        # then specify the station ID (e.g., CW1234).
        enable = false
        station = replace_me
        # If this is an APRS (radio amateur) station, specify the
        # passcode (e.g., 12345). Otherwise, ignore.
        passcode = replace_me
   
   
    [[PWSweather]]
        # This section is for configuring posts to PWSweather.com.
        # If you wish to post to PWSweather.com, set the option 'enable' to true, then specify a
        # station and password. To guard against parsing errors, put the password in quotes.
        enable = false
        station = replace_me
        password = replace_me
   
    [[WOW]]
        # This section is for configuring posts to WOW.

Tom Keffer

unread,
Apr 30, 2022, 7:49:21 PM4/30/22
to weewx-user
Because your configuration file is in a protected area, you need to be a superuser to change things. Easily done: just prefix things with 'sudo':

sudo wee_config --reconfigure


Reply all
Reply to author
Forward
0 new messages