Cashless Device - Remote Product Selection with MDB 4.3
Introduction
Since the introduction of MDB specification 4.3, some machines allow connected Cashless Devices to select a product on the vending machine, meaning that it becomes now possible to select and dispense a product without actually touching the vending machine. This tutorial will describe how to identify if the connected vending machine is capable of accepting the remote product selection, and how to do the remote selection using Qibixx' API and its Cashless Device functionality.
Throughout this tutorial, please consider a Qibixx Device to be either any flavour of the MDB-USB , or the MDB Pi Hat Plus
Checking if the Machine supports Remote Product selection
To understand if the vending machine supports this feature, we will make use of the Sniffer capabilities of the Qibixx Devices. It is necessary to:
- Enable the Sniffer functionality
- Enable Cashless Device functionality
- Analyse the options enabled by the vending machine (or the feature level)
To perform the previous analysis, it is necessary to issue the following commands on the Qibixx Device:
X,1
C,1
Once the machine is on, the setup information will be displayed: Please check the comments after "#"
x,ACK
c,STATUS,INACTIVE
c,1
d,STATUS,RESET
c,STATUS,INACTIVE
x,00,0014317966,10,
x,80,0014318024,ACK
x,00,0014319058,12,
x,80,0014319116,00
r,ACK
x,00,0014319142,ACK
c,STATUS,DISABLED
x,00,0014320154,11,0003000000 #1 VMC sends setup information
x,80,0014320278,0103175601021e08
r,ACK
x,00,0014320392,ACK
x,00,0014321250,11,01ffff0000
x,80,0014321370,ACK
x,00,0014322346,17,005142584d444220496e7465726663653030303030303030303030303130 # VMC sends Expansion request
d,STATUS,INIT,1
x,80,0014322782,09514258333430313336333133393330514942495858204d44423033382300000060
r,ACK
x,00,0014323222,ACK
x,00,0014323438,17,0400000060 # VMC enables expansion options
x,80,0014323560,ACK
Let's focus on the responses highlighted above:
- Setup info: x,00,0014320154,11,0003000000 : If the setup info request does not show "03" in this byte (other possible values are 01 or 02), it means that the VMC is not feature level 3, and thus will not support remote product selection.
- Optional feature enable : x,00,0014323438,17,040000006 0 :On the last byte, if the bit 6 is not set to "1", then the machine is not capable of doing remote product selection. The bit order on this byte is LSBit to the right (count starts with bit 0), meaning that the binary code of the example above is "0110 0000" , which means that this VMC does support Remote product selection (and also always idle).
The information above is to help get you started, but we advise the readers to check section 7 of MDB 4.3 specification for further details.
Selecting a product on the Vending Machine
To make a remote product selection, the following steps need to be taken:
- Enable Cashless Device by sending the command below
C,1
- Wait for the device to be enabled by the vending machine:
c,STATUS,ENABLED
- Make the remote product selection using the following command:
C,SEL,<Funds>,<PaymentID>,<ProductID>
Example:
C,SEL,1.00,FFFFFFFF,2 <!--Payment ID can be any number from 00000000 to FFFFFFFF, where FFFFFFFF means unknown payment ID-->
- Once the vending machine confirms the selection, it will request the MDB Device to confirm payment, and the following message will be displayed:
c,STATUS,VEND,<amount>,<product_id>
Example:
c,STATUS,VEND,1.00,2
- To approve the requested value, please issue the following command:
C,VEND,<amount>
Example:
C,VEND,1.00
- Now the machine will dispense the product and the following messages will be received:
c,VEND,SUCCESS
c,STATUS,IDLE
c,STATUS,ENABLED
- If by any reason the product is not dispensed correctly, the message received in the MDB Device will be as follows:
c,ERR,VEND 3
c,STATUS,IDLE
c,STATUS,ENABLED
That's it, we hope to have made things clearer for you now. If there is any other tutorial you would like us to cover, or fix anything about this one, please reach out to us at contact@qiba.pt .