GQ Electronics Technical Support Forum Active Users: / Visits Today:
Highest Active Users:
GQ Electronics Technical Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GQ Electronics Forums
 2.GQ Geiger Muller Counter
 New PHP Graphs for logger pro on your website
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jokeraces

USA
24 Posts

Posted - 07/07/2012 :  07:15:39  Show Profile  Reply with Quote
Hi everyone,
After many hours of work i am please to announce the first release of a GQ Charts package. These Charts are made for websites that have PHP. These Charts were developed with a freeware program available on the web called PChart2. I wish the share the php code with those that would like to post their Geiger counter readings on their websites. The PHP code that i present here is custom made for use with the current version of GQ Geiger Muller Counter Data Logger 5.22+ pro. These charts will update automatically along with some other neat stuff, please read on.

As an example this is a working 24 hour Averages chart:


The entire package i present here can be viewed online by clicking on the following links:
The Above Chart: www.racers.net/radiation/pub_minmax24.php
The Code: www.racers.net/radiation/pub_minmax24.php.txt

24 hr line Chart: www.racers.net/radiation/pub_line24.php
The Code: www.racers.net/radiation/pub_line24.php.txt

24 hr Bar Chart: www.racers.net/radiation/pub_bar24.php
The Code: www.racers.net/radiation/pub_bar24.php.txt

60 min Min/Max/scriptvg: www.racers.net/radiation/pub_minmax60.php
The Code: www.racers.net/radiation/pub_minmax60.php.txt

60 min Line Chart: www.racers.net/radiation/pub_line60.php
The Code: www.racers.net/radiation/pub_line60.php.txt

60 min Bar Chart: www.racers.net/radiation/pub_bar60.php
The Code: www.racers.net/radiation/pub_bar60.php.txt

You can save the above code to file if you wish but you must edit these files a little, and you must have either download my package or the PChart development package to use. Links found below.

So not to infringe on pcharts copyrights and gpl the pChart library is released under two different licenses. And i quote:
quote:
If your application is not a commercial one (eg: you make no money by redistributing it) then the GNU GPLv3 license (General Public License) applies. This license allows you to freely integrate this library in your applications, modify the code and redistribute it in bundled packages as long as your application is also distributed with the GPL license.

If your application can't meet the GPL license or is a commercial one (eg: the library is integrated in a software or an appliance you're selling) then you'll have to buy a commercial license. With this license you don't need to make publicly available your application code under the GPL license terms. Commercial license price are depending of your needs :



With that said i have made a bundled package available for free with all modules, sub-directorys, and files necessary to create your own working group of PHP graphs for your website. You can unpack these files anywhere on your webserver as long as your keeping all directories intact. There are the 6 charts above, the 60 min line chart, 60 min bar chart, 60 min Averages w/highs/ lows, 24 hr line chart, 24 hr bar chart, 24 hr Averages/highs/lows. All Charts Update Automatically. At the bottom this post you will find links to these chart packages or the PCharts full development package for those advanced users if you wish, but if your site is limited in data space you will not want this entire pchart package on your website. The PChart development package is very large and has many things you will never use. I make no ownership of this package but i will clam some ownership to the modified code, i want nothing for them, these are all free. I can only offer limited support for the bundle but all in all this package is very easy to set up and use on your website. You Will have to edit some of the settings to match your site, this can be done with a simple .txt editor. Read on:

What you will need are the following:

1. The latest version of the GQ Logger Pro software (v5.22 at this time)
2. A website that allows PHP. There are some great tools to see if your site will support PHP. If your site does not allow the use of PHP then you are out of luck with this package. A simple test would be something like this in a file <?php phpinfo(); ?> Here is a test tool. Save it and test on your server. www.racers.net/radiation/testphp.php.txt

Your settings on the logger will need to be set in the area of "Auto save settings", "file type = CSV" , "Fixed file name (testing)", "Auto Save period 0=hr 1=min, 0=sec" Save your data file as "testing.csv"., can be any name you like as long as the php file path matches. If you use the auto FTP function and not just saved locally then set the FTP functions to 0=hr 1=min 0=sec. You may need to increase the 1=min setting to 2 or 3 perhaps for a slow upload connection.

Settings in the php files i provide that will need editing.

