Hello,I am trying to get data from an Ambient Weather WS-3000 station, which should apparently be supported according to http://weewx.com/hardware.html (Fine Offset, HP3000 - the name is slightly different, but it is the same station), without success so far...I tried the FineOffsetUSB driver, but I get the following error:fousb: Cannot find USB device with Vendor=0x1941 ProdID=0x8021 Device=NoneWhat's the problem? Is the station not supported, am I using the wrong driver, something else?
echo "configobj
pyephem
pyserial
pyusb
willow
pillow
cheetah
Image
Django==1.11" > requirements.txt
pip install -r requirements.txt
tar xvfz weewx-X.Y.Z.tar.gz
cd weewx-X.Y.Z
./setup.py build
sudo ./setup.py install
So installation of weewx is no problem for me, and the simulator of weewx is working, but changing databases or other things will get difficult because I just do not have the overview what I am actually doing there...
tar xvfz weewx-3.8.2.tar.gz
cd weewx-3.8.2
./setup.py build
sudo ./setup.py install
cp ws3000.py /home/weewx/bin/user/
cp ws3000Extensions.py /home/weewx/bin/user/
cd /home/weewx
./bin/wee_config --list-drivers
Module name Driver name Version Status
user.ws3000 WS3000 0.1
weewx.drivers.acurite AcuRite 0.24
weewx.drivers.cc3000 CC3000 0.19
<...>
./bin/wee_config --reconfigure
[WS3000]
<...>
[[sensor_map]]
inTemp = t_1
outTemp = t_2
extraTemp1 =
extraTemp2 =
extraTemp3 = t_3
extraTemp4 = t_4
extraTemp5 = t_5
extraTemp6 = t_6
extraTemp7 = t_7
extraTemp8 = t_8
inHumidity = h_1
outHumidity = h_1
extraHumid1 =
extraHumid2 =
extraHumid3 = h_3
extraHumid4 = h_4
extraHumid5 = h_5
extraHumid6 = h_6
extraHumid7 = h_7
extraHumid8 = h_8
[StdConvert]
<...>
target_unit = METRICWX
inHumidity = h_1
outHumidity = h_2
rm archive/weewx.sdb
My previous post should be ignored.
Gary
raspberrypi weewx[461]: manager: Replace failed for database weewx.sdb: attempt to write a readonly database
Another log i got was the following:raspberrypi weewx[461]: manager: Replace failed for database weewx.sdb: attempt to write a readonly database
lsusb
rm archive/weewx.sdb
./bin/weewxd weewx.conf
# optional for extended almanac information:
sudo pip install pyephem
pip list --outdated
pip install --upgrade pyusb
1. install Raspbian
2. install requirements: apt-get install libjpeg-dev libtiff5-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev tcl8.6-dev tk8.6-dev python-tk
3. copy requirements.txt, weewx.tar.gz and ws3000*.py to the RPi
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install -r requirements.txt
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qDe-El03C2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
sudo apt-get install apache2 python-configobj python-cheetah python-serial python-usb python-imaging python-pillow python-pil sqlite
sudo dpkg --install weewx-X.Y.Z.deb
- Stop weewx:
sudo service weewx stop
/usr/share/weewx/wee_config --list-drivers
sudo /usr/share/weewx/wee_config --reconfigure
sudo rm /var/lib/weewx/weewx.sdb
sudo nano /etc/weewx/weewx.conf
[WS3000]
<...>
[[sensor_map]]
inTemp = t_1
outTemp = t_2
extraTemp1 =
extraTemp2 =
extraTemp3 = t_3
extraTemp4 = t_4
extraTemp5 = t_5
extraTemp6 = t_6
extraTemp7 = t_7
extraTemp8 = t_8
inHumidity = h_1
outHumidity = h_2
extraHumid1 =
extraHumid2 =
extraHumid3 = h_3
extraHumid4 = h_4
extraHumid5 = h_5
extraHumid6 = h_6
extraHumid7 = h_7
extraHumid8 = h_8
[StdConvert]
<...>
target_unit = METRICWX
sudo service weewx restart
tail -n 30 /var/log/syslog
current data (27 bytes)
00 7b
01 00 ch1 temp MSB
02 eb ch1 temp LSB t1 = (MSB * 256 + LSB) / 10.0
03 25 ch1 hum h1 = hum
04 7f ch2 temp MSB
05 ff ch2 temp LSB
06 ff ch2 hum
if buf[idx] != 0x7f and buf[idx + 1] != 0xff:
record['t_%s' % (ch + 1)] = (buf[idx] * 256 + buf[idx + 1]) / 10.0
record['t_%s' % (ch + 1)] = (buf[idx + 1] - buf[idx]) / 10.0
import struct
Then, use the following code to compute the temperaturerecord['t_%s' % (ch + 1)] = struct.unpack('>h', buf[idx:idx+2])[0] / 10.0
grep "ws3000: write" <log file>
OK, I couldn't let you do all the work alone, so I retrieved my ws3000 and did some test. Switching to record_generation = software does not prevent the duplicate loop packets. But I would still change the configuration, because hardware just doesn't make any sense (if I understand what this means correctly). I also saw a comment in the documentation mentioning that 'hardware' could cause issues with one station.
So far I haven't gotten any crash, so I'll let weewx run for a while, see if I also get a crash. If not, I'll try to setup my RPi to do the tests.
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qDe-El03C2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
/usr/bin/weewxd /etc/weewx/weewx.conf
/usr/bin/weewxd /etc/weewx/weewx.conf
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qDe-El03C2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
lsusb
Bus 001 Device 002: ID 0483:5750 STMicroelectronics
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
PYTHONPATH=bin python bin/user/ws3000.py
Alright, so the good news is that the vendor_id and product_id are still the same.NOTE: I just noticed that in your configuration, you specified driver = user.hp3000. Unless you made a change, it should be driver = user.ws3000.
Assuming that you installed the driver correctly in the bin/user directory,
to check if the current code is working with your station you could try the following:
1. first, stop weewx.
2. from the weewx folder, run the command:
PYTHONPATH=bin python bin/user/ws3000.py
NOTE: I just noticed that in your configuration, you specified driver = user.hp3000. Unless you made a change, it should be driver = user.ws3000.
Where did you see this info?
Or otherwise formulated: where shal I put such line?
--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qDe-El03C2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/1e03f915-8022-454a-813a-fc7afc99e064%40googlegroups.com.
RistoFeel free to use & edit & expand. Or Olivier, maybe you want to add an standalone script to your github?Not sure if it helps anyone, but with Oliver's help about a year or so ago, I stripped the ws3000 weewx driver code to work as standalone, without needing weewx. That way I was able to just read the values to MQTT for further use, without weewx dependency. The code is not cleaned in any way and it's actually possible that it still uses some weewx things here or there- I still have also weewx installed and haven't tested it without weewx.
https://pastebin.com/37WkUz7N
On Fri, Feb 14, 2020 at 12:26 AM Ton vanN <ton...@gmail.com> wrote:
--Perhaps not 100% done according to Olivier's latest message, but got the same result in weewx.confNow (in the next days) an update for display & database .....
Op donderdag 13 februari 2020 22:26:08 UTC+1 schreef Olivier Guyotot:Here, I put the code on github, with some basic installation instructions.https://github.com/hublol/WS-3000_WeeWxI haven't tested those instructions recently, they might be incomplete right now, but it's a start and I'll work to improve them if needed.
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qDe-El03C2k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/1e03f915-8022-454a-813a-fc7afc99e064%40googlegroups.com.
Fitted the stand-alone reader on an 'empty' Raspberry without
weewx (just Raspian_Buster + latest Domoticz_beta).
In new folder /home/pi/Install-files
Slight name-change to match my system-configuration.
First result from Putty's CLI shown below.
pixx@raspberrypixx:~ $ sudo python /home/pi/Install_files/hp3001_reader_python_script.pyMore or less as expected the 'import'-section causes first trouble, calling modules not present.
Traceback (most recent call last):
File "/home/pi/Install_files/hp3001_reader_python_script.py", line 4, in <module>
import usb.core
ImportError: No module named usb.core
After installation on that machine of weewx in the 'basic' form according to the UserGuide, the result is as below (for my configuration):
pixx@raspberrypixx:~ $ sudo python /home/pi/Install_files/hp3001_reader_python_script.pyLooks good!
{'dateTime': 1581756586, 'extraHumid4': 88, 'extraHumid5': 88, 'extraHumid2': 54, 'extraHumid3': 88, 'extraHumid1': 56, 'extraTemp4': 11.4, 'extraTemp5': 11.4, 'extraTemp2': 16.8, 'extraTemp3': 11.3, 'usUnits': 17, 'extraTemp1': 17.2}
ImportError: No module named usb.core
Geef de code hier op...
# Read datasets for new_packet
nberrors = 0
while nberrors < self.max_tries:
# Get a stream of raw packets, then convert them
try:
read_sensors_command = self.COMMANDS['sensor_values']
raw_data = self._get_raw_data(read_sensors_command)
# Convert data sets for new_packet
if not raw_data: # empty record
raise IOError("Failed to get any data from the station")
formatted_data = self._raw_to_data(raw_data, read_sensors_command)
logdbg('data: %s' % formatted_data)
new_packet = self._data_to_wxpacket(formatted_data)
logdbg('packet: %s' % new_packet)
# Make JSON-file
with open('/home/pi/HP3001_data.json', 'w') as outfile:
json.dump(formatted_data, outfile)
# Make XML-file
HP3001_xml = dicttoxml.dicttoxml(new_packet, attr_type=False)
xml_output = open("/home/pi/HP3001_data.xml",'w')
xml_output.write(HP3001_xml)
xml_output.close()
# End of JSON/XML-Compilation
return new_packet
ok, in fact I am getting very confused by what you are trying to do. Why do you want to mis-use weewx? And why use XML or JSON files, rather than a database?
Here is an updated version of the driver, including:- the fix for sub-zero temperatures- improved error handling/retry (something that wasn't working properly before)- the usb timeout is now a configuration setting- additional commentsIt probably won't fix the root cause of the 'crash' issue, but at least it should now properly retry so the problem might be more transparent. And the error reporting will be more useful to figure out what's wrong should an exception occur.