Voltcraft CO-20 USB-Luftqualitätssensor

Begonnen von C64Emulator, 04 Juni 2013, 10:50:06

Vorheriges Thema - Nächstes Thema

vbs


vbs

#256
Ich hab das airsensor mal um einen Parameter "-c" erweitert, dem man selbst ein Kommando mitgeben kann. Das Kommando wird dann nach jedem Pollen aufgerufen. Es muss einmal %d enthalten, um den VOC-Wert aufnehmen zu können.
Außerdem einen Parameter -i um das Intervall konfigurieren zu können.

Beispiel:
./airsensor -d -i 120 -c "echo \"setreading fl_airSensor airQuality %d\" | nc -w10 localhost 7072"

Holt alle 2 Minuten einen Wert und setzt ihn per setreading.

Falls das auch jemand gebrauchen kann:
https://github.com/verybadsoldier/airsensor

EDIT:
...übrigens sind die Velux Raumlüftfühler jetzt wieder lieferbar:
http://www.velux.de/produkte/lueftungsloesungen-belueftung/raumluftfuehler
Lieferzeit 5 Tage.

NaCkHaYeD

Hi,

ich habe nun auch ein V...x Teil mit FHEM am laufen. Funktioniert soweit auch, jedoch erhalte ich im Log permanent

2015.04.12 22:31:01 3: co20: CO20 device found
2015.04.12 22:31:01 3: co20: CO20 device opened
2015.04.12 22:31:11 3: co20: disconnected
2015.04.12 22:31:11 3: co20: CO20 device found
2015.04.12 22:31:11 3: co20: CO20 device opened
2015.04.12 22:33:21 3: co20: disconnected
2015.04.12 22:33:21 3: co20: CO20 device found
2015.04.12 22:33:21 3: co20: CO20 device opened
2015.04.12 22:33:31 3: co20: disconnected
2015.04.12 22:33:31 3: co20: CO20 device found
2015.04.12 22:33:31 3: co20: CO20 device opened
2015.04.12 22:37:41 3: co20: disconnected
2015.04.12 22:37:41 3: co20: CO20 device found
2015.04.12 22:37:41 3: co20: CO20 device opened
2015.04.12 22:39:46 3: co20: disconnected
2015.04.12 22:39:46 3: co20: CO20 device found
2015.04.12 22:39:46 3: co20: CO20 device opened
2015.04.12 22:39:56 3: co20: disconnected
2015.04.12 22:39:56 3: co20: CO20 device found
2015.04.12 22:39:56 3: co20: CO20 device opened
2015.04.12 22:40:06 3: co20: disconnected
2015.04.12 22:40:06 3: co20: CO20 device found
2015.04.12 22:40:06 3: co20: CO20 device opened

Gibt es hierfür eine Lösung?
mfg
Thomas

Mr. P

Meine kaputte Glaskugel zuckt und ich deute, sie will mir sagen, du hast ihn an einem Raspberry angeschlossen...
Wenn dem so ist, stelle ihn einmal um auf USB1.1 und dann funktioniert das auch mit dem Nachbarn. ;-)
Greetz,
   Mr. P

joshi04

#259
Meine Glaskugel hat sich auch gerade geregt, scheint aus der gleichen Charge zu kommen. Nach dem Rpi kam bei meiner, als sich der Schleier nach etwas Warten noch ein wenig weiter gelichtet hat,  ein zu langes und ggf. minderwertiges oder großen Störeinflüssen ausgesetztes USB-Kabel zum Vorschein. Bitte prüfe einmal, ob davon etwas zutreffend ist.

Ergänzend zum Umschalten auf USB 1.1, ein aktiver kompatibler (!) Hub kann richtig Freude bereiten... ;) Ich habs aber auch schon ohne hinbekommen.

Da das mM bekannte Schwierigkeiten sind, mag sich jmd erbarmen, das dem Wiki hinzuzufügen, wenn nicht bereits geschehen? Mache ich gerne selbst, wenn ich die Panstamp -Baustelle im Griff habe (das dauert noch) und noch viel schlimmer mein Internet wieder geht...!


Gesendet von meinem iPhone mit Tapatalk