Line 7 of the php code:
$data_file_path = 'testing.csv';
This must match your fixed file name in the data logger software.

Around Line 154 or 174 or so, depending on the chart you are editing:
$myPicture->drawText(350,33,"60 min chart - Update every 1 min - Last Update: $time",$TextSettings);
you can change the text in this code to your liking anywhere between the "Text" quoted area. you can change position of the text by changing the first to sets of numbers ie: 350,33.

And the last thing is your path to the files. This includes the Class files, fonts, and the above CSV file paths. Depending on your server software, Whether Apache, IIS, or whatever, this path might have to look like this:
$data_file_path = 'radiation.csv';

or it may have to look like this:
$data_file_path = './radiation.csv';

Same with the class files, their paths may need to look like this:
include("../class/pImage.class.php");

../ means up one directory
./ means same directory

My server needs neither as you see in the code.

Lastly, you will also need to set the Fonts directories too.
Watch closely here. These paths are easy to overlook and miss, Missing one path anywhere in this code will cause the php script to fail.
$myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>14));

Thats about all there is to it. I hope you Enjoy these script. These script represent many hours of work in testing by myself and changes that have been made by the author of the the GQ Data logger to accommodate these script.
If anyone wishes to modify the php script feel free to do so. Please offering your own setups and works which are much appreciated and welcomed.
Feel free to comment if you wish. Cheers!

Complete package of GQ PHP Charts: www.racers.net/radiation/gq-phpcharts1.0.zip

PChart Website: www.pchart.net/
PChart Development Download: www.pchart.net/download

note: This system is a GQ GMC-300 digital Geiger Counter mounted outside on a sidewall about 6 inches above a lower roof. I have a custom copper rain/snow/weather shield mounted over the top exposing just the lower 1/3 of the gmc-300. If you would like to see a picture of this please ask.

Give those people air!

Edited by - jokeraces on 07/07/2012 08:29:13
Reply #1

ZLM

1261 Posts

Posted - 07/11/2012 :  07:48:37  Show Profile  Reply with Quote
Good job!
Go to Top of Page
Reply #2

Nuclear-Spud

Australia
8 Posts

Posted - 08/28/2012 :  04:49:25  Show Profile  Reply with Quote
Hi all,
Hi,
Recently I purchased "GQ Geiger Counter Data Logger V5.22", I am having a couple of problems, I am trying to set up and get working the "GQ Geiger Counter Data Logger web server PHP by Bob Holmes"
Great job there "Jokeracers" thanks for the free code and your time in developing it.

I believe I have managed to get all the Web side of things up and running ok.
Problem I am having is that when I start transfering my file (radiation.csv) to my web site the file appears to be in reverse order to the demo file from www.racers.net/radiation/radiation.csv.
I have tried using the option in the software for File Type CSV & Reversed, which creates me two files, radiation.csv and radiation_R.csv, the second file is of the right format I think it has one additional line at the bottom with date and seconds 1-60, but this is not uploaded as part of the FTP option of "Geiger Counter Data Logger"
The radiation.csv trends ok from right to left but the time does not update and after 60 minutes no more data is displayed, is this to do with the settings in the charts or will I need a seperate application to FTP up the radiation_R.csv file.
once I get this working I will post details of all my settings to help others get things going.
Thanks

Nuclear-Spud
Go to Top of Page
Reply #3

jokeraces

USA
24 Posts

Posted - 09/01/2012 :  09:11:07  Show Profile  Reply with Quote
quote:
Originally posted by Nuclear-Spud

Hi all,
Hi,
Recently I purchased "GQ Geiger Counter Data Logger V5.22", I am having a couple of problems, I am trying to set up and get working the "GQ Geiger Counter Data Logger web server PHP by Bob Holmes"
Great job there "Jokeracers" thanks for the free code and your time in developing it.

I believe I have managed to get all the Web side of things up and running ok.
Problem I am having is that when I start transfering my file (radiation.csv) to my web site the file appears to be in reverse order to the demo file from www.racers.net/radiation/radiation.csv.
I have tried using the option in the software for File Type CSV & Reversed, which creates me two files, radiation.csv and radiation_R.csv, the second file is of the right format I think it has one additional line at the bottom with date and seconds 1-60, but this is not uploaded as part of the FTP option of "Geiger Counter Data Logger"
The radiation.csv trends ok from right to left but the time does not update and after 60 minutes no more data is displayed, is this to do with the settings in the charts or will I need a seperate application to FTP up the radiation_R.csv file.
once I get this working I will post details of all my settings to help others get things going.
Thanks



