Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

ExtraLog*.txt to mysql and then to webpage

Talk about anything that doesn't fit elsewhere - PLEASE don't put Cumulus queries in here!
Snicker
Posts: 19
Joined: Tue Jan 07, 2014 2:54 pm
Weather Station: WMR100N
Operating System: Win2012R2
Location: Norway
Contact:

ExtraLog*.txt to mysql and then to webpage

Postby Snicker » Thu Apr 06, 2017 1:45 pm

Hi,

A friend made me a php script that takes out the data from the ExtraLog*.txt file and inserts it into mysql server, and then make a graph out of the SQL data with PHP. Anyone good at PHP that can help me put this up again on another site?

It is a cronjob.php that runs every 10 min automaticly,
and the index.php that shows the graph.
Where there's pleasure... there's always some pain!
-Snicker-

Snicker
Posts: 19
Joined: Tue Jan 07, 2014 2:54 pm
Weather Station: WMR100N
Operating System: Win2012R2
Location: Norway
Contact:

Re: ExtraLog*.txt to mysql and then to webpage

Postby Snicker » Fri Apr 07, 2017 3:23 pm

Here is the link to the php script reading the log file and putting the data into the SQL.

https://pastebin.com/Smy4BS1m

Getting this error when I try to run the php.

Notice: Undefined variable: wdato in D:\wamp64\www\temp\cronjob.php on line 81
Where there's pleasure... there's always some pain!
-Snicker-

Snicker
Posts: 19
Joined: Tue Jan 07, 2014 2:54 pm
Weather Station: WMR100N
Operating System: Win2012R2
Location: Norway
Contact:

Re: ExtraLog*.txt to mysql and then to webpage

Postby Snicker » Fri Apr 07, 2017 4:52 pm

Found out,

Had to create a new structure like this on the SQL:

https://www.dropbox.com/s/s1zb17z2b1dwp ... e.PNG?dl=0

And then insert a new fictive one for the script to check. Then it worked.
Where there's pleasure... there's always some pain!
-Snicker-

hruska07
Posts: 4
Joined: Fri Aug 11, 2017 3:33 pm
Weather Station: Davis VP2
Operating System: Windows 10

Re: ExtraLog*.txt to mysql and then to webpage

Postby hruska07 » Fri Aug 11, 2017 3:40 pm

Hello, i have problem to import Cummulusfile to MySQL database. It caused an error about connection to the database server....Any idea? I would be glad.
You do not have the required permissions to view the files attached to this post.


Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests