trying to use measureit but...

191 views
Skip to first unread message

Sergio Meinardi

unread,
Feb 18, 2018, 10:51:33 AM2/18/18
to measureit
... getting blank page and internal server error 500 on every functions in measureit_functions.php.

I bought a raspberry Pi 2, installed the software and I can see data flowing from the serial port and recorded in the database. Access to the database as user "measureit" is ok. Developers tools seem useless as they don't inspect callback functions (at least I'm not able to do it) so I can't say if there's something wrong with database connections.

Any suggestion to understand what the problem is? 

Thanks in advance.

Thomas

unread,
Feb 18, 2018, 12:58:44 PM2/18/18
to measureit

Sergio Meinardi

unread,
Feb 19, 2018, 2:38:29 AM2/19/18
to measureit
Thanks for your time Thomas.

The error log shows this error

PHP Fatal error:  Uncaught Error: Call to a member function prepare() on null in /var/www/measureit_public_html/php/class.db.pdo.mysql.php:48\nStack trace:\n#0 /var/www/measureit_public_html/php/measureit_functions.php(843): db->query('\\n\\t\\tSELECT *\\n\\t\\tF...')\n#1 /var/www/measureit_public_html/php/measureit_functions.php(284): sensors_get()\n#2 /var/www/measureit_public_html/php/measureit_functions.php(14): summary_start(Array)\n#3 {main}\n  thrown in /var/www/measureit_public_html/php/class.db.pdo.mysql.php on line 48, referer: http://10.0.0.15/

Now what?


Thomas

unread,
Feb 19, 2018, 12:43:46 PM2/19/18
to measureit
This is a error while connecting to the database.

Do you use the measureit image for the pi?

Lets find out if the database server is running.
Try this command as root:
echo "show databases;" | mysql -uroot -praspberry

This should return something like this:
Database
information_schema
measure_it
mysql
performance_schema

Sergio Meinardi

unread,
Feb 20, 2018, 9:28:02 AM2/20/18
to measureit


Il giorno lunedì 19 febbraio 2018 18:43:46 UTC+1, Thomas ha scritto:

Do you use the measureit image for the pi?
I downloaded the 2016-05-10-raspbian-jessie-lite-measureit-120-2gb.img.zip image but it didn't work (no boot on RPi; jut a green led blinking) 
So I downloaded the Raspbian Stretch Lite image from https://www.raspberrypi.org/downloads/raspbian/ (November 2017 version)  and source code of measureit 120, and followed instructions from 
http://81624.de/wiki/doku.php?id=measureit:install (using experience to adapt what didn't worked; I've limited experience with linux); 
Apache works, mysql works.

Indeed I had to add sudo before mysql

Lets find out if the database server is running.
Try this command as root:
echo "show databases;" | mysql -uroot -praspberry

This should return something like this:
Database
information_schema
measure_it
mysql
performance_schema

but this is exactly what I see also logging as root and as measureit. I also successfully select data from tables using the sql statements that I found in measureit_functions.php.
the grabber works correctly and it's filling the tables with data.

well, I'll be very happy to offer you a beer, if you solve this mistery!

Thanks again for your help

Sergio Meinardi

unread,
Feb 20, 2018, 1:12:46 PM2/20/18
to measureit
Solved!

I restarted from scratch. Now with a week more of experience I better understood some cryptic messages of apt-get.

I followed the instructions from page http://81624.de/wiki/doku.php?id=measureit:install, switching to root instead of pi user.

Unfortunately Install and configure php5-fpm threw an error (some packages missing or not available). So googling I found an answer from RonR at page https://www.raspberrypi.org/forums/viewtopic.php?t=198556

Following his advice I was able to continue without other errors.

The raspberry is collecting data from the Envir and I'm ecstatically looking at the graphs!  :)

Many thanks for your time, Thomas. A beer on its way to your home!

Thomas

unread,
Feb 21, 2018, 3:14:15 PM2/21/18
to measureit
Hi Sergio,

congratulation! To use my copy & paste wiki without further knowlegde is not easy :)

How do you copy the measureit image to the sdcard? I try it last week and it is booting without problems.

If I can trust the weather forecast I will drink a beer on you on the weekend. It should be sunny with -10 degree. :D

Sergio Meinardi

unread,
Feb 22, 2018, 12:33:33 PM2/22/18
to measureit


Il giorno mercoledì 21 febbraio 2018 21:14:15 UTC+1, Thomas ha scritto:

How do you copy the measureit image to the sdcard? I try it last week and it is booting without problems.
win32diskimager. I tried different cards (from different vendors and different size) but that image didn't boot (a green led on RPi blinks 8 times)


If I can trust the weather forecast I will drink a beer on you on the weekend. It should be sunny with -10 degree. :D
So come here to visit me: sunny 12-15 degrees!
 

Reg Moore

unread,
Feb 23, 2018, 1:19:36 AM2/23/18
to measureit

This is real beer weather not just a forecast it's 35.4c and a few days ago it was 41c
 

Thomas

unread,
Feb 23, 2018, 12:55:19 PM2/23/18
to measureit
Nice. From where in Italy are you coming?  :)

Thomas

unread,
Feb 23, 2018, 12:56:56 PM2/23/18
to measureit
And the winner is Reg :) This was a little to hot for me in february.

Sergio Meinardi

unread,
Feb 24, 2018, 6:07:49 AM2/24/18
to measureit


Il giorno venerdì 23 febbraio 2018 18:55:19 UTC+1, Thomas ha scritto:
Nice. From where in Italy are you coming?  :)

Flower riviera, west liguria.

Thomas

unread,
Feb 24, 2018, 11:44:06 AM2/24/18
to measureit

Reg Moore

unread,
Mar 9, 2018, 7:35:02 PM3/9/18
to measureit
Sergio,

I assume your using the "Stretch" Operating system. Are you able to connect to your router via WIFI. I have measureit running using Stretch and can connect to the internet and hence PVoutput via the ethernet  but I do not have the ability to connect via WIFI. The network connection tab shows two red crosses and when I hover the mouse arrow over the Icon it states the DHCPCD has lost its connection. If I remove the network interfaces script as shown in Thomas's "wiki copy and paste" I am able to connect via WIFI but then I have no link to PVoutput.

Reg

Sergio Meinardi

unread,
Mar 11, 2018, 3:01:19 AM3/11/18
to measureit
Reg, 

my Rpi is connected to the router by cable and I assigned it a static address, so I can't help you.

Reply all
Reply to author
Forward
0 new messages