Hi Nuclear-Spud
Not sure what the problem would be as i do things a little differently because of development. If your looking to see a data file from racers.net use the testing.csv file, not my radiation.csv file. I think John may have to look to see if the FTP function of 5.22 is uploading the reversed file correctly. Like i was saying, i am doing things a little differently and here is why.
I run the program local so i do not have to do any FTP uploading. I also use a batch file to process and do not use a reverse order function, the batch file takes care of this. Here is an example of my batch file that is run every 1 minute with a timer like "task scheduler". I also have my setting checked to "restart counter" and save "hour=0 minute=1 seconds=0"

call file something like log.bat:

@echo off
More +2 rad.csv >stripped.csv
copy /b stripped.csv+radiation.csv almost.csv
del radiation.csv
ren almost.csv radiation.csv
del testing.csv
copy /b header.txt+radiation.csv testing.csv
exit


A smaller version for everyone here might look something like:

@echo off
More +2 rad.csv >stripped.csv
copy /b header.txt+stripped.csv+radiation.csv almost.csv
del radiation.csv
ren almost.csv radiation.csv
exit


"rad.csv" (or rad) is the geiger muller file name that the program produces, set this as filename in the program or change it in the bat file. The first bat file shown is creating two files. one for the public use (testing.csv) and one for my use (radiation.csv) in development. testing.csv is the public file. The php code will have to match to use my file. I would be happy to share that code if you wish but really it is the same less the (see www.racers.net/radiation/header.txt) header.txt file. There is not much difference in the final result. What is hampering was the development of the history function i was developing. This is something i was working on but i went back to work full time and have no time to further develop this.

So i will share this part too if someone wishes to help in development.
This is a batch file that is run every night, it saves to a sub directory called "data" and cleans up the mess. It is run once a day at midnight. You also must have the unix file "head" to use.

Call file something like Dabackup.bat:

@echo off

head -1440 radiation.csv > passed.csv

move D:\WebSite\pathto\Radiation\radiation.csv D:\WebSite\pathto\Radiation\data\%date:~10,4%-%date:~4,2%-%date:~7,2%-%date:~0,3%.csv

Copy /b D:\WebSite\pathto\Radiation\passed.csv D:\WebSite\pathto\Radiation\radiation.csv

del passed.csv

exit


There can be a short clean up version of the file above but the whole thing was creating problems, namely it would erase the entire file and start over. Never got past this point. Needs further development.

Anyway last but not least here is a link to the history development file. It will not function yet but this was the plan. Again if any of you php coders out there wish to offer further development i would be happy to show you the code i have so far. Cheers and good luck all.

Bob

www.racers.net/radiation/lookup.php

Give those people air!

Edited by - jokeraces on 09/01/2012 09:30:08
Go to Top of Page
Reply #4

jokeraces

USA
24 Posts

Posted - 09/01/2012 :  09:28:18  Show Profile  Reply with Quote
Hey Nuclear-Spud
After thinking more about the above, please show me a link to your "reversed" data file (.csv).. I can make changes to fix this.
Thanks,
Bob

Give those people air!
Go to Top of Page
Reply #5

Nuclear-Spud

Australia
8 Posts

Posted - 09/04/2012 :  06:59:49  Show Profile  Reply with Quote
Hi Bob,
Thanks for the reply, I have finally found a few minutes to get back behind the keyboard.
OK I am having a little more success I have my weather station software uploading the radiation_R.csv file for me as this was not being uploaded, as you can see from my web site www.desertprojects.com/radiation/radiation.html I have two links to charts working with the reverse data file uploaded by my weather station software and this seems to be working ok, also there is a link to the csv files that are being used both have the same name!. the other links are using the normal file FTP'd by "Geiger Counter Data Logger V5.22".
I have not selected the reset counter option as this will only give me values taken between each upload eg 10 mins, 10 data points then start over.
It would be nice if the data logger software had an option to archive off to a file every 24 hrs and this file have as part of it's name the day of the year or date, this may make life easy for the lookup.php charts also.
I like the batch files have been doing some reading up on them, something else to lear, I noticed they can FTP files up also, if only I had all day to play with this stuff.
Thanks for your help,

