tomhartley / airpi Goto Github PK
View Code? Open in Web Editor NEWa Raspberry Pi weather station
a Raspberry Pi weather station
After about 24 hours the airpi.py script seems to stop generating logs.
I am not sure if you still are using the AirPi?!
I try to add a new sensor based on your template (SHT31 temperature and humidity sensor) with no luck so far.
Could you please give some advice?
`#!/usr/bin/python
import sensor
import time
import smbus
class SHT31(sensor.Sensor):
requiredData = []
optionalData = []
def __init__(self,data):
"""
Initialisation.
Any initialisation code goes here.
"""
self.readingtype = "temperature"
self.sensorname = "SHT31"
self.valname = "Temperature"
self.valunit = "Degrees Celsius"
self.valsymbol = "C"
self.description = "SHT31 Sensor for Temperature and Humidity."
return
def getval(self):
try:
bus = smbus.SMBus(1)
bus.write_i2c_block_data(0x44, 0x2C, [0x06])
time.sleep(0.5)
data = bus.read_i2c_block_data(0x44, 0x00, 6)
ctemp = data[0] * 256 + data[1]
temp = -45 + (175 * ctemp / 65535.0)
except TypeError as terr:
pass
return temp`
So far, the name: tag should be the name of the stream (eg, Temp), and the raw tag should mean it isn't displayed on the site - raw tag doesn't do anything at the moment.
As seen on
Basically, that's just the way Python works. There's a very details explanation at https://stackoverflow.com/questions/2724260/why-does-pythons-import-require-fromlist
Personally, I'd use fromlist=['magic']
;-)
Values of self.SPIMISO and self.SPIMOSI in sensors/mcp3008.py are wrongly coded.
This is how it is:
self.SPIMOSI = 23
self.SPIMISO = 24
And this is how i've done to work well in my raspi v1 b:
self.SPIMOSI = 24
self.SPIMISO = 23
Things which should probably be in the config file:
Not sure what format it should be in yet.
The link provided in the website www.airpi.es for circuit diagram http://www.circuits.io/circuits/1946/schematic isn't working. Please provide a new link or the file containing circuit diagram.
Ideally, should have configurable duration for the window, as well as ability to control which sensors you want it for. Most probably the Air Quality ones, but maybe also the UV sensor and others. Potentially upload the raw values to Cosm as well.
Instructions missing the command
sudo pip install requests
For running the latest version.
Hi,
I've just assembled my board I got from the indie campaign and I've noticed that the software is still reporting UV sensor and has no value for microphone. Also, the CO reading seems to be stuck on 40ppm - is this a also a software issue or is something wrong with the sensor?
Dear all, unfortunately i have been waiting for too long on a Tindie order for the Board, so i was wondering if you would be kind enough to share the Eagle file of the latest board (0.4+) so i can have some printed myself on Seeedstudio.
The version you have shared now is an old one, and as i already have a case for it, i would really appreciate having the latest design.
Thank you in advance,
Luka
Hello,
i made a fresh install with RaspberryPi B+ and my AirPi PCB 1.4 and get the following error. On Debian Jessie it runs great.
All configs checkt, no sensor problem
DEBUG:main: ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:10:00
DEBUG:main: ERROR: Exception during output: Unknown format code 'f' for object of type 'str'
DEBUG:main: ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:10:20
DEBUG:main: ERROR: Exception during output: Unknown format code 'f' for object of type 'str'
It is the third sensor i have tested, sumtimes its ok
INFO:main: Success: Data output in all requested formats.
INFO:main: Success: Data successfully obtained from all sensors.
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': 45.400001525878906, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': 22.700000762939453, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:45:41
Greetings from Bavaria
Dear all, first of thank you so much for this project, i just got and built mine and im loving it!!
I have an issue though i hope someone here can helpo me fix.
The Pressure and Temperature readings are not being calculated, they stay stuck to some value since the first time i got it running.
I triple checked the soldering and its all fine.
I also get around 15-20 lines of : Error Accessing 0x77: Check your I2C address, every time after uploading succesfully, but that is set just fine in the cfg, as its working for the other sensors, and the i2cdetect confirms i got a Rev2 board.
The bmp085Backend.py does have a line reading i2c = none near the beginning, but im assuming thats some sort of initialization right ? (sorry im not that good with Python yet. .)
You can check the live feed here, and you will notice pressure and temperature are not working> https://xively.com/feeds/1547432953
Im about to order a new BMP085 as i have to assume this one is busted, but if anyone had encountered this error, or knows what might be causing this please let me know, i would really like to finish this asap so i can move to the projects other parts ..
Thank you in advance,
Luka
I find this project very useful and I am developing this further however I need the LICENSE so I can give credit.
Thanks!
Hi,
I am having the following errors appear when i run airpi.py, and can not fiigure out why:
Error: Did not import sensor plugin BMP085-temp
Traceback (most recent call last):
File "airpi.py", line 88, in <module>
raise e
NameError: global name 'requiredData' is not defined
Many thanks,
Jonathan
I'm trying to figure out a way to use this code without uploading it to the internet, probably by way of a MySQL database controlled by Python. Does anyone know the best way to do this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.