WI-FI Wireless or Ethernet Barcode Scanner Solution

1.Introduction

Wireless or Ethernet access control will be more and more popular in the future. Most traditional barcode scanners or NFC card readers do not have wireless or Ethernet features. So RTscan developed a kit board that can convert a common USB barcode scanner or NFC reader into a Wi-Fi barcode scanner/Ethernet barcode scanner or Bluetooth barcode scanner.

The barcode scanner is connected to RT001 via a USB cable, and RT001 is connected to the router via WIFI or Ethernet (or connected to table/cell phone terminals via Bluetooth). And then transfer to read data to the MQTT topic via remote MQTT server by the Internet.

Technically, the RT001 can enable all types of barcode scanners whose interface is USB-CDC (USB virtual Com) to be a Wi-fi, Bluetooth, or Ethernet barcode scanner. So you can use a scanner module, a fixed mount scanner, or a handheld scanner, you can consult RTscan’s sales team to get proper scanners for your projects.

This article takes the RT870 fixed mount / embedded barcode scanner as an example and introduces how to use the RT870 barcode scanner together with RT001 to upload barcode-decoded data via Wi-fi or Ethernet (MQTT server).

Connection diagram

2.Hardware preparation

 

  1. RT870 Barcode Scanner
  2. RT001 WIFI/Ethernet kit
  3. 5V power supply, it can be a mobile phone charger or other DC 5V power supply

 

3.Hardware connection

1.RT870 connects to RT001 via USB cable

2.RT001 connects to the router via network cable or WIFI

3.Connect the power supply to RT001

 

4.Software prepare

1. RT001 configuration software:

RTSCAN Config ToolV1.2

Later, we can scan the configuration code generated by RTSCAN Config ToolV1.2 to set RT001 parameters.

2. MQTT server

Here we use a public MQTT server (MQTT Public Brokers), you can fill in your own MQTT server address port and other parameter information as needed.

Here we use the broker.hivemq.com server, the official website is http://www.mqtt-dashboard.com/, the MQTT TCP port is 1883, and the MQTT WebSocket port is 8000

Its server requirements are as follows:

  • The server address is: broker.hivemq.com
  • Port: 1883
  • No username and password required
  • Custom client id
  • Free subscription to publish topics

According to this rule, the parameters we fill in are:

  • Address: broker.hivemq.com
  • Port: 1883
  • ClientID: Generate random id
  • Username: (NULL) leave it blank
  • UserPSW: (NULL) Leave it blank without filling in
  • Publish: /rtscan/rt870/pubtopic can be customized
  • Subscribe: /rtscan/rt870/subscribe can be customized

 

5.Scanner settings

You need to set the RT870 scanner to USB-CDC output: from the user manual, scan the USB-CDC setting code will be ok.

If you need others setting, please use RT870 to scan the corresponding settings codes from the RT870 user manual.

6.RT001 terminal parameter setting

RT001 provides a variety of connection methods. Here we use WIFI connection routing to establish an MQTT connection with broker.hivemq.com:

  1. Output mode is WIFI or Ethernet

Or

2.When setting to Wi-Fi mode, you need to configure wireless router SSID and password

The encryption method is WPA2, no password, WIFI PSW does not fill in the content

For WIFI connection, fill in your Wi-Fi name (SSID) and password

3. In IP mode, it is recommended to obtain IP dynamically, and the router will assign IP. When set to static IP, three parameters need to be set correctly

OR

Here we use the dynamic acquisition of IP

  1. NET Mode is set to MQTT mode

4. Enter the relevant parameters required by the MQTT server, address port client publish-subscribe option is required, Username, the user password is optional.

  • Address: broker.hivemq.com
  • Port: 1883
  • ClientID: Generate random id
  • Username: (NULL) leave it blank
  • UserPSW: (NULL) Leave it blank without filling in
  • Publish: /rtscan/rt870/pubtopic can be customized
  • Subscribe: /rtscan/rt870/subscribe can be customized

5. Generate setting code

6. Use the device to scan the QR setting code to complete the configuration

Connect the scanner to RT001, scan the generated QR code, RT001 completes the configuration after receiving the configuration data sent by the scanner, and the device automatically connects to the set MQTT broker

7.Transparently transmit the scan code information to the MQTT server

Scan any barcode, the device uploads the barcode data to the set publishing topic and controls the device to upload data to the subject of the device subscription.

 

7.Receive data released by the device

After the device is set up, it will automatically connect to the MQTT server, subscribe to the set topic, and upload messages to the set topic.

To receive the scanned code data uploaded by RT001, we need to connect to the same MQTT Broker as RT001. The user can receive the scan code content uploaded by RT001 by subscribing to the topic published by RT001. When a command is sent to the scanner, the user publishes a message to RT001 subscription After receiving the data, RT001 transparently transmits it to the scanner.

MQTT test tool recommends online and PC software, such as:

Online tools http://api.easylink.io/tools/mqtt/

Pc software Mqtt. fx http://mqttfx.jensd.de/

(1).Easylink

Easylink uses MQTT Websocket to connect to MQTT broker, the MQTT Websocket port of broker.hivemq.com is 8000

After connection, Subscribe to the topic published by the device

Publish messages to topics subscribed by the device

The device scans the 2d code, and the subscribed topic receives the data sent by the device

 

(2).Mqttfx

MQTT FX uses MQTT TCP to connect to MQTT broker, the MQTT TCP port of “broker.hivemq.com” is 1883

Subscribe to the topic published by the device after connection /rtscan/rt870/pubtopic

The device scans the 2d code, and the subscribed topic receives the data sent by the device

Publish the message to the topic subscribed by the device: /rtscan/rt870/subscribe

 

8.Important tip

You need to set the barcode scanner to USB-CDC output first to successfully communicate with RT001

This article only introduces ethernet and Wi-Fi connection, for Bluetooth,  or for any questions, please consult our sales engineer at sales@rtscan.net or support team support@rtscan.net.

Thanks!

10212 View