Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web interface - Dispaly isn't shown #2

Open
SRadiant opened this issue Jan 6, 2019 · 6 comments
Open

Web interface - Dispaly isn't shown #2

SRadiant opened this issue Jan 6, 2019 · 6 comments

Comments

@SRadiant
Copy link

SRadiant commented Jan 6, 2019

Hi, RigacciOrg. I installed the AirPi following Software setup step in website.
It can read the data from BME280 (I don't get PMS5003 yet). But when I open the web interface, the "Display" site isn't shown any data, totally blank. And open the .csv form "Data Download" show "ERROR: airpi-data-export: Error reading the database: no such table: data".
However the "Graphs" site work well.
How can I fix it? Help me, please. Thank you.

@RigacciOrg
Copy link
Owner

The "Display" web page and the CSV export function get data from the SQLite database /var/lib/airpi/airpi-data.db.
Everything is driven by the cronjob /etc/cron.d/airpi which runs every 5 minutes and launches the script /usr/local/lib/airpi/airpi-data-store. That script will, finally, execute the script /usr/local/lib/airpi/airpi-sql-insert which creates (or updateds, if it already exists) the SQLite database.
Please check that every piece is in place, try also to execute every single script on the command line and check for error messages.

@SRadiant
Copy link
Author

SRadiant commented Jan 8, 2019

Thank you for your response. I'm trying find out the problem.
When I run "sudo /usr/local/lib/airpi/airpi-data-store",
ERROR:root:airpi-data-store: Reading PMS5003 status file: [Errno 2] No such file or directory: '/var/run/pms5003.status'
ERROR:root:airpi-data-store: Parsing PMS5003 status file: name 'data' is not defined
(I don't get PMS5003 yet)
Is it fine?
My RPi autologin user "pi" when start. I have to add sudo in front of executing any script. Is it possible permission problem?

@RigacciOrg
Copy link
Owner

The error reading PMS5003 status data is OK, since you don't have that sensor; this error should be non fatal. Check if the SQLite database is created: /var/lib/airpi/airpi-data.db. The file should be owned by root:root, permissions -rw-r--r--
Try the commands on the command line as root: execute sudo su - once and you don't need sudo anymore in that ssh session.

@SRadiant
Copy link
Author

SRadiant commented Jan 9, 2019

/var/lib/airpi/airpi-data.db was created, and permissions -rw-r--r--, too.
I had executing some script separately...
image
image
image
image

@SRadiant
Copy link
Author

SRadiant commented Jan 9, 2019

Maybe snmp problem?
I didn't set any configuration of snmp or snmpd, because I didn't know
what should I do about "/example/snmpd.conf" and "make configuration to expose sensors values via SNMPD in More Software Setup".

@happynitron
Copy link

happynitron commented Aug 2, 2019

did you guys figure out it? i'm too facing like this problem.
what can you suggest for the below error?
root@john:/var/www/html# /usr/local/lib/airpi/airpi-data-http-post INFO:root:airpi-data-http-post: Communicating with post_data.php Traceback (most recent call last): File "/usr/local/lib/airpi/airpi-data-http-post", line 54, in <module> r = requests.post(HTTP_REQUEST_URL, verify=False, data={'login': HTTP_LOGIN, 'password': HTTP_PASSWORD}) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 110, in post return request('post', url, data=data, json=json, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 56, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 474, in request prep = self.prepare_request(req) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 407, in prepare_request hooks=merge_hooks(request.hooks, self.hooks), File "/usr/lib/python2.7/dist-packages/requests/models.py", line 302, in prepare self.prepare_url(url, params) File "/usr/lib/python2.7/dist-packages/requests/models.py", line 366, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL 'localhost/airpi/post_data.php': No schema supplied. Perhaps you meant http://localhost/airpi/post_data.php?

root@john:/var/www/html# /usr/local/lib/airpi/airpi-data-mqtt-pub ERROR:root:airpi-data-mqtt-pub: Cannot get timestamp: [Errno 2] No such file or directory: '/var/lib/airpi/mqtt-timestamp' INFO:root:airpi-data-mqtt-pub: Latest upload: 1970-01-01T00:00:00Z ERROR:root:airpi-data-mqtt-pub: Error reading the database: no such table: data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants