Air Quality Sensor ?

242 views
Skip to first unread message

Yves Martin

unread,
Jun 29, 2023, 4:00:35 PM6/29/23
to weewx-user

15 h 58 (maintenant) 
Hi,

Is the Devis "Air Quality Sensor" is natively supported in the last version of weewx? (4.9.1) 

I'm using Python 2.7.3 (I've heard I will need Python 3...)?

I've added a link to my meteo station and I will be happy to get the data and add these information in my meteo station. With the poor Air quality we had in Montreal in the last days, it will be important to share this information. (http://45.73.0.50:8080/v1/current_conditions)

Yves,
YMartin.com/meteo

vince

unread,
Jun 29, 2023, 4:09:52 PM6/29/23
to weewx-user
What have you searched for ?
(hint - try some searches)

I would be surprised if anything modern works with python2...

Yves Martin

unread,
Jun 29, 2023, 4:24:13 PM6/29/23
to weewx-user
Hi Vince,

I'm using the "Davis Air Quality Sensor" with my phone (Installed here http://45.73.0.50:8080/v1/current_conditions)
Here is the information about the device: https://www.davisinstruments.com/pages/airlink

I am looking to integrate this sensor to my meteo station ... (YMartin.com/meteo)
I'm using a Davis Vantage Pro2 since a while now, and with weewx it works very well since 2014.

I already asked here if something exists for this Air Quality Sensor, and I get an answer that I have to upgrade my version (3.9.2 to 4.x.x) and perhaps upgrade also my Python version too and the device was already supported (I did not find this in the documentation).

I've set another Raspberry Pi with Debian 10 and Python 3.9 ... but before I change and transfert the data to the new plateform, I would like to know if there is an easy way to integrate this sensor to weewx?

Regards,

Yves
YMartin.com/meteo

Tom Keffer

unread,
Jun 29, 2023, 4:43:36 PM6/29/23
to weewx...@googlegroups.com
Hello, Yves

Unfortunately, no, there is no driver for the Davis AirLink.

--
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/52cf6f4a-1c56-4e37-82fd-5556b5459ff2n%40googlegroups.com.

Yves Martin

unread,
Jun 29, 2023, 5:45:02 PM6/29/23
to weewx-user
Hello Tom,

what a shame. Are there alternatives?
Tom, do you plan to add it later?
Air quality becomes just as important an index as temperature or humidity now...

PS: Thanks also for all these years of support and this beautiful software.

Yves,
YMartin.com/meteo

vince

unread,
Jun 29, 2023, 6:34:42 PM6/29/23
to weewx-user
Not sure what you're looking for in terms of an answer here.  Yes there is a third-party extension if you attempt to look for it even minimally.  Yes it requires a modern python version.  Yes there is an easy way to integrate it.  Install and configure that extension like you would do with any other extension.

Yves Martin

unread,
Jun 30, 2023, 7:51:33 AM6/30/23
to weewx-user
Hi Vince,

What I'm looking for is to ingrate pertinent information about "Air Quality" on my Meteo Station. If there is a third party extension doing it, I will take it!
If I have to upgrade Python to version 3.x, I will do it too (but I need to know how... and what is the impact of my actual setting).
If there is an easy way to do it, this is perfect! ;)

Actually I"m using Debian 7.11 with Python 2.7.3

Regards,

Yves,
YMartin.com/meteo

vince

unread,
Jun 30, 2023, 3:40:20 PM6/30/23
to weewx-user
debian 7 was end-of-life over 5 years ago and is no longer getting security updates.  You should build a new SD card with a current RaspiOS on it, which will have python3 there by default.   Reinstall everything you have added to your current os onto the new SD card.

Once you have the new SD using weewx and python3 you will meet the prerequisites for the airlink extension.

Yves Martin

unread,
Jun 30, 2023, 3:46:55 PM6/30/23
to weewx-user
Hi Vince,

This is already done (new Raspberry Pi 10 with Python 3.9) ... but how to transfert all to the new one?
If I copy all from one to the new one, is weewx will work under Python3?

(/usr/share/, /var/, /etc/ directories etc...)

Yves

Yves Martin

unread,
Jun 30, 2023, 5:18:43 PM6/30/23
to weewx-user
First test with new Debian distribution and new Python ... I get a couple of errors ...

Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****      self.loadServices(config_dict)
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 161, in loadServices
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self, config_dict)
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1335, in get_object
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****      mod = __import__(module)
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****    File "/usr/share/weewx/user/aprx.py", line 66
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****      self.lat   = d.get('lat', {})
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****                                  ^
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****  TabError: inconsistent use of tabs and spaces in indentation
Jun 30 16:17:08 weewx4-raspi python3[374]: weewx[374] CRITICAL __main__:     ****  Exiting.

