Transfer data using MQTT protocol#

Note

Only applicable to scanners that support Wi-Fi transmission, such as DS2800.

Set up the MQTT broker server#

  • Use a server to host an MQTT broker; barcode data uploaded by the scanner is forwarded through the server.

Demo software#

EMQX open-source download: EMQX

Test service#

https://cdn.scandocs.net/scanner/manual/global/_shared/_images/wireless-wifi/wifi-emqx.png

MQTT Broker test service example#

Note

Server connection information

  • Host: mqtt.handy.pub

  • Port:1883

  • Username: netum

  • Password: netum@2022

For testing only. Do not use in production.

Configure scanner#

Configure Wi-Fi and Broker#

Note

  • The scanner uses port 1883 by default to connect to the MQTT Broker.

  • The default topic content for scanner subscriptions is device ID.

Modify MQTT connection port#

Modify scanner publishing topic#

Modify scanner subscription topic#

Receive data#

  • Use MQTT client software MQTTX to connect to the Broker server and subscribe to the topic where the scanner publishes messages.

https://cdn.scandocs.net/scanner/manual/global/_shared/_images/wireless-wifi/wifi-mqttx.png

MQTTX subscription example#

Development reference#