AirPi icon indicating copy to clipboard operation
AirPi copied to clipboard

Web interface - Dispaly isn't shown

Open SRadiant opened this issue 5 years ago • 6 comments

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.

SRadiant avatar Jan 06 '19 00:01 SRadiant

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.

RigacciOrg avatar Jan 08 '19 08:01 RigacciOrg

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?

SRadiant avatar Jan 08 '19 13:01 SRadiant

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.

RigacciOrg avatar Jan 08 '19 17:01 RigacciOrg

/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 avatar Jan 09 '19 07:01 SRadiant

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".

SRadiant avatar Jan 09 '19 09:01 SRadiant

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

happynitron avatar Aug 02 '19 07:08 happynitron