Page 1 of 2
Installation and configuration on Raspberry Pi 3
Posted: Sun Nov 19, 2017 10:13 pm
by pdurand
I have the raspberry pi with the latest update and upgrade.
I have installed and configured successfully apache2, mariadb (mysql), php.
I launch successfuly setup.php
The 3 server tests are successful.
I have created a weather database with user pi
I can connect to mysql successfuly with user pi
When I test the mysql connection I get this error:
This page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
anybody have ideas of what I am missing?
Re: Installation and configuration on Raspberry Pi 3
Posted: Sun Nov 19, 2017 10:15 pm
by Jachym
Try adding this at the end of the url:
?errors
If it does not help then the only possible way of diagnosing the problem is looking in the error log
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 1:15 am
by pdurand
I have modified the error reporting levels in /etc/php/7.0/apache2/php.ini
by modifying display_errors=On (it was off)
I then looked at the apache2 error.log file in /var/log/apache2
The error logged is the following:
[Sat Nov 18 15:29:22.054817 2017] [:error] [pid 17380] [client ::1:53924] PHP Notice: Undefined variable: lang in /var/www/html/template/install/setup.php on line 1292
Not sure as to what to do to ensure the $lang variable is set when running setup.php
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 1:19 am
by pdurand
two more errors are found in the error.log:
[Sun Nov 19 18:03:30.457437 2017] [:error] [pid 5691] [client ::1:41200] PHP Notice: Undefined variable: firstWeekday in /var/www/html/template/install/setup.php on line 2129
[Sun Nov 19 18:03:30.457627 2017] [:error] [pid 5691] [client ::1:41200] PHP Notice: Undefined variable: firstWeekday in /var/www/html/template/install/setup.php on line 2130
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 2:19 am
by pdurand
added ?errors at the end of the URL and am getting the same error page.
The error log only displays what I listed above....
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 4:34 am
by pdurand
PROBLEM SOLVED:
I was missing the package php-mysql
the error 500 was caused my a missing mysqli_connect() function included in the additional package php-mysql
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 7:08 pm
by pdurand
After a successful installation of the necessary packages and mysql setup,
I ran successfully the setup.php script.
the table was created and I have got a confirmation: Config created/updated.
I checked the existance of the alldata table and its fields.
I did not upload any data in the table.
Not I attempt launching the template by entering this URL:
http://localhost/template/index.php which changes to:
http://localhost/template/indexDesktop.php
and I get a totally blank page (white background).
the only visible change is the appearance of Meteotemplate on the web page Tab.
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 7:53 pm
by pdurand
checked the error.log file and found these notices when trying to launch the meteotemplate:
[Mon Nov 20 12:03:31.323121 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: customStation in /var/www/html/template/install/createConfig.php on line 97, referer:
http://localhost/template/install/s
etup.php
[Mon Nov 20 12:03:31.323800 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: bannerID in /var/www/html/template/install/createConfig.php on line 246, referer:
http://localhost/template/install/setup
.php
[Mon Nov 20 12:03:31.324106 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: alertActive in /var/www/html/template/install/createConfig.php on line 426, referer:
http://localhost/template/install/se
tup.php
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 8:32 pm
by Jachym
pdurand wrote: ↑Mon Nov 20, 2017 7:53 pm
checked the error.log file and found these notices when trying to launch the meteotemplate:
[Mon Nov 20 12:03:31.323121 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: customStation in /var/www/html/template/install/createConfig.php on line 97, referer:
http://localhost/template/install/s
etup.php
[Mon Nov 20 12:03:31.323800 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: bannerID in /var/www/html/template/install/createConfig.php on line 246, referer:
http://localhost/template/install/setup
.php
[Mon Nov 20 12:03:31.324106 2017] [:error] [pid 7087] [client ::1:60656] PHP Notice: Undefined index: alertActive in /var/www/html/template/install/createConfig.php on line 426, referer:
http://localhost/template/install/se
tup.php
Hi,
these are not errors, but notices, they are ok, this is not the problem.
Try this:
go to your homepage and change it as shown below and see if it tells you the error:
....indexDesktop.php?errors
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 9:09 pm
by pdurand
I get this when I add ?errors
Warning: file_put_contents(homepage/css/theme.txt): failed to open stream: Permission denied in /var/www/html/template/homepage/css/themeSetter.php on line 24
Warning: file_put_contents(cache/version.txt): failed to open stream: Permission denied in /var/www/html/template/homepage/css/themeSetter.php on line 30
Fatal error: Uncaught Error: Call to undefined function utf8_encode() in /var/www/html/template/scripts/functions.php:37 Stack trace: #0 /var/www/html/template/header.php(68): lang('in the last', 'l') #1 /var/www/html/template/indexDesktop.php(83): include('/var/www/html/t...') #2 {main} thrown in /var/www/html/template/scripts/functions.php on line 37
Re: Installation and configuration on Raspberry Pi 3
Posted: Mon Nov 20, 2017 10:05 pm
by pdurand
did some research and the utf8_encode() and utf8_decode() have been removed from the initial releases of PHP 7.0 versions.
I understand that they are back in from version 7.2..
I installed php7.0-xml as I unserstand that the above functions are included.
I was able to start the template page and access the admin control page.
I am pursuing the installation and configuration.
thanks to Jachym for the guidance....
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 12:47 am
by Jachym
Hi,
very strange, I used 7.0, then updated to 7.1 and never had any issues, but who knows

Glad you solved it.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:18 pm
by pdurand
I have downloaded some blocks and have done a test layout setup.
There is only one data record for now.
I have attached two screenCaptures; one generated on the local computer where mysql an meteotemplate is defined.
the other from a remote computer trying to load the meteotemplate web page.
The remote site does not see any icons or blocks properly.
What am I missing?
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:22 pm
by Jachym
Hi,
I cannot help you unless you give me a link. Screenshots are usually only informative - I can say "yes, it doesnt work"
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:25 pm
by pdurand
try:
pierre.does-it.net
no www. before the link above.
pierre
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:26 pm
by pdurand
I should of entered it correctly:
http://pierre.does-it.net
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:29 pm
by Jachym
Hi,
the problem is that you cannot simply copy the template from one location to another. The paths are now different in the Main setup, its not localhost etc.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:31 pm
by Fraggboy
Pierre,
I was able to pull up your page. It's pretty slow.. I think I know what's going on..
Under the main setup file, do you have the paths setup correctly?
Leave the Path as default:
/
The Page URL should be:
http://pierre.does-it.net/template/
Scroll to the bottom and save it. The links that does load is pointing to localhost, which I will not have access to. After the change, you will access your page from the link above, and not via localhost.
EDIT: Jachym just beat me to it.

Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:40 pm
by pdurand
Got it.
Thank you very much...
I corrected the entries is the setup.php and all works fine now.
http://pierre.does-it.net
BTW I am not copying the template from one computer to another, I am simply running it from a remote computer.
It is slow because it is running on a raspberry pi 3.
Once I have understood all the intricacies of Meteotemplare, I will dediate a server remote to the weather station to display the info.
I will have multiple weather stations (my own design, electronics and all) throughout America.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 10:56 pm
by Fraggboy
Actually, it's loading quicker now since it's not timing out. I am intrigued in your weather stations you are designing. Care to share more information about them?
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 11:10 pm
by pdurand
I would be glad to.
I use a Arduino like microcontroller with various sensors (Temp, Humidity, LightLevel, Inside temp, wind speed, wind direction, rain gauge and webcam.
The microcontroller is connected to a raspberry Pi 3 that is able to update the firmware on the Arduino (or Teensy)
The Raspberry Pi has MySQL, PHP, Apache2.
The microcontroller will send data to the rPi at a high rate and from there the Meteotemplate will be updated.
I am able to remotely connect to each weather station from my home to monitor
These weather station can run at any location that's has no power or landline internet connections.
I can run them on 12V batteries that are charged by solar or local power if available.
the Internet is accessed via a cellular broadband modem using LTE preferably.
If LTE is not available the data will be sent to a land station and from there the Meteotemplate will run.
These stations are mainly used by Radio Control Flying Clubs at their flying fields where most of them have no power or internet.
The weather station is valuable to club RC pilots that live far away so that they dont travel long distances if conditions are nor suitable to their flying abilities.
The webcam is also able to tell them who is at the field and flying.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 11:31 pm
by Fraggboy
That is a very cool project you are working on! Have you thought about using the Raspberry Pi Zero to even decrease the power load? I know the Pi 3 is very efficient already..
What solar radiation shield do you plan on using? I know some work very well, while others don't which affect the readings.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 11:39 pm
by pdurand
The main controllers (Arduino and rPi are inside club houses or Seacans)
I only use solar radiation shields for outside sensors (Temp, Hum....)
This weather station is a work in progress as I need to adapt it to various sites and resources.
It is not meant to be high precision NASA type data, but practical for local club members and their guests when they have pilots coming from around the country to participate in Fun Flys and Scale and IMAC competitions.
I do try to get the best equipment possible whith affordable prices.
Re: Installation and configuration on Raspberry Pi 3
Posted: Tue Nov 21, 2017 11:40 pm
by pdurand
BTW,
love your site Froggboy....
Re: Installation and configuration on Raspberry Pi 3
Posted: Wed Nov 22, 2017 6:46 pm
by pdurand
Yesterday I ended the day with excitement having made so much progress with installation of the template.
This morning I resume the work and launch the template.
I go into admin mode and run Setup.php to review the settings...
I test the connection to mysql with the provided button and to my surprise I get this error:
Error: Unable to connect to MySQL.
Debugging error number: 2002
Debugging error: php_network_getaddresses: getaddrinfo failed: Name or service not known
What happened overnight?
I am searching the web but I get long winded forum streams....