Edith sagt: Internet geht wieder, wenn denn die Panstamps sich auch von selbst einrichten würden...
NUC: 2xJeeLink, PCA301/TX35DTH; HueBridge, LivingColors; vair-monitor (CO2); HMLan, Winmatic, HM-CC-RT-DN, HM-TC-IT-WM-W-EU, HM-ES-TX-WM, HM-WDS10-TH-O, HM-ES-PMSw1-Pl, HM-SEC-SC-2, HM-SEC-SCo; AVM DECT 200; panStamp; smartVISU

NaCkHaYeD

Sorry ich vergaß,

ja Rasperry Pi B+ und Stick hängt direkt am Pi. Selbst mit aktivem USB 2.0 Hub war das Problem nicht behoben.
OK werde mal googlen wie man das Ding auf USB 1.1 umstellt, oder könnt ihr dies kurz posten.

mfg
Thomas

Mr. P

Trage im File: /boot/cmdline.txt
am Anfang der Zeile einfach: dwc_otg.speed=1
ein bzw. schau ob der Parameter mit 0 bereits existiert und ändere den Wert auf 1.

Also zB:
dwc_otg.speed=1 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Greetz,
   Mr. P

NaCkHaYeD

Vielen Dank,

dwc_otg.speed hat das Logfile beruhigt. Nun bleibt die Verbindung offen.

Gruß
Thomas

vbs

Hat schon jemand rausgefunden, wie es zu Werten von "21546" kommen kann?
2015-04-15 22:56:33, VOC: 21546, RESULT: Error value out of range
2015-04-15 22:56:44, ERROR: Invalid result code:  -16


Ist mir bisher mit der Windows-Software nicht aufgefallen (evtl. wird das dort gefiltert). Jetzt am Raspberry bekomme ich das ca. 2 Mal pro Stunde mit "airsensor".

Markus M.

Diese Werte sind Fehlerwerte wenn bei der Sensorabfrage  irgendwas schief geht und üblicherweise die Vorstufe zum Lock-Up, wenn du danach gleich wieder pollst. Solange es nur ab und zu vorkommt kannst du das ignorieren.
Aktuell weder Smarthome noch FHEM vorhanden

vbs

Ja, soweit versteh ich das. Würde es aber trotzdem gerne verstehen, warum das passiert und nach Möglichkeit auch gerne beheben. Einfach aus einem Spieltrieb heraus ;) Kann das etwas mit der Spannugsversorgung des RaspBi zu tun haben? Ich hab da im Moment nur ein 1A-Netzteil dran.

Markus M.

Kann sein, muss nicht.
Solange es generell läuft würde ich keinen Aufwand in USB Debugging stecken weil die einzige Lösung darauf hinausläuft, keinen RasPi zu verwenden.
Aktuell weder Smarthome noch FHEM vorhanden

vbs

Also ich hab jetzt mal probiert, den USB-Speed zu begrenzen, mal gucken. Scheint ja eine Wunderwaffe beim Raspi gegen USB-Probleme zu sein... dann probier ich nochmal ein 2A-Netzteil... und dann gebe ich auf...

vbs

Hat schonmal jemand rausgefunden, wofür die Register Reg_P, Reg_I und Reg_D sind? Ich habe hier mehrere von den Sticks und versuche gerade, mindestens zwei dazu zu bewegen, die gleichen Werte auszugeben. Habe beide unter identischen Bedingungen kalibriert, aber wenn die Werte steigen, laufen sie ca. 5% auseinander. Evtl. gibt es in den Registern einen kleinen Parameter, den man tunen kann zu dem Thema?

Markus M.

#269
Keine Ahnung, ich kann dir aber mal meine Vergleichswerte geben:
KNOB_Reg_D 0
KNOB_Reg_I 10
KNOB_Reg_P 3
KNOB_Reg_Set 147
debug 716
pwm 336
r_h 146.87
r_s 192353
voc 516


Reg_Set ist der Vergleichswert zum Widerstand r_h aus der Kalibrierung - Versuch daran mal minimal zu drehen.
Der Rest: http://de.wikipedia.org/wiki/Regler#PID-Regler

Probier rum und berichte von deinen Erkenntnissen :)
Und übertreibs nicht mit den Werten, nicht dass dir das Ding noch durchbrennt.


Der Vollständigkeit halber hier noch das Readme zu Stick und Software:
AirMonitor engineering mode
===========================
To enter the (unsupported) engineering mode, do the following:
- Hold down left CTRL-key and double-click on the right top logo


