-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RFC1801.txt
579 lines (338 loc) · 16.7 KB
/
RFC1801.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
***************************************************
GQ-RFC1801
GQ Geiger Counter Communication Protocol
***************************************************
Ver 1.00 Apr-2018
Status of this Memo
This document specifies a GQ GMC Geiger Counter Communication Protocol for the
communication between GQ GMC Geiger Counter and a computer host via serial port, and requests discussion and suggestions for
improvements. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) GQ Electronics LLC (2018). All Rights Reserved.
Abstract
This document defines a GQ GMC Geiger Counter Communication Protocol
to support communication between GMC Geiger Counter and a computer host via serial port. The protocol allows to send data request command from a computer host to a GQ GMC geiger counter.
This document is for GMC-500, GMC-500+, GMC-600, GMC-600+
**************************
Serial Port configuration
**************************
DEFAULT:
Baud: 115200
Data bit: 8
Parity: None
Stop bit: 1
Control: None
The serial port communication baud rate is variable. It should be one of the followings:
1200,2400,4800,9600,14400,19200,28800,38400,57600,115200 BPS. The factory default is 115200 BPS.
**************************
Command format
**************************
A valid command starts with ASCII '<' and ends with ASCII '>>'. Both command and parameters are in between '<' and '>>'.
Command is a ASCII string. All parameters of command are true value in hexadecimal.
Direction: All commands are initiated from computer(HOST).
********************************************************************************************************
Commands
********************************************************************************************************
==============================================================================
1. Get hardware model and version
Command: <GETVER>>
Return: ASCII chars from GQ GMC unit.
e.g.: GMC-600+Re 1.14
"GMC-600+" is the model and "Re 1.14 is the firmware revision
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
2. Get current CPM value
Command: <GETCPM>>
Return: A 32 bit unsigned integer is returned. In total 4 bytes data return from GQ GMC unit. The first byte is MSB byte data and fourth byte is LSB byte data.
e.g.: 00 00 00 1C the returned CPM is 28.
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
3. Turn on the GQ GMC heartbeat
Note: This command enable the GQ GMC unit to send count per second data to host every second AUTOMATICALLY.
Command: <HEARTBEAT1>>
Return: A 32 bit unsigned integer is returned every second automatically. Each data package consist of 4 bytes data from GQ GMC unit. The first byte is MSB byte data and last byte is LSB byte data.
e.g.: 00 00 00 1C the returned 1 second count is 28.
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
4. Turn off the GQ GMC heartbeat
Command: <HEARTBEAT0>>
Return: None (Stops the heartbit from the unit.)
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
5. Get battery voltage status
Command: <GETVOLT>>
Return: 5 bytes in ASCII
e.g. : 3.97v
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
6. Request history data from internal flash memory
Command: <SPIR[A2][A1][A0][L1][L0]>>
A2,A1,A0 are three bytes address data, from MSB to LSB. The L1,L0 are the data length requested. L1 is high byte of 16 bit integer and L0 is low byte.
The length normally not exceed 4096 bytes in each request.
Return: The history data in raw byte array.
Comment: The minimum address is 0, and maximum address value is the size of the flash memory of the GQ GMC Geiger count. Check the user manual for particular model flash size.
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
7. Get configuration data
Command: <GETCFG>>
Return: The configuration data. Total 512 bytes will be returned.
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
8. Erase all configuration data
Command: <ECFG>>
Return: 0xAA
Note: If <GETCFG>> is used after this command, you will get 512 FF bytes
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
9. Write configuration data
Command: <WCFG[A1][A0][D0]>>
A1 is the MSB of the address can only be 0x00 or 0x01
A0 is the MLB can be 0x00 - 0xFF
D0 is the data byte(hex).
Note: Can't write a byte from 0 to 1. Changing a byte from 0 to 1 will require erasing the CFG
So the proper way to use <WCFG>> is to:
First <GETCFG>> to read 512 config bytes, modify the value from the 512 bytes, <ECFG>>, then <<WCFG>> each of the 512 byte to the config.
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
10. send a key
Command: <KEY[D0]>>
D0 is the key value from 0 to 3. It represents software key S1~S4.
Return: none
Note: Each key can be a ASCII string: <KEY0>>,<KEY1>>,<KEY2>>,<KEY3>>,
<KEY3>> Power button or S4
<KEY2>> S3
<KEY1>> S2
<KEY0>> Back button or S1
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
11. get serial number
Command: <GETSERIAL>>
Return: serial number in 7 bytes.
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
12. Power OFF
Command: <POWEROFF>>
Return: none
Note: Turns off the device
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
13. Reload/Update/Refresh Configuration
Command: <CFGUPDATE>>
Return: 0xAA
Note: Usually used after writing to the CFG or after <WCFG>
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
14. Set realtime clock year
command: <SETDATEYY[D0]>>
D0 is the year value in hexdecimal 0x00 is 2000 and 0x12 is 2018
example command: 3c 53 45 54 44 41 54 45 59 59 12 3e 3e
this will change the year to 2018.
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
15. Set realtime clock month
command: <SETDATEMM[D0]>>
D0 is the month value in hexdecimal
0x01 is January
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
16. Set realtime clock day
command: <SETDATEDD[D0]>>
D0 is the day of the month value in hexdecimal
3c 53 45 54 44 41 54 45 44 44 1E 3e 3e
this command will change the day to 30
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
17. Set realtime clock hour
command: <SETTIMEHH[D0]>>
D0 is the hourvalue in hexdecimal
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
18. Set realtime clock minute
command: <SETTIMEMM[D0]>>
D0 is the minute value in hexdecimal
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
19. Set realtime clock second
command: <SETTIMESS[D0]>>
D0 is the second value in hexdecimal
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
20. Reset unit to factory default
command: <FACTORYRESET>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
21. Reboot unit
command: <REBOOT>>
Return: None
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
22. Set year date and time
command: <SETDATETIME[YYMMDDHHMMSS]>>
Note: Combination of the SETDATE commands.
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
23. Get year date and time
command: <GETDATETIME>>
Return: Seven bytes data: YY MM DD HH MM SS 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
24. Get temperature
command: <GETTEMP>>
NOTE: This command is not supported in the current models GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
25. Get gyroscope data
command: <GETGYRO>>
Return: Seven bytes gyroscope data in hexdecimal: BYTE1,BYTE2,BYTE3,BYTE4,BYTE5,BYTE6,BYTE7
Here: BYTE1,BYTE2 are the X position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
BYTE3,BYTE4 are the Y position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
BYTE5,BYTE6 are the Z position data in 16 bits value. The first byte is MSB byte data and second byte is LSB byte data.
BYTE7 always 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
26. Power ON
Command: <POWERON>>
Return: none
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
These following commands are for the wifi and server features.
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
==============================================================================
27, Change the WiFi SSID
Command: <SETSSID[Param]>>
e.g. <SETSSIDwifiowner>> will set the SSID to "wifiowner"
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
28, Change the WiFi password
Command: <SETWIFIPW[Param]>>
e.g. <SETWIFIPWnowifi>> will set the password to "nowifi"
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
29, Change the Website
Command: <SETWEBSITE[Param]>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
30, Change the URL
Command: <SETURL[Param]>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
31, Change the User ID
Command: <SETUSERID[Param]>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
32, Change the Counter ID
Command: <SETCOUNTERID[Param]>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
33, Change the Period
Command: <SETPERIOD[Param in hex]>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
34, Turns on WiFi
Command: <WiFiON>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
35, Turns off WiFi
Command: <WiFiOFF>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
36, AT commands
Command: <AT>>
Return: OK
NOTE: Users can also send <AT+"anyvalidcommands">> to the GMC unit to talk to
the WiFi module.
e.g. <AT+CWLAP>> will list available access points
use reference AT commands for ESP8266
***these commands take a few seconds 1-2 to finish
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
37, Check Wifi signal level
Command: <WiFiLevel>>
Return: the response from the wifi module
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
END OF WIFI COMMANDS
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
==============================================================================
38, Turns on debugging on serial
Command: <EchoON>>
NOTE: This turns on an automatic output to the serial in ascii
e.g. when hovering to the GMC unit menu, it will output the current curser
->Display Mode
or output a popup message to the serial
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
39, Turns off echo
Command: <EchoOFF>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
40, Turns on alarm
Command: <ALARM1>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
41, Turns off alarm
Command: <ALARM0>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
42, Turns on speaker
Command: <SPEAKER1>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
43, Turns off speaker
Command: <SPEAKER0>>
Return: 0xAA
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
44, get the current count per second
Command: <GETCPS>>
NOTE:
Return: 4 bytes cps value in hex
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
45, get the maximum count per second since the device POWERED ON
Command: <GETMAXCPS>>
Return: 4 bytes cps value in hex
Firmware supported: GMC-500, GMC-500+, GMC-600, GMC-600+
==============================================================================
46, get CPM of the high dose tube
Command: <GETCPMH>>
Return: 4 bytes unsigned integer
Firmware supported: ******************GMC-500+
==============================================================================
47, get CPM of the low dose tube
Command: <GETCPML>>
Return: 4 bytes unsigned integer
Firmware supported: *****************GMC-500+,
==============================================================================