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
 Send data to Synology / Jeedom
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gyam

5 Posts

Posted - 03/04/2022 :  05:54:30  Show Profile  Reply with Quote
Dear all,

I've got a GMC-320 + V5 log in wifi and i'm wondering if I can send the data (eg every 1 min) to my jeedom domotic system.
Or if I can process the data to a php file on my local website.

Thx for help,

Guilhem

Edited by - gyam on 03/04/2022 05:55:39
Reply #1

ullix

Germany
1171 Posts

Posted - 03/04/2022 :  08:56:43  Show Profile  Reply with Quote
Yes, you can, using my latest GeigerLog 1.3.0.

It is not easy, but since you mentioned PHP, I am sure your can do it. In the GeigerLog manual read the chapter "WiFi Devices managed by GeigerLog"

GeigerLog is here: https://sourceforge.net/projects/geigerlog/

Go to Top of Page
Reply #2

gyam

5 Posts

Posted - 03/05/2022 :  10:39:13  Show Profile  Reply with Quote
Thx, I will check that :D
Go to Top of Page
Reply #3

gyam

5 Posts

Posted - 03/05/2022 :  14:33:20  Show Profile  Reply with Quote
@ullix:
A great job, but I got so many errors along the install process on my synology (DSM7)... And so much dependencies to install.
Is there a way to get just the data frame, or to send it? Then I can process it trough a small php script.

Or I can use USB connection with my jeedom system to read it? Jeedom work on a dedicated Debian.

Edited by - gyam on 03/05/2022 14:41:16
Go to Top of Page
Reply #4

ullix

Germany
1171 Posts

Posted - 03/06/2022 :  01:38:56  Show Profile  Reply with Quote
If your NAS is able to install Python3 in a version 3.6 or later, it should work. What dependencies are you referring to? The Python modules? This is really easy to handle. Look into chapter installation of the GeigerLog manual.

Sure you can reduce the software to serve only your needs. Do you want a USB connection or a WiFi connection?

For USB it is also easy: Download geigerlog_simple.py from my site https://sourceforge.net/projects/geigerlog/files/ and take a look. I believe you can open the USB-serial connection with php command dio_open()?

There are 2 more *simple* versions, which address the need of a GMC500. You don't need this for a 300 series counter.

For using WiFi it becomes quite a bit more complicated. But part of the problem is created by GQ, and you need to make a workaround. I think it is easier to install all of GeigerLog than create this "simpler" approach.

But, thinking about your php skills: isn't the php code on GeigerLog manual page 77 not already what you need? Just understand the redirection problem and the need to make your apache server "unsafe".

On my apache server I have in its docroot a file index.php, which produces this output into file WIFICLIENT.demo, sitting in the GeigerLog program directory:
Date : 2022-03-06 10:25:03
From : 10.0.0.42:34168
To   : 10.0.0.20:80
Query:   AID=123&GID=456&CPM=18&ACPM=23.29&uSV=0.12
R-URI: /?AID=123&GID=456&CPM=18&ACPM=23.29&uSV=0.12
Forward_URI:  h**p://10.0.0.20:8000/GMC/?AID=01460&GID=18898497959&CPM=18&ACPM=23.29&uSV=0.12
ERR0 OK for GMC Device
There are your counter values CPM, ACPM, uSv.

The file is this:
<?php
// Bug-fixing workaround for a GMC counter as a WiFiClient device
// by forwarding the original request arriving on "unsafe" Apache
// server to the GeigerLog' internal web server using CURL

// Error messages printout to browser:
// to include syntax and parse errors in printout it is also
// required to set in php.ini file:    display_errors = on
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

function saveToFile($text){
    global $file, $allow_saving_to_file;
    if ($allow_saving_to_file) file_put_contents($file, $text . "\n", FILE_APPEND);
}


$debug = FALSE;
// To record web traffic to a file set this variable to TRUE
$allow_saving_to_file = TRUE;
// And make sure this file exists with write permission for your computer's Web Server!
$file  = '/home/ullix/geigerlog/geigerlog/WIFICLIENT.demo';

// QUERY_STRING     =   'AID=0123&GID=4567&CPM=28&ACPM=37.38&uSV=0.18'
// REQUEST_URI      = '/?AID=0123&GID=4567&CPM=28&ACPM=37.38&uSV=0.18'
saveToFile("Date : " . date("Y-m-d H:i:s"));
saveToFile("From : " . $_SERVER['REMOTE_ADDR'] . ":" . $_SERVER['REMOTE_PORT']);
saveToFile("To   : " . $_SERVER['SERVER_ADDR'] . ":" . $_SERVER['SERVER_PORT']);
saveToFile("Query:   " . $_SERVER['QUERY_STRING']);
saveToFile("R-URI: " . $_SERVER['REQUEST_URI']);

# write full _SERVER to file (use only for debugging)
if ($debug){
    saveToFile("Full _SERVER :");
    foreach ($_SERVER as $parm => $value){
        saveToFile(sprintf("    %-30s = '%s'", $parm, $value));
    }
}

// if root is called do NOT forward; instead
// send server signature and return
if ($_SERVER['REQUEST_URI'] == "/"){
    echo $_SERVER['SERVER_SIGNATURE'];
    return;
}


$myIP          = "10.0.0.20";   // Set your Forward-to IP
$myFwPort      = "8000";        // Set your Forward-to Port
$myDevice      = "GMC";         // Special setting for GMC counter
$GeigerLog_URI = "h**p://" . $myIP . ":" . $myFwPort . "/" . $myDevice . $_SERVER['REQUEST_URI'];
saveToFile("Forward_URI:  " . $GeigerLog_URI);

// setup curl
$ch = curl_init($GeigerLog_URI);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);

saveToFile($response);
echo $response;         // send back to GMC counter
saveToFile("");
?>


Adapt to your needs.

Note that this forum requires to write 'h**p' instead of xxx, well, that what can't be written ;-)

Go to Top of Page
Reply #5

gyam

5 Posts

Posted - 03/07/2022 :  14:46:45  Show Profile  Reply with Quote
In fact, I cannot install the PyQt5 dependencies. Seems to be an error from a pip subprocessus:

pip subprocess to install build dependencies did not run successfully.
#9474; exit code: 1
#9584;#9472;> [124 lines of output]
Collecting sip<7,>=6.4
Using cached sip-6.5.1.tar.gz (1.2 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting PyQt-builder<2,>=1.9
Using cached PyQt_builder-1.12.2-py3-none-any.whl (5.6 MB)
Collecting packaging
Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting setuptools
Using cached setuptools-60.9.3-py3-none-any.whl (1.1 MB)
Collecting toml
Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
Using cached pyparsing-3.0.7-py3-none-any.whl (98 kB)
Building wheels for collected packages: sip
Building wheel for sip (pyproject.toml): started
Building wheel for sip (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

I will tried to solve that
Go to Top of Page
Reply #6

ullix

Germany
1171 Posts

Posted - 03/07/2022 :  23:27:59  Show Profile  Reply with Quote
Some Linux distributions made the unfortunate choice of integrating various Python dependencies into their setup, which then couldn't be modified by pip. Raspi is an example.

Verify that this is NOT the case on your NAS. Look for anything *sip* in the package Manager. Install it there, then retry Python.

If this can be solved in this way I would like to take it into the GeigerLog manual. Therefore please be specific on any result, thanks.
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.06 sec. Snitz's Forums 2000