Hi all,
I'm currently working on building a website before I go to uni including data from my weather station.
I have been trying out some PHP bits and bobs including communication with a database recently with great success.
What I want to be able to do is take the data from the realtime.txt and insert it into a database table automatically.
Is it at all possible to do this at regular intervals?
Thanks
Welcome to the Cumulus Support forum.
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)
Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki
If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080
realtime.txt and mysql database
Moderator: daj
-
thomasjhunt
- Posts: 2
- Joined: Sun 19 Sep 2010 11:29 am
- Weather Station: WMR928
- Operating System: Windows 7
- daj
- Posts: 2041
- Joined: Tue 29 Jul 2008 8:00 pm
- Weather Station: WH1081
- Operating System: Pi & MX
- Location: SW Scotland
- Contact:
Re: realtime.txt and mysql database
Hi, and welcome to the forum.
I'm not sure if you are asking if it is possible to read the realtime file or just the automation part. Both are possible, but one is easier than the other!
Have a look at this tool in the wiki. If you can understand the basics of PHP you will see how it reads a file. In this case the dayfile.txt but it's the same idea for realtime.txt
http://wiki.sandaysoft.com/a/ImportCumulusFile
The automation is more complicated. PHP execution is usually triggered by your browser, and run on the server before it sends results to the browser. If you want to read the file automatically, say once per hour, you need to run a "cron job" on your webserver to execute the PHP script However most standard web hosting firms do not allow this.
There is a work around using the Cumulus Toolbox which will have your PC periodically run the PHP script on a webserver, so no need for a cornjob
I'm not sure if you are asking if it is possible to read the realtime file or just the automation part. Both are possible, but one is easier than the other!
Have a look at this tool in the wiki. If you can understand the basics of PHP you will see how it reads a file. In this case the dayfile.txt but it's the same idea for realtime.txt
http://wiki.sandaysoft.com/a/ImportCumulusFile
The automation is more complicated. PHP execution is usually triggered by your browser, and run on the server before it sends results to the browser. If you want to read the file automatically, say once per hour, you need to run a "cron job" on your webserver to execute the PHP script However most standard web hosting firms do not allow this.
There is a work around using the Cumulus Toolbox which will have your PC periodically run the PHP script on a webserver, so no need for a cornjob
-
thomasjhunt
- Posts: 2
- Joined: Sun 19 Sep 2010 11:29 am
- Weather Station: WMR928
- Operating System: Windows 7
Re: realtime.txt and mysql database
daj your a legend!
I'll see how i get on with this and get back to you if I have any issues.
Many thanks.
I'll see how i get on with this and get back to you if I have any issues.
Many thanks.