NEQTO Docs
  • Languages iconEnglish
    • 日本語
  • Docs
  • API
  • FAQ

›UART

Getting Started

  • NEQTO Hello World!
  • Tutorial Step 1. NEQTO Console Setting
  • Tutorial Step 2. Device Settings & Launching Service (NEQTO Bridge)
  • Tutorial Step 2. Device Settings & Launching Service (STM32 Discovery)
  • Tutorial Step 2. Device Settings & Launching Service (SPRESENSE)
  • Tutorial Step 3. Application development using scripts

NEQTO

  • NEQTO Account Registration
  • Sub-accounts
  • API Usage
  • NEQTO Engine Firmware List
  • Support Guidelines
  • For safe and secure use of the NEQTO products
  • Vulnerability Disclosure Policy

NEQTO Console

  • Introduction
  • Fundamentals
  • Administrative Actions
  • Device Management
  • Linux-based Device Management
  • Batch Registration
  • Scripts
  • Actions and Contacts
  • View Data from the Console
  • NEQTO Apps

    • About NEQTO Apps
    • NEQTO Infinitypool
    • NEQTO Insights
    • NEQTO Custodia
    • NEQTO Flow
  • Machine Driver
  • Recommended Browsers
  • Billing Information

SPRESENSE

    Hardware Specifications

    • 01. About Spresense

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. Spresense Wi-Fi Initial Setup
    • 04. Spresense LTE-M Initial Setup
    • 05. Debug Log Acquisition
    • 06. System LED Indications
    • 07. Event Messages
    • 08. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. GPIO
    • 12. UART
    • 13. SPI
    • 14. I2C
    • 15. ADC
    • 16. GNSS
    • 17. Camera
    • 18. Utils
    • 19. nqSpresense
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte

STM32 Discovery

    Hardware Specifications

    • 01. About STM32 Discovery Kit (B-L4S5I-IOT01A)

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. STM32 Discovery Wi-Fi Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 18. Utils
    • 19. nqDiscovery
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi

NEQTO Bridge

    Hardware Specifications

    • 01. NEQTO Bridge Module
    • 02. NEQTO Bridge Wi-Fi Module
    • 03. NEQTO Bridge LTE-1 Module
    • 04. NEQTO Bridge LTE-M/NB Module
    • 05. NEQTO Bridge IO Board
    • 06. NEQTO Bridge Digital IO Board
    • 07. NEQTO Bridge Connector Board

    Software Specifications

    • 01. Operational Flow
    • 02. NEQTO Bridge Wi-Fi Module Initial Setup
    • 03. NEQTO Bridge LTE Module Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 17. BLE
    • 18. Utils
    • 19. nqBridge
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte
    • 25. nqLAN
    • 26. nqEx

Linux-based device

    Software Specifications

    • 01. System Requirements
    • 02. Installation
    • 03. Software Configurations
    • 04. Operational Flow
    • 05. Debug Log Acquisition
    • 06. Event Messages
    • 07. Updating Software

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. RTC
    • 10. UNIXSocket
    • 11. FileSystem
    • 12. SubProcess
    • 13. SubTask
    • 14. Queue
    • 15. Utils
    • 16. nqLinux
    • 17. nqService
    • 18. nqMqtt
    • 19. nqFOTA
    • 20. nqLAN

neqto.js Libraries

  • About neqto.js Libraries
  • UART

    • GM65 Barcode Reader
    • SRF Ultrasonic Range Finder - Serial Mode

    I2C

    • HTS221 v2 Temperature and Humidity Sensor
    • LIS2DW12 v2 Accelerometer
    • SRF Ultrasonic Range Finder - I2C Mode
    • [Archive] HTS221 Temperature and Humidity Sensor
    • [Archive] LIS2DW12 Accelerometer

    Utils

    • RTC Alarm Synchronized Scheduler

    Integration

    • AWS S3 v2
    • AWS IoT Core v2
    • Azure IoT v2
    • [Archive] GCP IoT Core
    • [Archive] AWS S3
    • [Archive] AWS IoT Core

neqto.js Snippets

  • About neqto.js Snippets
  • DataDog
  • Dropbox
  • Google Sheets
  • InfluxDB
  • Oracle Cloud Object Storage
  • Salesforce
  • Splunk
  • Niagara
  • [Archive] SAP Cloud Platform Internet of Things

Release Notes

  • NEQTO Console Updates
  • NEQTO Firmware (Bridge Wi-Fi/LTE Module) Releases
  • NEQTO Firmware (STM32 Discovery Wi-Fi) Releases
  • NEQTO Firmware (Spresense Wi-Fi/LTE-M) Releases
  • NEQTO Engine for Linux Releases
  • neqto.js Libraries Releases

