Closed aukeboskma closed 10 years ago
Sure! Assuming your Raspberry Pi is connected to your local network router, and has an IP address, all you should have to do is go to http://[ip-address]/ in your browser, and the Atmospi graph should appear. If that isn't working, then perhaps something else is wrong. Let me know, and I'd be happy to help debug.
Mmh, i did a fresh install of Raspbian tonight and the automatic install through puppet but I only get the "It works" page from apache when I go to the ip adres in the browser. What can it be?
It sounds like the Apache virtual host was not set up correctly by the Puppet script. Either that, or Apache was not restarted. Both are taken care of by the Puppet script, but maybe something went wrong.
Try restarting Apache first (sudo apache2ctl restart)... that's easy to try and maybe will solve it.
If that doesn't work, check to see if the virtual host symlink was created. It should exist as /etc/apache2/sites-enabled/atmospi, which is a symlink to /home/pi/atmospi/atmospi.vhost (make sure this file is there too).
That was my first thought as well. I restarted Apache (I only got a warning: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName). And I tried "readlink -f /etc/apache2/sites-enabled/atmospi" Raspbian respond with "/home/pi/atmospi/atmospi.vhost" so that should be right (and the .vhost file is pressent ofcource).
Which file should be served by Apache when I type in the IP-adress in the browser? I found a index file in the template folder. Is that the one?
OH I think I know what's wrong... I forgot to include this in the documentation...
Apache starts with a Virtual host file in /etc/sites-enabled called "000-default", which takes precedence over the atmospi one because it starts with "000-". There are two possible fixes:
1) If you move the "atmospi" symlink in the Apache sites-enabled folder to be called "000-atmospi" then it should work (restart Apache too).
2) Or, if you create an entry in your /etc/hosts file that links the IP address of the Pi to a hostname of "atmospi"... then you should be able to see the graphs by going to http://atmospi (this only works on the machine that you add a /etc/hosts entry to, however).
Perhaps I should update the Puppet script to automatically name the symlink "000-atmospi"?
Let me know if that works.
If you're interested in getting commit credit, it's an easy change...
Line 59 of atmospi/puppet/manifests/init.pp should change from:
path => '/etc/apache2/sites-enabled/atmospi',
to:
path => '/etc/apache2/sites-enabled/000-atmospi',
Do you want to fork and create a pull request?
Thanks for the commit! Did changing the symlink name and restarting Apache solve the issue for you?
Assuming it did, I'm going to close this issue. Reopen if it doesn't...
Thanks for helping!
Thanks for your fast respond. I'm a bit new to linux so figuring out which commands I need to use takes a bit of time. Apache doesn't want to start because of an error
Syntax error on line 5 of /etc/apache2/sites-enabled/atmospi:
So I'm figuring out what I did wrong and how to fix it :)
Thanks for giving me the possibility to earn commit credit
Ok, well first thing you need to do is move /etc/apache2/sites-enabled/atmospi to /etc/apache2/sites-enabled/000-atmospi
If you ran the Puppet script again to do this, then you probably ended up with TWO virtual host symlinks (because it will not automatically remove the old one). So delete /etc/apache2/sites-enabled/atmospi
Second, did you change anything in the file that it links to (/home/pi/atmospi/atmospi.vhost) ? That shouldn't require any editing, it should just work... unless something else is going on.
Awesome it is working. I removed all the symlinks and added only the symlink to /etc/apache2/sites-enabled/000-atmospi.
Now I need to find out why it doesn't show me measurements :)
Thanks for you time and help.
Measurements are taken by running one of the sensor scripts automatically via cron, or manually via the command line.
What kind of sensor are you using? DS18B20 temperature? Or DHT11/22 temperature+humidity?
The DS18B20 sensor script is automatically set up in cron via the Puppet script. The DHT11/22 requires more manual setup, unfortunately. See the project README.md for info on how to do that if you need.
Oh, and I just remembered this issue: https://github.com/mstenta/atmospi/issues/8
Sorry, I guess the Puppet script is not 100% done. Still a few manual steps needed...
Go to /home/pi/atmospi, and run the following commands:
First, delete any existing log.db file that may have been created...
sudo rm log.db
Then, create a new log.db file (make sure you're logged in as the "pi" user, not root), and set up the tables and indexes (just copy and paste each line one at a time into the command prompt):
sqlite3 log.db
CREATE TABLE Temperature(Device TEXT, Timestamp INT, C REAL, F REAL);
CREATE TABLE Humidity(Device TEXT, Timestamp INT, H REAL);
CREATE TABLE Flag(Device TEXT, Timestamp INT, Value TEXT);
CREATE INDEX temperature_timestamp ON Temperature(Timestamp);
CREATE INDEX humidity_timestamp ON Humidity(Timestamp);
CREATE INDEX flag_timestamp ON Flag(Timestamp);
CREATE INDEX temperature_device ON Temperature(Device);
CREATE INDEX humidity_device ON Humidity(Device);
CREATE INDEX flag_device ON Flag(Device);
.exit
Then, run the measurement script manually, and check the graph to see if it worked:
sudo /home/pi/atmospi/Atmospi/measure-ds18b20.py
Hope that helps!
Oops, the line breaks were not preserved in that last comment... see the README.md file for the commands I was trying to paste.
While trying to create the tables I get this error: Error: database or disk is full
free -h shows me that there is more than enough.. total used free shared buffers cached Mem: 437M 162M 274M 0B 8,6M 48M -/+ buffers/cache: 105M 331M Swap: 99M 0B 99M
Hmm, did you delete the log.db file that was there before? If not, then it could be that the file is owned by root, when it should be owned by "pi". Delete the log.db file and try again.
Yes I did delete the log.db as you said. I also tried it again... without success.
Oh wait... the "free -h" command shows you free MEMORY... not disk space.
Run df -h
and look at the Avail column of the "rootfs" row. What does that tell you?
Maybe you need a bigger SD card in the Pi? How big is it? I am running my Atmospis on 4gb cards. Are you doing anything else with the Pis? Or just dedicating them to Atmospi?
Damn that's stupid..
It shows me 100%, so yes its full indeed. I'm using also a 4GB card and it is also only dedicated to Atmospi. I installed rasbian with noobs.
Did you "expand the filesystem" after installing Raspbian?
If so, maybe NOOBS uses more space... I usually just flash Rasbian to the card directly.
After diner I will install Raspbian directly on a 8GB card. That will fix the problem for sure.
I used an 8GB card this time and re-installed Raspbian. I was able to add the tables to the database but still no data visible in the browser.
Ok great! So by default, the DS18B20 sensor script (which reads from the sensor and writes to log.db) is run via cron every 5 minutes.
You can also run it manually with:
sudo /home/pi/atmospi/Atmospi/measure-ds18b20.py
Try running it manually to see if that gives you the first data point in the graph. Hopefully it does. Then you can wait for the 5 minute mark and see if another point was added automatically. Then you're off and running!
Mmh I tried that but doesn't give me anything on the graph. Or shall I just have some patient :) 94 212 120 98
Hmm, it looks like something's going wrong in the Flask app when temperature and humidity data is being requested. See screenshot of warnings in Chrome: http://i.imgur.com/Od8xIL1.png
Questions:
sqlite3 /home/pi/atmospi/log.db
SELECT * FROM Temperature;
Okay.
The first time I run measure-ds18b20.py I got no response but not i'm getting "Error no such table: Temperature.
When try to read the table I get "Error: no such table : Temperature
But when I try to make that table I get "Error: table Temperature already exitsts.
I deleted the db and build it up again, same result.
what about write permissions..
No response is what you want. If you see an error then something is wrong.
Who is the owner of the file? The "pi" user? And what are the permissions on it?
jup it is owned by root. Write only permissions.
Ah ha! I mentioned that in a previous comment: https://github.com/mstenta/atmospi/issues/11#issuecomment-58366373
Working for you now? :-)
Damn I was deleting log.db but I should have worked in the /home/pi/atmospi/ folder.
I see readings now. Now I only need to change the measurements to Celcius because I'm from Europe ;-)
Thank you so much for your help and fast responses. In a few week i'm going to add the humidity sensors. I hope that is easy enough for me hehe.
Great! Good luck!
Here is a feature request I started for Celcius: https://github.com/mstenta/atmospi/issues/5
The Celsius readings are being stored in the database, so it's really just a matter of showing those instead of the Fahrenheit. But ultimately it needs to be configurable in settings.py so people can set the default.
Hi all, I installed atmospi via puppet and later, when I couldn't get it to work, I installed it manually but still no luck. I get the atmospi webpage but there are no measurement data. When I manually execute measure-ds18b20.py I get the following error message:
Traceback (most recent call last):
File "/home/pi/atmospi/Atmospi/measure-ds18b20.py", line 75, in
When I take a look in the database, there is no data, no sensor addresses or whatsoever. I've read this issue and tried a lot of things but i'm stuck. So I think i need some help :-)
Thanks in advance.
Hey @janvdbeek! You may have found a new bug... that code was changed recently, and maybe it isn't properly detecting new devices.
We should create a new issue to debug it...
In the meantime, I think you can get it to work by manually adding your sensors to the Devices table. You will need to find out the unique address of the sensor you have. Do you know how to do that?
Once you have that address, insert it into the Devices table with the following SQL:
INSERT INTO Devices (DeviceID, Type, SerialID, Label) VALUES(NULL, 'ds18b20', '1234567890', 'Name');
Change "1234567890" to the actual sensor ID, and change "Name" to the name you want to give it.
I created a new issue here: #27
I installed atmospi automaticly through puppet what worked great by the way. But I don't know how to see the logs and graphs in the browser. Can you please tell me how to get that working?
Thanks Auke