(...)
Message has been deleted

vince

unread,
Jun 30, 2023, 9:52:04 PM6/30/23
to weewx-user
Yves - apologies for my earlier too cranky reply.

When you see an error in your logs, the first thing to do is to look up the exact error message in the search feature for this Google Group, and if it is not there then try to Google for that exact message. It is almost certain that the message you are seeing is a known thing that has a known solution.

Doing a quick groups and Google search almost always finds your solution much quicker than posting a "what do I do" kind of message.

In your case, a Google search for "TabError: inconsistent use of tabs and spaces in indentation" will return many pages explaining what your current issue is, and you'll also possibly learn a little more about how python works.

Yves Martin

unread,
Jul 1, 2023, 11:39:48 AM7/1/23
to weewx-user
Hi Vince,

You're probably a programmer, not me. I did some in my old time in asm but it was with a Z80, in opl, pascal, basic and Clarion and that was my last experience in programming.

I can play a bit but I don't want to spend my time learning Python, I have no time for that unfortunately. Perhaps in a few years when my business will give me more spare time ...

I checked in the forums but I could not not find theses errors, plus it seems these error are from existing programs working now with Python 2.7.3... For example, it seems there is some tab of space at the wrong place in a program wrote in 2017 (aprx.py). I believe something change between Python 2.7 and 3, some help will be welcome. I can do more than waiting, just give me some hints.

Perhaps my config file (weewx.conf) has to be updated or checked with Python3 ?

Also I use some script addon (nicksengines) and I don't know if I have to check some update if I use Python3?

It will be a god idea of course to use a more recent distribution for security issues, but in another hand, the Raspberry Pi server is just used locally, not NATted...

Regards,
Yves

Tom Keffer

unread,
Jul 1, 2023, 4:08:48 PM7/1/23
to weewx...@googlegroups.com
Have you tried upgrading your copy of weewx-aprx? The current copy looks quite different from the one you seem to be using.

--
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.

gjr80

unread,
Jul 1, 2023, 5:02:35 PM7/1/23
to weewx-user
I would tread carefully here, it is some time since I last touched weewx-aprx and I seem to remember there was more than one player in the 'WeeWX aprx' field. As far as I am aware the line:

self.lat   = d.get('lat', {})

has not been used in any weewx-aprx code.

Gary

Tom Keffer

unread,
Jul 1, 2023, 5:04:54 PM7/1/23
to weewx...@googlegroups.com
Noted!

Yves, check around. Apparently your copy did not come from gjr's repository.

OTOH, maybe his copy works better?

-tk

Yves Martin

unread,
Jul 3, 2023, 3:56:55 PM7/3/23
to weewx-user
Hi Tom,

No I did not. I thought it was coming with the weewx distribution.
It has been installed a fews years ago in fact and I never touch it then.

YM

Yves Martin

unread,
Jul 3, 2023, 4:23:20 PM7/3/23
to weewx-user
Hi Tom,

I used the last version of aprx, this seems better, but now I have another error linked to mysql lite.

Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/manager.py", line 130, in __init__
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****      self.sqlkeys = self.connection.columnsOf(self.table_name)
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****    File "/usr/share/weewx/weedb/sqlite.py", line 187, in columnsOf
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****      column_list = [row[1] for row in self.genSchemaOf(table)]
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****    File "/usr/share/weewx/weedb/sqlite.py", line 187, in <listcomp>
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****      column_list = [row[1] for row in self.genSchemaOf(table)]
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****    File "/usr/share/weewx/weedb/sqlite.py", line 176, in genSchemaOf
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****      for row in self.connection.execute("""PRAGMA table_info(%s);""" % table):
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****  sqlite3.DatabaseError: database disk image is malformed
Jul 01 11:41:32 weewx4-raspi python3[375]: weewx[375] CRITICAL __main__:     ****  Exiting.
root@weewx4-raspi:/home/ymartin#

(...)

Of course, I just copy the old database to the new server. Is there some updates or something to convert this?

regards
Yves

Yves Martin

unread,
Jul 17, 2023, 9:22:47 AM7/17/23
to weewx-user
Just to let you know, Tom was right, my database was corrupted during the copy.
I did it a second time then all was perfect.

YM

Reply all
Reply to author
Forward
0 new messages