GM65 Barcode Reader

This library is a built-in class that provides functions to control the Hangzhou Grow Technology GM65 barcode reader.

Library usage requirements
Type UART
Name GM65
Version 1_00_00
Code size used 9.9KB
Resources used UART × 1, Timer × 1

Related Documents

  • GM65 Bar Code Reader Module User Manual (Obtain the user manual from the vendor where it was purchased)

Pre-initialization

When using the GM65 barcode reader for the first time, the barcode reader must be factory-initialized once as the settings stored in the barcode reader are unknown. In addition, the baudrate of the UART interface must be set in advance.

Please follow the steps below to proceed with the initialization.
The separate User Manual is required.

1. Allow the use of the QR code for setup

Refer to User Manual - Setup Code and scan the QR code for Setup code on.

2. Perform factory reset

Refer to User Manual - Reset and scan the QR code for Reset.
It will take some time to initialize. Please wait until the buzzer sounds.

3. Configure the baudrate of the UART interface

Refer to User Manual - Series Communication Interface and scan the QR code for the baudrate to be used from the Baud Rate Settlement options.



Abstracts

Methods()/PropertiesSummaryNote
new GM65()Creates a GM65 instance.

{GM65} Instance

Methods()/PropertiesSummaryNote
.init()Initializes the barcode reader.
.onScanned()Registers the event handler for scan result notification.
.getScanned()Uses the scan execution command to get the scan results.
.VERSIONVersion information
maj : {number} Main Version
min : {number} Minor Version
rev : {number} Revision



Details

new GM65(uart[,config])

Creates a GM65 instance.

NameTypeM/ODescriptionNote                              
uart{UART}mandatorySpecify a UART instance that has been opened in advance.
The UART settings should be the same baudrate set during pre-initialization, hardware flow disabled, and parity mode disabled.
configObjectoptionalConfigurations
For details, refer to config.
return{GM65}-{GM65} : Generated {GM65}When an error occurs, an exception is raised.

config