Posting a bug report
--------------------
If the program crashes you will most probably see a requester on the form
"Fatal program error in Airmonitor: ...".
As the requester say, the error has been copied to your clipboard.
Please do a "paste" operation when sending the bug report to us (e.g in an email).
That way you do not need to send us a screen dump of the error.


Get sensor information
----------------------
To get technical information about the connected sensors,
open "Help"-"About" and click on "Sensor info...".
You can copy and paste the text e.g into an email.

Sensor Reading time
-------------------
The time required for reading all connected sensors is shown as a constant flag "tr=XX.XX"
in the upper left corner. This time must not exceed the sampling interval.

File menu
---------
Some extra functions are now available:
- Save current buffer data...          ;           ; : Saves what you see on the screen to a file.
- Erase flash         & nbsp;         & nbsp;         & nbsp;         & nbsp;         & nbsp;         & nbsp;: Erases any records stored in the stick

The stick can record data when not enumerated (= connected to a power source only).
This is enabled by setting the "knob" LogInterval to something else than 0.
If the knob "LogInterval" does not exist the stick does not support that functionality.


Support tools
-------------
This menu is only available in engineering mode.

- Edit knobs...
This menu will give access to the "knobs" (analogue settings) in each stick,
like warning levels, PID setting etc. "Flags" are also displayed.
A value can be changed by double-clicking on it. You can get back to the factory settings by
sending the "RST" command to the stick(s), see Airmonitor command line options in the help file.

Some knobs (stored in EEPROM):
CO2/VOC level_warn1:      Lower warning level
CO2/VOC level_warn2: Upper warning level
   Reg_Set:        &nbs p;         &nbs p;         &nbs p;      Regulator setting. Don't touch.
   Reg_P:                                            Regulator P setting. Affects speed/stability. Don't touch.
   Reg_I:                                            Regulator I setting. Affects speed/stability. Don't touch.
   Reg_D:                                            Regulator D setting. Affects speed/stability. Don't touch.
   LogInterval:                           (Default 0=Turned off). Seconds between samples recorded to flash when
                                                               stick is powered but not enumerated (i.e in a wall plug).
   ui16StartupBits:       &n bsp;       Config bits:
                                                               Bit 0   : Default 1= Reset baseline on power up
                                                               Bit 1-15: Reserved
                                                               
Some flags (volatile):
(if bit 15 is set on a flag it is displayed in the Airmonitor graph)
   WARMUP                                            Stick is in warmup state and flashes the red/green led
   BURN-IN          ;           ;           ;           ; Burn-in minutes left
RESET BASELINE        &nbs p;   Sent from the PC to start a baseline reset procedure
CALIBRATE HEATER           Sent from the PC to start a calibrate heater procedure


   
Inside the form for this menu selection there is also a network section.
This is an experimental network support. Airmonitor can either be off the network,
act as a server (waiting for other AirMonitor programs to access it at the specified port),
or act as a client (connect to the specified port on the specified ip/host name).
Network support protocol is described later in the section "Network protocol".

- Recalibrate heater
This will send a command to all sticks and tell them to recalibrate the chip heater PID parameters.

- Search for updates
This will simply start a web browser and access the url stored in the first iAQ Stick.
Usually this brings you to the manufacturers web page.

