Cashless VMC - Dispense a Product in Always Idle Mode
This tutorial will explain how to make a Cashless Vend in Always Idle Mode using Qibixx Devices.
Throughout this tutorial, please consider a Qibixx Device to be either any flavour of the MDB-USB , or the MDB Pi Hat Plus.
Although this tutorial is called "Dispense a Product" please note that only the Payment sequence will be described here, the actual dispensing is not performed in MDB and is thus out of scope.
To perform a Cashless Vend in Always Idle, follow these steps:
- Enable Cashless VMC (Always Idle Master) on the MDB Device by issuing the following command:
D,2
- Wait for the Cashless Reader to reply to the MDB Device. When it replies, the following message will be shown:
d,STATUS,INIT,1
- Enable the Cashless Reader by issuing the following command (enabling means telling the reader that the VMC is ready to accept payments):
D,READER,1
- Once the reader is enabled, the following message will be received on the console:
d,STATUS,IDLE
- Here, on a full vending machine, a product would be selected, making the Controller send a Vend request with the price and product ID to the MDB. To send a vend request to the MDB Bus, use the following command:
D,REQ,<price>,<prod_id>
Example:
D,REQ,1.20,10
- In this step, the user should swipe/present the Credit Card to the reader, and once accepted, the following message will be received in the serial console:
d,STATUS,RESULT,<result>,<price>
Examples:
d,STATUS,RESULT,1,1.20
If the reader does not accept the Vend Request, or the user cancels the transaction, the following message will be received, instead of the above:
d,STATUS,RESULT,-1
- After the product has been dispensed, confirm the transaction to the reader by sending the following command:
D,END
If for some reason, it was not possible to dispense the product, it is possible to revert the transaction by sending the following command:
D,END,-1
Once the reader is ready to accept new transactions, the Idle message will be received again:
d,STATUS,IDLE
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 .