Nuclear-Spud
Go to Top of Page
Reply #6

jokeraces

USA
24 Posts

Posted - 09/09/2012 :  13:41:52  Show Profile  Reply with Quote
quote:
Originally posted by Nuclear-Spud

Hi Bob,
Thanks for the reply, I have finally found a few minutes to get back behind the keyboard.
OK I am having a little more success I have my weather station software uploading the radiation_R.csv file for me as this was not being uploaded, as you can see from my web site www.desertprojects.com/radiation/radiation.html I have two links to charts working with the reverse data file uploaded by my weather station software and this seems to be working ok, also there is a link to the csv files that are being used both have the same name!. the other links are using the normal file FTP'd by "Geiger Counter Data Logger V5.22".
I have not selected the reset counter option as this will only give me values taken between each upload eg 10 mins, 10 data points then start over.
It would be nice if the data logger software had an option to archive off to a file every 24 hrs and this file have as part of it's name the day of the year or date, this may make life easy for the lookup.php charts also.
I like the batch files have been doing some reading up on them, something else to lear, I noticed they can FTP files up also, if only I had all day to play with this stuff.
Thanks for your help,




Hi Spud.. :)

my keyboard on my laptop is broken so i will keep it short. using on screen kb and it`s a real pain to type. looks like something is wrong as the graphs should display right to left in their time frame. yours are showing left to right. then also i see your csv file "radiation-#.csv" is in Japanese. i dont think that will work. i agree john needs to do a little more work here but it my be possible to overcome these issues.

i will look into some of this once i get my kb fixed but can i ask did you change some of the php code that is causing the left to right issues?

here is a good link to automating your uploads, might be what your looking for:
nixcraft.com/windows-xp-2000-2003-server-administration/12018-windows-ftp-upload-script-scheduled-job.html
regards ,,
Bob

Give those people air!
Go to Top of Page
Reply #7

Nuclear-Spud

Australia
8 Posts

Posted - 09/21/2012 :  21:14:17  Show Profile  Reply with Quote
Hi Bob,
Back again playing around after spending some time on other projects.
I have updated the graphs on my web site to use the _R.CSV file from Geiger Data Logger, at this stage I am using an option on my weather stations software to FTP up the files to my site as I am unable to get the settings to stay in the Logger software.
I am not sure what happened with the data file and it being in Japanese, it is a .CSV not data or text, the links have been updated for the file again www.desertprojects.com/weather/radiationr.csv if you would like to have another look
I am running my Geiger Counter off battery at this time, I have destroyed one unit caused by a switchmode power supply problem between laptop and Geiger Counter, something else to sort out.
I have data on my web site most of the time between software problems and flat batteries, check it out now on the link from my previous post.
Thanks
Jason

Nuclear-Spud
Go to Top of Page
Reply #8

jokeraces

USA
24 Posts

Posted - 10/06/2012 :  18:18:27  Show Profile  Reply with Quote
Jason,
I have sent a message to the author of the data logger to make changes.
This should fix some issues.
Bob

Give those people air!
Go to Top of Page
Reply #9

ZLM

1261 Posts

Posted - 10/08/2012 :  08:15:00  Show Profile  Reply with Quote
There is a V5.23 data logger software ready for testing:

http://www.gqelectronicsllc.com/download/GQGMCProSetup5.23.exe


It should fix the followings:
1.double count problem in total count.
2.removed bottom note line in reversed .csv file.
3.added reversed .csv file type into FTP setting.

The setting saving issues is under testing. Not included in this version.
Go to Top of Page
Reply #10

Nuclear-Spud

Australia
8 Posts

Posted - 10/11/2012 :  04:34:13  Show Profile  Reply with Quote
Thanks ZLM,
I will give it a go in the next week or so, work keeps getting in the way of my hobbies. If you need any more information on the saving issue let me know and I will try to help.
Thanks
Jason

Nuclear-Spud
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GQ Electronics Technical Support Forum © Copyright since 2011 Go To Top Of Page
Generated in 0.09 sec. Snitz's Forums 2000