Before, You had to use the display-support as one method of output, but this was no good: the display shows the values every point of measurement, mostly when nobody watches. And if You are watching, You mostly miss the first values and have to wait for the next start of the display. The above script will run continuously in background and wait for a button pressed in the Adafruit LCD-PiPlate. It shows all the last measured values and sleeps again.
Im a total noob on this. I have the original software running successfully and posting to Xively but now want to be able to implement this new improvement. The hope is that I can export to TXT file and use Weather-Display software to read a single line text.
I have done a "git pull" on the cccmz loaction, edited the sensors to adjust height/air pressure...
But now, when I run it I got this :
Success: Loaded sensor plugin BMP085-temp Success: Loaded sensor plugin BMP085-pres Success: Loaded sensor plugin MCP3008 Success: Loaded sensor plugin DHT22-humidity Success: Loaded sensor plugin DHT22-temp Success: Loaded sensor plugin LDR Success: Loaded sensor plugin MiCS-2710 Success: Loaded sensor plugin MiCS-5525 Success: Loaded sensor plugin Mic Error: could not import output module rrd Error: Did not import output plugin RRD Traceback (most recent call last): File "airpi.py", line 161, in <module> raise e ImportError: No module named rrdtool
Is there a quick work around to edit something or get it working?
By applying the script several times to Your RRD, You can add as many sensors as You want.
After altering the RRD You just have to modify the outputs/rrd.py and extend the sensor-query:
if [i for i, x in enumerate(dataPoints) if x["name"] == "SENSORNAME" and x["sensor"] == "SENSORMODEL"]: array_index = [i for i, x in enumerate(dataPoints) if x["name"] == "SENSORNAME" and x["sensor"] == "SENSORMODEL"] rrd_value = rrd_value + ":" + str(int(round(dataPoints[array_index]["value"]))) else: rrd_value = rrd_value + ":U"
Now You can activate the sensor in Your sensors.cfg and start measuring.
Many thanks for taking us a bit further again! I have been changing my airpi software to your stack and after some round blocks, I managed to get it working (well: almost completely!). Let me share my experience, maybe it will help others.
First problem I came across is that to install the rrdtool apparently you need to do more than install python-rrdtool. It did not work at all until I added "sudo apt-get install rrdtool"
Now I was able to generate the rrd data file. But I got a strange error message saying that more input was found than the data file could handle. Studying the code, I found the problem, the smoke readings are not included in the data file. Adding these, that worked. Now it crashed still due to the LCD output. That was quite easy to tackle, just disable LCD output, though I am interested to try that as well. Though I imagine it will be hard to add the LCD AND the Airpi card?
One problem still remains, the data file seems to fill up, but I cannot use the graphics. It seems that there is still a little bit more to the installation of the rrdtool, as I receive a "$RRDTOOL function not found" error. Can you please elaborate on installing the rrdtool a bit more?
As You already said here, most of the problems come through different sensor-configurations: if You have a TGS2600 or not, etc. I try to fix this by extending the rrd.py (outputs) to check the sensors.cfg for the used sensors. On the other hand, You need to have a rrd-file, which has the same number of datasources as You have data.
At the moment I am looking for a wind-sensor, which I can add to one of the 4 analog ports remaining on the airpi pcb 1.2 - I will let You know.