Geiger Counter/Radiation Detector (GMC-320) addon

You can find my first attempt at creating a CQ GMC-320 Radiation monitor into homeassistant at GitHub - gi1mic/gmc320: CQ GMC3xx Radiation Monitor addon for homeassistant

The detector should be plugged into HA using a USB lead which provides both power and serial comms to the device. The captured data is published to a MQTT broker.

Installation is by putting the gitgub files to your addon’s directory.

2 Likes

Hi there. Thanks for the effort. I’m trying to use your addon with a GQ GMC-300S but it does not seem to work.
The GMC is conncted to /dev/ttyUSB. Credentials of MQTT are correct. The addon starts with no problem.
Versions:
Home Assistant 2023.2.5
Supervisor 2023.01.1
Operating System 9.5
Frontend-versie: 20230202.0 - latest

23-02-27 17:26:51 INFO (SyncWorker_5) [supervisor.docker.addon] Starting Docker add-on local/amd64-addon-gmc3xx_monitor with version 1.0.0

The addon itself gives me following output:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun gmc320 (no readiness notification)
s6-rc: info: service legacy-services successfully started
[17:26:51] INFO: Starting gmc3xx
[17:26:55] INFO: Device serial number: 0000000
[17:26:55] INFO: Start sending data

The serial number “0000000” does not seem correct to me. The sensor chapter in the MQTT is defined and does not give me errors. Only “CPM” and “Serial” are defined. All values are “0”.

The device itself is set at a fixed baudrate of 115200 when connected to the HA instance (Intel NUC). The device works when connected to a PC but at a baud rate of 57600 but I think thats the limitation of the GQ software.

Do you have an idea why the add on is not receiving data from the device?

Many thanks in advace!

Hello,

Same issue here:
Serial number is 0

Data is inconsistent:
GMC3XX.cpm 0 cpm
GMC3XX.x 49248 x
GMC3XX.y 43337 y
GMC3XX.y 127 z

0 seems to be an integer where we need 0.

Typical values should be:
CPM:15.9 ACPM:15.9 0.10uSv/h

How can we debug serial transmission?

I found the culprit: serial speed is hardcoded to 19200:

XXX remove

Have a problem. Docker don’t running. Debian 12, Docker version 24.0.5. Need help.
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun gmc320 (no readiness notification)
s6-supervise gmc320: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise gmc320 (child): fatal: unable to exec run: Permission denied
s6-supervise gmc320: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise gmc320 (child): fatal: unable to exec run: Permission denied
s6-supervise gmc320: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise gmc320 (child): fatal: unable to exec run: Permission denied

GNU nano 7.2 /usr/share/hassio/addons/local/gmc320/Dockerfile
FROM $BUILD_FROM
COPY rootfs/gmc320.c /usr/src/.
WORKDIR /usr/src
RUN apk update --no-cache
&& apk add gcc
&& apk add libc-dev
&& apk add mosquitto-clients
&& cc gmc320.c -o gmc320
&& cp gmc320 …/bin/.
&& rm -rf /usr/src/*

Copy data

WORKDIR /
#RUN ls -l

COPY rootfs /
#CMD [ “run” ]

Hello!

I picked up a GMC-300 and I know I can successfully read from the unit by using a python script, but I’m having issues with this addon.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun gmc320 (no readiness notification)
s6-supervise gmc320: warning: unable to spawn ./run (waiting 60 seconds): Permission denied
s6-supervise gmc320: warning: unable to spawn ./run (waiting 60 seconds): Permission denied

I’m using /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 as the port. I’ve also tried /dev/ttyUSB0

Originally I had the unit set to 57600 (defaults) and then changed it to 115200, but again no joy. I found another post saying it needed to be 19200, so it’s now set to that, but it’s also not working.

Any ideas?

Did you get this working?

Do you think is possible to use also a GQ EMF-390 in HA?