diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5d1e908db1bbd010082cbfa980d897c6604b85c5 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# GQ GMC + +This is a web service interface for GQ GMC geiger counters. + +## Installation + +Note this is not yet complete. + +```bash +go get -u gitlab.com/lyda/gqgmc/cmd/gqgmcd +``` + +## Configuring udev + +Copy the `linux/51-gqgmc.rules` file to the `/etc/udev/rules.d` +directory and force the reload of udev rules: + +```bash +sudo cp ./51-gqgmc.rules /etc/udev/rules.d/51-gqgmc.rules sudo +udevadm control --reload-rules +``` + +Disconnect the GQ GMC-300 from the computer and then reconnect. +Verify that there exists a `/dev/gqgmc` in the `/dev` directory +with read/write permission for all users. + +```bash +ls -la /dev/gqgmc +``` diff --git a/README.txt b/README.txt deleted file mode 100644 index 83c5814aaa7968679effb2639b87a6b731f3ce8a..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,70 +0,0 @@ - - - INSTALLATION INSTRUCTIONS - - 1. Download the code from sourceforge into a directory of your choice. - This will be referred to as your root directory. - - 2. The following list of files need to be downloaded. Obtain them from - the gqgmc folder. - - Makefile - Defines.mk - Patterns.mk - Targets.mk - gqgmc.cc - gqgmc.hh - main.cc - main_gui.cc - plotter.hh - plotter.cc - - 51-gqgmc.rules - - 3. Create the following subdirectories of your root directory: - bin - libs - obj - - For example, "mkdir bin", "mkdir libs", "mkdir obj". - - 4. Edit Defines.mk and change the definition of BASE to the - path of your root directory. If you will be compiling for 32-bit - Linux, change the definition of CPUSIZE from "-m64" to "-m32" - in Defines.mk. - - 5. From the command line, you should be able to build the - 'gqgmc_gui' and 'gqgmc' executables which if the build is successful - will be put into bin subdirectory. Try "make all" as the build - command. - - 6a. Copy the 51-gqgmc.rules file to the /etc/udev/rules.d directory and - force the reload of udev rules: - - sudo cp ./51-gqgmc.rules /etc/udev/rules.d/51-gqgmc.rules - sudo udevadm control --reload-rules - - Disconnect the GQ GMC-300 from the computer and then reconnect. - Verify that there exists a /dev/gqgmc in the /dev directory with - read/write permission for all users. - - ls -la /dev/gqgmc - - - 6b. With the GQ geiger counter connected to your PC via USB and turned - on, start either bin/gqgmc or bin/gqgmc_gui from a console command - line. The USB device name must be supplied from the command line, e.g., - - bin/gqgmc /dev/gqgmc - bin/gqgmc_gui /dev/gqgmc - - The code expects the GQ GMC USB device name to be /dev/gqgmc. This - device name was created at step 6a. - - 7. The following is a list of prerequisites for successful compilation: - - a. Ubuntu Linux 11.10, 12.04 or 14.04 - b. GNU g++ 4.6.x or more recent compiler installed - c. Qt4 Software Development Kit (SDK) installed - or Qt Creator installed (required only for GUI) - diff --git a/cmd/gqgmc/main.go b/cmd/gqgmc/main.go index 066974e5741c58045792890cd0047bab0d51600f..b440d91c30bc4eb6993cbb4bcf8f645fd931bc13 100644 --- a/cmd/gqgmc/main.go +++ b/cmd/gqgmc/main.go @@ -43,14 +43,14 @@ func main() { cpm, err = gc.GetCPM() if err != nil { - fmt.Printf("Failed: '%s'\n", err) + fmt.Printf("CPM failed: '%s'\n", err) return } fmt.Printf("CPM: %d\n", cpm) cps, err = gc.GetCPS() if err != nil { - fmt.Printf("Failed: '%s'\n", err) + fmt.Printf("CPS failed: '%s'\n", err) return } fmt.Printf("CPS: %d\n", cps) @@ -60,21 +60,21 @@ func main() { ser, err = gc.SerialNum() if err != nil { - fmt.Printf("Failed: '%s'\n", err) + fmt.Printf("Serial failed: '%s'\n", err) return } fmt.Printf("Serial: %s\n", ser) volts, err = gc.Volts() if err != nil { - fmt.Printf("Failed: '%s'\n", err) + fmt.Printf("Volts failed: '%s'\n", err) return } fmt.Printf("Volts: %d\n", volts) temp, err = gc.GetTemp() if err != nil { - fmt.Printf("Failed: '%s'\n", err) + fmt.Printf("Temp failed: '%s'\n", err) return } fmt.Printf("Temp: %g\n", temp)