NameTypeM/ODescriptionNote
READ_MODEnumberoptionalRead Mode
0: Manual mode
1: Command Triggered Mode
2: Continuous mode
3: Induction Mode
The default value is 3.
For more information, refer to the User Manual - Read Mode.
LIGHTnumberoptionalHead lamp setting
0: Always OFF
1: ON when reading
2: Always ON
The default value is 1.
COLLIMATIONnumberoptionalPointing light beam setting
0: Always OFF
1: ON when reading
2: Always ON
The default value is 1.
READ_TIMEnumberoptionalRead time [x0.1s]
Range: 0 - 255(25.5s)
The default value is 50.
This is used when READ_MODE is 1, 2, or 3.
BREAK_TIMEnumberoptionalBreak time [x0.1s]
Range: 0 - 255(25.5s)
The default value is 10.
This is used when READ_MODE is 2, or 3.
STABLE_TIMEnumberoptionalImage stabilization time [x0.1s]
Range: 0 - 255(25.5s)
The default value is 4.
This is used when READ_MODE is 3.
BUZZER_TONEnumberoptionalBuzzer tone
Range: 0 - 255
The default value is 100.
BUZZER_MSnumberoptionalBuzzer duration time [ms]
Range: 0 - 255
The default value is 60.
SCAN_BUZZERnumberoptionalScanning success sound
0: OFF
1: ON
The default value is 1.
EANArrayoptionalReading enable/disable setting (EAN)
Array[0]: Setting value for Zone bit 0x002E
Array[1]: Setting value for Zone bit 0x002F
Allow: [0x01,0x01]
Forbid: [0x00,0x00]
The default value is Forbid.
*
UPCArrayoptionalReading enable/disable setting (UPC)
Array[0]: Setting value for Zone bit 0x0030
Array[1]: Setting value for Zone bit 0x0031
Array[2]: Setting value for Zone bit 0x0032
Allow: [0x01,0x01,0x01]
Forbid: [0x00,0x00,0x00]
The default value is Forbid.
*
CODE128ArrayoptionalReading enable/disable setting (CODE128)
Array[0]: Setting value for Zone bit 0x0033
Array[1]: Setting value for Zone bit 0x0034
Array[2]: Setting value for Zone bit 0x0035
Allow: [0x01,0x04,0x40]
Forbid: [0x00,0x04,0x40]
The default value is Forbid.
*
CODE39ArrayoptionalReading enable/disable setting (CODE39)
Array[0]: Setting value for Zone bit 0x0036
Array[1]: Setting value for Zone bit 0x0037
Array[2]: Setting value for Zone bit 0x0038
Allow: [0x01,0x04,0x40]
Forbid: [0x00,0x04,0x40]
The default value is Forbid.
*
CODE93ArrayoptionalReading enable/disable setting (CODE93)
Array[0]: Setting value for Zone bit 0x0039
Array[1]: Setting value for Zone bit 0x003A
Array[2]: Setting value for Zone bit 0x003B
Allow: [0x05,0x04,0x40]
Forbid: [0x04,0x04,0x40]
The default value is Forbid.
*
CODEBARArrayoptionalReading enable/disable setting (CODEBAR)
Array[0]: Setting value for Zone bit 0x003C
Array[1]: Setting value for Zone bit 0x003D
Array[2]: Setting value for Zone bit 0x003E
Allow: [0x03,0x04,0x40]
Forbid: [0x02,0x04,0x40]
The default value is Forbid.
*
QRArrayoptionalReading enable/disable setting (QR)
Array[0]: Setting value for Zone bit 0x003F
Allow: [0x01]
Forbid: [0x00]
The default value is Forbid.
*
ITFArrayoptionalReading enable/disable setting (ITF)
Array[0]: Setting value for Zone bit 0x0040
Array[1]: Setting value for Zone bit 0x0041
Array[2]: Setting value for Zone bit 0x0042
Array[3]: Setting value for Zone bit 0x0043
Array[4]: Setting value for Zone bit 0x0044
Array[5]: Setting value for Zone bit 0x0045
Array[6]: Setting value for Zone bit 0x0046
Array[7]: Setting value for Zone bit 0x0047
Array[8]: Setting value for Zone bit 0x0048
Allow: [0x01,0x04,0x40,0x01,0x04,0x40,0x01,0x04,0x40]
Forbid: [0x00,0x04,0x40,0x00,0x04,0x40,0x00,0x04,0x40]
The default value is Forbid.
*
CODE11ArrayoptionalReading enable/disable setting (CODE11)
Array[0]: Setting value for Zone bit 0x0049
Array[1]: Setting value for Zone bit 0x004A
Array[2]: Setting value for Zone bit 0x004B
Allow: [0x01,0x04,0x40]
Forbid: [0x00,0x04,0x40]
The default value is Forbid.
*
MSIArrayoptionalReading enable/disable setting (MSI)
Array[0]: Setting value for Zone bit 0x004C
Array[1]: Setting value for Zone bit 0x004D
Array[2]: Setting value for Zone bit 0x004E
Allow: [0x05,0x01,0x40]
Forbid: [0x04,0x01,0x40]
The default value is Forbid.
*
RSSArrayoptionalReading enable/disable setting (RSS)
Array[0]: Setting value for Zone bit 0x004F
Array[1]: Setting value for Zone bit 0x0050
Array[2]: Setting value for Zone bit 0x0051
Array[3]: Setting value for Zone bit 0x0052
Array[4]: Setting value for Zone bit 0x0053
Allow: [0x01,0x01,0x01,0x04,0x40]
Forbid: [0x00,0x00,0x00,0x04,0x40]
The default value is Forbid.
*
MATRIXArrayoptionalReading enable/disable setting (Data Matrix)
Array[0]: Setting value for Zone bit 0x0054
Allow: [0x01]
Forbid: [0x00]
The default value is Forbid.
*
PDF417ArrayoptionalReading enable/disable setting (PDF417)
Array[0]: Setting value for Zone bit 0x0055
Allow: [0x01]
Forbid: [0x00]
The default value is Forbid.
*
BARCODE_FILTERregexpoptionalString filter for scanned data
regexp: The RegExp object
Verifies the scanned data using regular expressions, and discards the data in the case of a mismatch.
For example, to allow only numeric barcodes, specify /^[0-9]+$/.
If omitted or if the scan data is in binary format, no verification is performed.
SCAN_LIMITnumberoptionalMaximum scan data size [byte]
Range: 1 - 510
The default value is 256.
Discards the data when the scanned data exceeds the specified size.
errEvent(code)functionoptionalExecutes a callback process when an error event occurs.
code : {number}
Error code
For details, refer to List of error codes.
  • *: The setting value of the Zone bit is a number type from 0 to 255. For detailed specifications of each Zone bit, refer to User Manual - List of zone bit.

List of error codes

codeDescription                                                              Note
-1Barcode reader command timeout
-2Barcode reader command response error
-3Scan data error
-4Scan data overflowIf the maximum scan data size specified by SCAN_LIMIT in config is exceeded

.init()

Initializes the barcode reader.
Only execute it once after creating an instance.

NameTypeM/ODescriptionNote
returnboolean-true: Success
false: Failure
In the case of failure, try pre-initialization.

.onScanned(callback[,isBin])

Registers the event handler for scan result notification.
Note that registration cannot be unregistered.

This method cannot be used if READ_MODE is 1.