- Upgrade firmware
This will place all connected sticks in DFU (Device Firmware Upgrade) mode. They will deatach
themselves from the USB host, reconfigure as DFU devices and re-connect.
The driver needed to talk to a DFU is included in Atmels FLIP package (search the Internet for "Atmel FLIP" or
browse to http://www.atmel.com/dyn/products/tools_card.asp?tool_id=388 6).
The driver is typically located in "C:\Program Files\Atmel\Flip 3.3.4\usb" after installation of the FLIP package.
When FLIP is installed you can use it (the windows gui or BATCHISP) to reprogram the sticks firmware.
Only do this on one stick at the time. You will need an Intel HEX file from the iAQ stick vendor with
the new firmware.
When the upgrade is done, reset the stick (reload eeprom defaults) by, at the command prompt, write
"airmonitor.exe /RST" (see Airmonitor command line options in the help file).

Settings-Plot
-------------
This menu exists in non-engineering mode as well, but now there are some more settings available.

Curve
-----
There are more curves available in a stick than just the VOC level. The new pull-down box gives you
the possibility to set the parameters for each available curve.
By default Airmonitor only shows the first curve.

Scroll
------
Unchecking this box will give "wandering cursor" type of graph instead of the scrolling graph.
The benefit is that the "wandering cursor" is less cpu demanding and easier to measure with the cursor.

Margins
-------
This sets the margins, in pixels, for the plot area.


----------------------------------------------------------


Network protocol
----------------
The network protocol can be tested by placing the Airmonitor program in "server" mode (see above) and
telnet to localhost 5800 (default). A telnet session might look like this:

c:\>telnet localhost 5800
iAQ USB server Version 2.40.0 svn:$Rev: 1702 $ $Date: 2011-01-17 11:23:13 +0100
Ready
0001:iAQ>

The available commands are:

add [USB:0] mcu|nChannels|CH0|.ChID|.Ylabel|.Yunit|.LastValue   ;  Add a sensor to the server
   help         &n bsp;  Help text
   bye         &nb sp;   Exit
   ls         &nbs p;    Get list of all sensors
m <message>     Print message
   trg         &nb sp;   Get all sensor readings
update [USB:0] nChannels|.LastValue|.LastValue|.LastValue...  &nb sp;  Update values for specified sensor
updateplot      Update server plot

If you are a client and you only wish to read out the values of the server sensors,
simply use the commands "ls" initially and then "trg" at regular intervals.
Remember to wait for the prompt "iAQ>" before sending a new command.

add
---
Adds a new "virtual" sensor to the server. In this case the server adds
a sensor provided by the connecting client.
The parameter is an identifying list of sensor channels, formatted like:

[interface:path] mcu|number-of-channels|channel-0-name|channel-0-id|channel-0 -Ylabel|channel-0-Yunit|channel-0-last-value
|channel-1-name|channel-1-id|channel-1-Ylabel|channel-1-Yuni t|channel-1-last-value
| ...
|channel-n-name|channel-n-id|channel-n-Ylabel|channel-n-Yuni t|channel-n-last-value

Example:
0003:iAQ>add [EMU:0:0]EMU|5|0|RND() level|ppm|1537|1|Debug|i16|1568|2|PWM|ui16|1542|3|Rh|ohm|15. 62|4|Rs|ohm|1556
0004:iAQ>add [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]ATmega32U4|5|0|CO2/VOC level|ppm|350|1|Debug|i16|815|2|PWM|ui16|412|3|Rh|ohm|0|4|Rs |ohm|0
0005:iAQ>

help
----
Prints a short help text.

bye
---
Close connection.

ls
---
Lists all connected sensors. The list is formatted as sequential "add" commands and is ended with the "updateplot"
statement. This is so that a connecting AirMonitor can use the same parser for incoming messages as for queries.

Example:
0006:iAQ>ls
add [EMU:0:0]EMU|5|0|RND() level|ppm|1537|1|Debug|i16|1568|2|PWM|ui16|1542|3|Rh|ohm|15. 62|4|Rs|ohm|1556
add [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]ATmega32U4|5|0|CO2/VOC level|ppm|350|1|Debug|i16|815|2|PWM|ui16|412|3|Rh|ohm|0|4|Rs |ohm|0
updateplot
0007:iAQ>

m <message>
-----------
This prints a message on the Airmonitor screen. For test purposes.

Example:

    0006:iAQ>m Hello World!
    0007:iAQ>

trg
---
Get current sample values. This gest a list in the following form:

update [interface:path]number-of-channels|channel-0-value|channel-1-value| ... channel-n-value

Example:

   0003:iAQ>trg
   update [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]5|350|814|400|0|0
   update [USB:\\?\hid#vid_03eb&pid_2013#6&1f0ff5bf&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}:0]5|350|814|400|0|0
   0004:iAQ>

update
------
This command updates values for a "virtual" server sensor previously added with the "add" command.
The syntax is the same as the string response to the "trg" command:

update [interface:path]number-of-channels|channel-0-value|channel-1-value| ... channel-n-value


updateplot
----------
This sends a request to the server to update his plot, typically after a virtual sensor has been added.
The server plot will be cleared.
Aktuell weder Smarthome noch FHEM vorhanden