Open vinceskahan opened 5 years ago
Thanks, Vince!
Back in January, I was asked to develop a WeeWX UDP driver for an upcoming PWS product named Atmocom. I started by forking this WeatherFlow UDP driver, and the finished product wound up having many of the to-do list features from here like a complete wee_config console dialog for building a sensor_map table. Long story short, I am planning for the next version of this driver to be v2.0, and will be back-porting all of the improvements and added features from the Atmocom driver back into the WeatherFlow driver. I will also add the above revisions, and run both this and the Atmocom driver through the code validator to ensure Python3/WeeWX4 compatibility.
If Tom is already up to an alpha of WeeWX 4.0 and it needs Python3, I guess that it's time for me to get to work on building a Python3 test environment and see how the WeeWX "python3" branch works.....
Careful with python versions, my udp listener doesn't "hear" anything with Raspbian's 3.5.3 version of python. Ubuntu's 3.6.7 worked fine there. A self-compiled 3.7.0 on Raspbian also worked.
A nice one-liner to compile and altinstall python3.7.0 is HERE - I just cut+pasted the command up to and including the 'make altinstall' command in the middle. Then call python3.7 explicitly if /usr/local/bin is in your $PATH.
Re: weewx, this'll get you a Simulator running....
#---------------------------------------
# prerequisites
apt-get install -y python3-dev python3-pip python3-configobj python3-serial python3-pil python3-usb
pip3 install pyephem
pip3 install cheetah3
# webserver
apt-get install -y nginx
systemctl enable nginx.service
systemctl start nginx.service
# download weewx
cd /var/tmp
apt-get install -y git
git clone https://github.com/weewx/weewx.git
cd weewx
git checkout python3
# install weewx
python3 setup.py build
python3 setup.py install --no-prompt
sed -i 's:debug = 0:debug = 1:' /home/weewx/weewx.conf
# want webserver docroot to point to weewx files
ln -s /var/www/html /home/weewx/public_html
# hook into startup sequence
cp util/systemd/weewx.service /lib/systemd/system
systemctl enable weewx.service
# start it up
systemctl start weewx.service
systemctl status weewx.service
Tom's got an alpha of weewx 4.0 running, which will be the one that moves to python3. Everybody with drivers and extensions needs to check their stuff for compatibility and make the generally minor edits needed. I ran your driver through 2to3 and it came up with some minor patches needed (untested).
My 'recollection' is that this should work with both versions of python as a result (untested).