NameTypeM/ODescription                      Note
callback(data)functionmandatoryExecutes a callback process when barcode reading is completed.
data : {ArrayBuffer|string}
Scanned data
The type of the argument is determined by isBin.
isBinbooleanoptionalSpecifies the output format of the scan data.
true: Binary data format
false: String format
The default value is false.
Only ASCII code is supported for scan data.
returnboolean-true: Success
false: Failure

.getScanned([isBin])

Uses the scan execution command to get the scan results.

This method is available only when READ_MODE is 1.

NameTypeM/ODescription                          Note
isBinbooleanoptionalSpecifies the output format of the scan data.
true: Binary data format
false: String format
The default value is false.
Only ASCII code is supported for scan data.
returnArrayBuffer,
string,
null,
undefined
-Scanned data
The return type is determined by isBin.
If the read time specified by READ_TIME in config is exceeded, null will be returned.
If READ_MODE is not 1, undefined is returned.



Usage Examples

Sample 1

This is a sample for scanning using Induction Mode (READ_MODE: 3).
Acquires only QR Code and 16-digit alphanumeric uppercase scanned data.

log.setLevel(0,2); //-1:NONE 0:ERROR 1:WARNING 2:DEBUG 3:TRACE, 0:DISABLE 1:LOG 2:CONSOLE 3:BOTH
log.printLevel(2); //0:DISABLE 1:LOG 2:CONSOLE 3:BOTH

if(!('GM65' in this)) { throw new Error('Please import the GM65 library.'); }

//Specify the UART connection settings for the GM65 barcode reader.
var uart = new UART(1); //UART node number
var ready = uart.open(115200, false, 0); //UART baudrate
if(!ready) {
    throw new Error('uart.open');
}
var config = {
    READ_MODE: 3, //Induction Mode
    QR: [0x01], //Allow QR Code
    BARCODE_FILTER: /^[0-9A-Z]{16}$/, //A 16-digit string consisting of "0" to "9" and "A" to "Z"
    errEvent: function(code) { print('error:' + code); }
};
var gm65 = new GM65(uart, config);
ready = gm65.init();
if(!ready) {
    throw new Error('gm65.init');
}

var scanCb = function(data) {
    print('scan:', data);
};

if(!gm65.onScanned(scanCb)) {
    throw new Error('gm65.onScanned');
}

Sample 2

This is a sample for scanning using Command Triggered Mode (READ_MODE: 1).
Acquires only QR Code and 16-digit alphanumeric uppercase scanned data.

log.setLevel(0,2); //-1:NONE 0:ERROR 1:WARNING 2:DEBUG 3:TRACE, 0:DISABLE 1:LOG 2:CONSOLE 3:BOTH
log.printLevel(2); //0:DISABLE 1:LOG 2:CONSOLE 3:BOTH

if(!('GM65' in this)) { throw new Error('Please import the GM65 library.'); }

//Specify the UART connection settings for the GM65 barcode reader.
var uart = new UART(1); //UART node number
var ready = uart.open(115200, false, 0); //UART baudrate
if(!ready) {
    throw new Error('uart.open');
}
var config = {
    READ_MODE: 1, //Command Triggered Mode
    QR: [0x01], //Allow QR Code
    BARCODE_FILTER: /^[0-9A-Z]{16}$/, //A 16-digit string consisting of "0" to "9" and "A" to "Z"
    errEvent: function(code) { print('error:' + code); }
};
var gm65 = new GM65(uart, config);
ready = gm65.init();
if(!ready) {
    throw new Error('gm65.init');
}

var scanCb = function(data) {
    print('scan:', data);
};

while(1) {
    var c = gm65.getScanned();
    if(c) {
        scanCb(c);
    }
    setTimeout(1000).wait();
}


The company names and product names mentioned above are registered trademarks or trademarks of their respective companies.

Updated: 2021-10-19
← About neqto.js LibrariesSRF Ultrasonic Range Finder - Serial Mode →
  • Abstracts
    • {GM65} Instance
  • Details
    • new GM65(uart[,config])
    • .init()
    • .onScanned(callback[,isBin])
    • .getScanned([isBin])
  • Usage Examples
    • Sample 1
    • Sample 2
AboutNewsProductsFAQPrivacy PolicyVulnerability Disclosure Policy
NEQTO Console
IntroductionFundamentalsAdministrative ActionsDevice Management NEQTO Apps
NEQTO Bridge
NEQTO Bridge ModuleNEQTO Bridge Wi-Fi ModuleNEQTO Bridge LTE-1 ModuleError Logging Event Messages
API Documentation
API UsageGlobal APIRegional APIAPI Terms of Service
Jigsaw, Inc.
© 2025 JIG-SAW INC.