- RASPIVEND = Raspberry PI vending board (shield).
- RASPIVEND DAEMON - xinetd based RASPIVEND management daemon.
- MDB PERIPHERALS = payment systems connected on the MDB bus.
- CCTALK PERIPHERALS = payment systems and peripherals, connectod to ccTalk bus.
- HOST APPLICATION = the application executed by the xinetd superserver installed on
the Raspberry PI
- CLIENT APLICATION = the client application that will connect to the socket of the HOST
APPLICATION
- LOW LEVEL APPLICATION = the application that can directly communicate using
Raspberry PI serial port (/dev/ttyAMA0) and also can handle it's GPIO pins.
- ACK = acknowledge
- NACK = not-acknowledge
RASPIVEND board and RASPIVEND daemon, toghether with VTLCOMBUS keyboard
simulator module, can be used to upgrade any Necta hot and universal machines and alos
any Wurlitzer universal spring machine.
2. Working modes
The RASPIVEND can be used to communicate with peripherals using two methods:
a. A low level communication method that can offer access to all peripherals by the
Raspberry PI serial port (/dev/ttyAMA0) and using 3 of it's GPIO to handle the multiplexers
to select the proper communication channel.
b. A high level communication method that simplifies the user interface development,
offering a language independent support.
A. Low level mode
In low level mode, there are simple commands to manage the MDB devices. The built-in
firmware will handle MDB commands and it is the ideal mode where the developers don't
need to learn any MDB command and response. Also there is no need to calculate the
MDB checksum since this is automatically calculated by the RASPIVEND and correctly
sent to the MDB peripheral. When the RASPIVEND will receive a low level command, it
automatically turn low level mode ON and begin to continuously poll the MDB
PERIPHERALS.
In this mode, there is no limit accessing any other peripheral and the LOW LEVEL
APPLICATION (created by the user) has the entire responsibility of multiplexer controls pin
manipulation by using the appropriate GPIO. The only channel that is automatically
selected is the MDB channel, which is selected every time a MDB low level command is
sent to the board (see page 9 for pin usage).
A proprietary simple message structure is available to communicate with bill validators,
coin acceptors/changers and cashless devices. The general message format is detailed in
table 1.
This mode is using a xinetd driven application that can use a socket to communicate.
For the moment, there are some limitations, depending on the level mode, but we are
constantly work to add more and more functions on the high level mode too, because this
mode can be used with less or no complications, even with a browser based application.
Below you can find a table with a level modes comparison:
always 0xFE1 byte1 bytevariable length, depending on subcommand1 byte
Table 2: Low level message format
- <HEADER> – Is always a byte with a value of 0xFE.
- <CMD> - Defines the command group sent to the RASPIVend.
- <SUBCMD> - Defines the specific subcommand of the command group.
- <PARAMETERS> - Defines the command parameters that will be send to the MDB
peripheral (for example, the maximum credit that the INTERFACE should accept or the
change it should return from changer). Some commands are not requiring parameters.
Also, the variable length depends on subcommand.
- <CRC> - Defines the message checksum. The <CRC> is calculated as an XOR of all
message bytes, including the <HEADER>. For example, the command to enabled the bill
validator is: 0xFE 0x42 0x02 and the CRC for this command is 0xBE. Transparent mode
can be used for any application.
2. Communication parameters
The communication settings should meet the following specifications:
a. For the peripherals (excepting the MDB bus), there is no restriction regarding the serial
port settings you need.
b. For then MDB communication parameters:
The RASPIVEND can be powered with stabilized 24VDC or 12VDC, depending on your
MDB PERIPHERALS and CCTALK Peripherals. You must use a stabilized DC power
supply with at least 2A output. It is necessary to follow the correct polarity. In the
eventuality of an accidental polarity reversal, the entire board, the MDB PERIPHERALS
and the CCTALK PERIPHERALS are protected, but will not work. The board also supplies
the 5V/2A for Raspberry PI (or compatible). The system eliminates the separate 5V
microUSB power supply for Raspberry PI. You will only need one power supply for the
entire system.
2. Connector description
- <J17> – POWER connector for the RASPIVEND and MDB PERIPHERALS. Use only
stabilized power supplies, with a voltage rating according to your MDB PERIPHERALS.
Also, be careful at the current rating, since this may vary from one MDB peripheral to
another. Use your MDB peripheral manual to identify the power needs.
- <J10> - RS232 connector. General purpose RS232 serial port, with no hardware flow
wires.
- <J11> - RS232 connector. General purpose RS232 serial port, with no hardware flow
- <ccTalk> - Used to connect he CCTALK PERIPHERALS.
- <J12> - VTLCOMBUS. This is a proprietary protocol that can be used to expand the
board with any needed boards (I/O ans sensr boards, etc.). For the moment there is one
single board available for this device and it's function is to simulate keyboard press for
Necta hot and spring machines and for Wurlitzer universal spring machines.
- <J15> - Communication port. For the moment there is one device available for this port
and it is a GPRS communication module based on SIMCOM M2M block.
- <J1> - 40 pins Raspberry PI (or compatible) single board computer connector. This
connector provides access to POWER, GPIO and serial port. This connector, also supplies
the power for Raspberry PI. Used pins and functions can be find in the table below. Pins
marked by green background are available for user applications and alos, the power and
GND pins. Pins marked with red background are reserved for RASPIVEND.
Pin
No.
Rpi functionRASPIVENDPin
No.
Rpi functionRASPIVEND
13.3V3.3V25V5V
3GPIO2/SDA1/I2CMODEM DCD45V5V
5GPIO3/SCL1/I2CMODEM RTS6GNDGND
7GPIO4/GPCLK0MODEM PWR8GPIO14/TXDSerial TX
9GNDGND10GPIO15/RXDSerial RX
11GPIO17MUX A12GPIO18/PCM_CLKModem stat
13GPIO27MUX B14GNDGND
15GPIO22MUX C16GPIO23Not used
173.3V3.3V18GPIO24Not used
19GPIO10/MOSI/SPINot used20GNDGND
21GPIO9/MISO/SPINot used22GPIO25Not used
23GPIO11/SCLK/SPINot used24GPIO8/CE0/SPINot used
25GNDGND26GPIO7/CE1/SPINot used
27SDA0/I2C/ID EENot used28SCL0/I2C/IDEENot used
29GPIO5/GPCLK1Not used30GNDGND
31GPIO6/GPCLK2Power good32GPIO12/PWM0Not used
33GPIO13/PWM1Not used34GNDGND
35GPIO19/PCMFS/PWM1Not used36GPIO16MDB CTS
37GPIO26MDB RTS38GPIO20/PCMDINNot used
39GNDGND40GPIO21/PCMDOUTNot used
You do not need to perform any settings on the RASPIVEND, neither hardware or
software.
To use this mode, your application must handle the following:
a. GPIO pins of the Raspberry PI, needed to switch the multiplexers to the correct
communication channel (to select the peripheral).
b. Serial port of the Raspberry PI (/dev/ttyAMA0).
c. for MDB handling you need, also, to manipulate MDB RTS and MDB CTS pins.
The MDB communication is handled by setting MDB RTS pin to lo and waiting for CTS
PIN to be set as lo by the board. Only messages sent by reading lo on MDB CTS will be
correctly received by the device. Please be sure that will keep MDB RTS high when you
do not need to communicate to MDB bus.
This command will disable the bill validator that will no longer accept any banknote.
5. MDB bill read setup vector
<HEADER><CMD><SUBCMD><PARAMETERS><CRC>
0xFE0x420x04[none]0xB8
RASPIVEND answer
0xFE0x420x04- <BILL SETUP> - 27 bytes
- <BILL EXPANSION IDENTIFICATION> - 29 bytes
This command will return the settings vector for the MDB bill validator. Those vectors are
read on the initialization phase. There are two vectors available and the contained data are
detailed in the MDB documentation. This command is optional and is used only if you need
to handle some lower informations (bill validator MDB level, software version, ISO country
code, etc.).
This command will deactivate the coin acceptor/changer.
9. Coin acceptor read setup vectors
<HEADER><CMD><SUBCMD><PARAMETERS><CRC>
0xFE0x430x04[none]0xB9
RASPIVEND answer
0xFE0x430x04- <COIN SETUP> - 23 bytes
- <COIN EXPANSION IDENTIFICATION> - 33 bytes
CRC
This command will return the settings vector for the MDB coin acceptor/changer. Those
vectors are read on the initialization phase. There are two vectors available and the
contained data are detailed in the MDB documentation. This command is optional and is
used only if you need to handle some lower informations (coin acceptor/changer MDB
level, software version, ISO country code, etc.).
10. Set maximum credit
<HEADER><CMD><SUBCMD><PARAMETERS><CRC>
0xFE0x520x01<MAXIMUM CREDIT> - 4 bytes – MSB
Example: 0xFE 0x52 0x01 0x00 0x00 0x02 0x58 0xF7 –
this will set the maximum credit to 600 units. In case of
EUR or USD, this means 600 cents or 6.00EUR/6.00USD
This command will set the maximum acceptable credit for bills. Any bill exceeding this
value will be rejected. For coins, you should disable the MDB coin acceptor after reaching
the maximum credit value.
The RASPIVEND has an internal cash counter which is incremented for each bill or coin
deposited by the MDB PERIPHERALS. This counter can be read by using a POLL
command, detailed on “12. Poll credit and devices status”. For simplicity reasons, this
counter can be reseted by this command. You can use this command after each
transaction, or anytime you need.
12. Return change
<HEADER><CMD><SUBCMD><PARAMETERS><CRC>
0xFE0x520x03<CHANGE TO RETURN> - 4 bytes – MSB
Example: 0xFE 0x52 0x03 0x00 0x00 0x01 0x5E 0xF0 –
this command will return 350 change, which means, for
EUR and USD, 350cents or 3.50EUR/3.50USD
This command will start returning change if the RASPIVEND has a changer connected on
the MDB port.
13. Set current cash credit
<HEADER><CMD><SUBCMD><PARAMETERS><CRC>
0xFE0x520x04<SET CURRENT CASH CREDIT> - 4 bytes – MSB
Example: 0xFE 0x52 0x03 0x00 0x00 0x01 0x5E 0xF0 –
this command will set current credit to 350, which means,
for EUR and USD, 350cents or 3.50EUR/3.50USD – This
is used to adjust credit in multivend mode and before the
cashless revalue command to set only remaining credit
for revalue.
This command will sest the current credit on the RASPIVEND. It is indicated to use this
command after every cash transaction finished with a successful vend.
example, 0x00 0x00 0x04 0xE2 representing 1250 cents
or 12.50EUR/12.50USD)
- <CURRENT CREDIT CASHLESS> - 4 bytes MSB (for
example, 0x00 0x00 0x04 0xE2 representing 1250 cents
or 12.50EUR/12.50USD)
- <BILL validator status> - 4 byte, according to MDB bill
validators status (see Table 3) – this register contains last
4 bill validator status. If the register has the value
0xFFFFFFFF, then the bill validator is not initialized. The
rightmost byte of this register is the last status.
- <COIN acceptor/changer status> - 4 bytes, according to
MDB coin acceptors/changers status (see Table 4)
- <CASHLESS #1 status> - 4 bytes, according to the
MDB cashless status (see Table 5)
- <CASHLESS #2 status> - 4 bytes, according to the
MDB cashless status (see Table 5)
- <CASHLESS MEDIA ID> - 4 bytes, card/tag serial
number
CRC
This command must be run periodically, at least one per second, to interrogate the
payment systems status and to take all needed decisions.
This command will set to 0x00 all devices' status. It is used to clear status and let the
RASPIVEND to update it in accordance with the new devices' status. It will not reset
credits
0x02 = cashless #2)
<VEND VALUE> - 4 bytes - the value of the selected
product to sell - MSB (for example, 0x00 0x00 0x04 0xE2
representing 1250 cents or 12.50EUR/12.50USD)
This command will send ask the permission to sell a product using cashless. This
command requires to use POLL command to obtain the answer from the cashless device
(according to Table 5).
This command must be sent after a successful vend using cashless. Following this
command, the RASPIVEND will substract the product value from the cashless credit, and
the cashless device will be instructed to substract th same amount from the customer's
credit.
This command must be sent after a failed sale situation (due to VMC error). The cashless
will be instructed to refund the product price to the customer's account.
Using this mode, the development becomes much easier. The communication with the
board and the peripherals is managed by a small application configured to be handled by
the xinetd super-server. The application will be delivered with the RASPIVEND.
Commands are not case sensitive. We have used capitalization to facilitate reading.
It is a good idea for your application to retry sending the command few times if you get an
“failed” answer. This answer can be returned in the event of Raspberry PI to RASPIVEND
board communication failure. Also it can be returned if you try to address a not connected
device.
1. Configuring xinetd
Proceed to xinetd installation, according to your distribution specifications.
2. MDBBillInit
GUI command
CommandParameters/Comments
MDBBillInit[none]
AnswerParameters/Comments
{"MDBBillInit":"success"}
or
{"MDBBillInit":"failed"}
3. MDBBillEnable
CommandParameters/Comments
MDBBillEnable[none]
AnswerParameters/Comments
{"MDBBillEnable":"success"}
or
{"MDBBillEnable":"failed"}
RASPIVEND daemon answer
This command will perform all initialization tasks for the attached
MDB bill validator. If something goes wrong or the MDB bill
validator is not connected to the board, then the command
returns “failed” message.
GUI command
RASPIVEND daemon answer
This command will activate the attached MDB bill validator. This
command must be preceded by the MDBBillInit command. You
cannot activate a bill validator if this one is not initialized.
{"MDBBillDisable":"success"}
or
{"MDBBillDisable":"failed"}
5. MDBCoinInit
CommandParameters/Comments
MDBCoinInit[none]
AnswerParameters/Comments
{"MDBCoinInit":"success"}
or
{"MDBCoinInit":"failed"}
6. MDBCoinEnable
CommandParameters/Comments
This command will deactivate the attached MDB bill validator.
GUI command
RASPIVEND daemon answer
This command will initialize the attached MDB coin
acceptor/changer.
GUI command
MDBCoinEnable[none]
AnswerParameters/Comments
{"MDBCoinEnable":"success"}
or
{"MDBCoinEnable":"failed"}
RASPIVEND daemon answer
This command will enable the attached MDB coin
acceptor/changer. This command requires a previous
MDBCoinInit command. You cannot enable a coin
acceptor/changer if it was not previously initialized.
This command will disable the attached MDB coin
acceptor/changer.
GUI command
RASPIVEND daemon answer
Using this command you can get informations about the MDB
connected bill validator.
<BillValues> array contains the bill values that the device will
recognize.
Most of those are low level informations and you do not need to
use them in you application, since all MDB protocol will be
handled by the RASPIVEND board.
You can use, for example, the serial number and model to keep
tracking of the payment systems, service activities, cleaning, etc.
Using this command you can get informations about the MDB
connected coin acceptors/changers.
<CoinValues> array contains the values that the device will
recognize.
<ChangeCoins> array contains informations about the coins that
the device can use to return change. If all elements are “false”,
then the device does not have change capabilities.
Most of those are low level informations and you do not need to
use them in you application, since all MDB protocol will be
handled by the RASPIVEND board.
- 32 bit positive value
When there is a bill in escrow, where <current_MDB_Credit> +
<MDB_escrow_bill_value> is bigger than NNNN, then that bill wil
be returned to the customer.
For coins, your application must disable the coin
acceptor/changer, once the maximum credit is reached.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetMaxCredit":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetMaxCreditOK, after you verify that the
returned value is the same with the sent value.
11. MDBSetMaxCreditOK
CommandParameters/Comments
MDBSetMaxCreditOK[none]
AnswerParameters/Comments
{"MDBSetMaxCreditOK":"success"}
or
{"MDBSetMaxCreditOK":"failed"}
GUI command
RASPIVEND daemon answer
This command will commit the change of the MaxCredit variable
on the RASPIVEND board.
MDBSetCurrentCredit(“NNNN”)Set the value of the MDB module curernt credit.
- 32 bit positive value
This value must be set after each succesful vend and before
issuing the “MDBCashlessRevalue” command. This is the value
that the RASPIVEND board will try to use for revalue.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
This command will modify the value of CurrentCreditCash. You
can read this variable by issuing the MDBPoll command.
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetCurrentCredit":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetCurrentCreditOK, after you verify that the
returned value is the same with the sent value.
13. MDBSetCurrentCreditOK
CommandParameters/Comments
MDBSetCurrentCreditOK[none]
AnswerParameters/Comments
{"MDBSetCurrentCreditOK":"success"}
or
{"MDBSetCurrentCreditOK":"failed"}
GUI command
RASPIVEND daemon answer
This command will commit the change of the CurrentCreditCash
variable on the RASPIVEND board.
MDBSetChange(“NNNN”)Set the value of the change that MDB module will return when
the MDBSetChangeOK command will be issued.
- 32 bit positive value
This value must be set before any change return action
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetChange":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetChangeOK, after you verify that the
returned value is the same with the sent value.
15. MDBSetChangeOK
GUI command
CommandParameters/Comments
MDBSetChangeOK[none]
AnswerParameters/Comments
{"MDBSetChangeOK":"success"}
or
{"MDBSetChangeOK":"failed"}
16. MDBCreditReset
CommandParameters/Comments
MDBCreditReset[none]
AnswerParameters/Comments
{"MDBCreditReset":"success"}
or
{"MDBCreditReset":"failed"}
RASPIVEND daemon answer
This command will commit the MDBSetChange command and
will try to return the requested amount to the customer.
You need to check the changer status by repeatedly issuing the
MDBPoll command and parsing the changer status variable.
This variable will be described on MDBPoll section.
GUI command
RASPIVEND daemon answer
This command will set the CurerntCreditCash variable to 0.
It is recommended to use this command before activating the
payment systems on each transaction.
This command will return the current MDB module's information.
It is recommended to issue this command at least twice a
second while the transaction is opened (when the payment
systems are enabled), to check the current credit and to disable
the payment systems when the credit is the same or bigger than
the selected product price.
- <CurrentCreditCash> is the accumulated cash credit;
- <CurrentCreditCashless> is the credit available on the
customer's cashless payment media;
- <BilStat> contains the last 4 hexadecimal bill validator status
codes (according with the Table 2 on page 14). The leftmost
value is the older one.
- <CoinStat> contains the last 4 hexadecimal coin acceptor
status codes (according with the Table 3 on page 15). The
leftmost value is the older one.
- <CaslessStat> contains the last 4 hexadecimal cashless
devices status codes (according with the Table 4 on page 16).
The leftmost value is the older one.
- <CashlessID> contains the internal ID of the customer's media.
You can use this for tracking purposes.
It is recommended to keep an eye on this informations during the
transaction. When there is no transaction open it is
recommended to periodically poll this status variable to detect
payment systems jam.
If a payment system was not initialized, it's corresponding status
variable will have “FFFFFFFF” value.
18. MDBResetStatus
GUI command
CommandParameters/Comments
MDBResetStatus[none]
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBResetStatus":"success"}
or
{"MDBResetStatus":"failed"}
This command will set to “00000000” all MDB payment system
status variables.
If a payment system was not initialized, it's corresponding status
variable will have “FFFFFFFF” value.
19. MDBCashlessInit
CommandParameters/Comments
MDBCashlessInit(N)“N” is the address of the cashless to be initialized (1 for the first
AnswerParameters/Comments
GUI command
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
{"MDBCashlessInit":"success"}
or
{"MDBCashlessInit":"failed"}
20. MDBCashlessEnable
CommandParameters/Comments
MDBCashlessEnable(N)“N” is the address of the cashless to be enabled (1 for the first
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessEnable":"success"}
or
{"MDBCashlessEnable":"failed"}
21. MDBCashlessDisable
This command will perform all initialization tasks for the attached
MDB cashless system. If something goes wrong or the MDB
cashless system is not connected to the board, then the
command returns “failed” message.
GUI command
cashless device and 2 for the second cashless device)
This command will activate the attached MDB cashless system.
This command must be preceded by the MDBCashlessInit
command. You cannot activate a cashless system if this one is
not initialized.
GUI command
CommandParameters/Comments
MDBCashlessDisable(N)“N” is the address of the cashless to be disabled (1 for the first
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessDisable":"success"}
or
{"MDBCashlessDisable":"failed"}
This command will return the specified cashless device low level
informations. You will probably don't need those informations,
unless you want to track the payment systems for
service/maintenance reasons.
23. MDBCashlessVendRequest
GUI command
CommandParameters/Comments
MDBCashlessVendRequest(NNNN)Set the value of the requested credit will be withdrawn from the
customer's cashless media..
- 32 bit positive value
Thisvaluemustbesetbeforeany
MDBCashlessVendRequestOK command.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendRequest":"100"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBCashlessVendRequestOK, after you verify
that the returned value is the same with the sent value.
MDBCashlessVendRequestOK(N)“N” is the address of the cashless to request vend permission(1
for the first cashless device and 2 for the second cashless
device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendRequestOK":"success"}
or
{"MDBCashlessVendRequestOK":"failed"}
This command will commit the MDBCashlessVendRequest
command.
You must use the MDBPoll command to verify the response of
the cashless system (vend approved or vend denied) according
to Table 4 on page 16. If the status changes to “vend approved”
thenyouhavetoissuethecommand
“MDBCashlessVendSuccess”towithrawalthe
MDBCashlessVendRequest value from the customer's cashless
payment media.
25. MDBCashlessVendSuccess
GUI command
CommandParameters/Comments
MDBCashlessVendSuccess(N)“N” is the address of the cashless to withdraw (1 for the first
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendSuccess":"success"}
or
{"MDBCashlessVendSuccess":"failed"}
This command will send transaction success information to the
cashless system.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
26. MDBCashlessVendFailed
GUI command
CommandParameters/Comments
MDBCashlessVendFailed(N)“N” is the address of the cashless to notify that the transaction
has failed (1 for the first cashless device and 2 for the second
cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendFailed":"success"}
or
{"MDBCashlessVendFailed":"failed"}
This command will send transaction failed information to the
cashless system.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
27. MDBCashlessRevalue
CommandParameters/Comments
MDBCashlessRevalue(N)“N” is the address of the cashless to revalue (1 for the first
RASPIVEND daemon answer
AnswerParameters/Comments
GUI command
cashless device and 2 for the second cashless device)
{"MDBCashlessRevalue":"success"}
or
{"MDBCashlessRevalue":"failed"}
This command will send load the CurentCreditCash value to the
cashless.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
Also, your application must handle the maximum revalue
settings for the cashless system. You have to set the cashless
revalue only in it's aloud range. If you will not manage this, then
the cashless can randomly goes to overflow.
28. MDBCashlessEndSession
GUI command
CommandParameters/Comments
MDBCashlessEndSession(N)“N” is the address of the cashless to close the session (1 for the
first cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessEndSession":"success"}
or
{"MDBCashlessEndSession":"failed"}
This command will force the cashless system to close the
current session. If the media is not removed, most of the time,
the cashless system will automatically open a new session.
KBSet(ABCD)This will send a command to the VTLCOMBUS extension to
AnswerParameters/Comments
GUI command
simulate a keypress to the vending machine. For the moment,
the VTLCOMBUS is only available for Necta and Wurlitzer
vending machines. We can produce any other keyboard
extensions on request.
- A is the the block number;
- B is the first block multiplexer channel control line
- C is the second block multiplexer channel control line
- D is the third block multiplexer channel control line
A full list with key correspondence will be delivered on request,
depending on you machine's manufacturer and model.
This command will send the appropriate keystroke to deliver the
product.
When you receive the correct combination as a response, then
you have to commit the command with the command KBSetOK
RASPIVEND daemon answer
{"KeyboardSet":"ABCD"}
or
This command will simulate a keyboard press to deliver one
product to the customer.
{"KeyboartSet":"failed"}
Keyboard truth table shows the connections between lines and columns, according to the
selected bock and multiplexer values (external keyboard simulator needed, sold
separately).
RTCSetThis command will store the current Rasberry PI date and time
to the RASPIVEND's non-volatile RTC.
RASPIVEND daemon answer
AnswerParameters/Comments
GUI command
RTCGetThis command will read the date and time informations from the
non-volatile RTC on the RASPIVEND board. This command is
useful to help you set the date and time on Raspberry PI if it is
not connected to the Internet.
Using this mode, the development becomes much easier. The communication with the
board and the peripherals is managed by a small Python 3 application, called
pyraspivend.py. The application is available for download on product’s page.
Commands are not case sensitive. We have used capitalization to facilitate reading.
It is a good idea for your application to retry sending the command few times if you get an
“failed” answer. This answer can be returned in the event of Raspberry PI to RASPIVEND
board communication failure. Also it can be returned if you try to address a not connected
device.
1. Configuring Python 3
The only dependency for this application is pyserial library, version 3.0.1 or higher.
2. MDBBillInit
GUI command
CommandParameters/Comments
MDBBillInit[none]
AnswerParameters/Comments
{"MDBBillInit":"success"}
or
{"MDBBillInit":"failed"}
3. MDBBillEnable
CommandParameters/Comments
MDBBillEnable[none]
AnswerParameters/Comments
{"MDBBillEnable":"success"}
or
{"MDBBillEnable":"failed"}
RASPIVEND daemon answer
This command will perform all initialization tasks for the attached
MDB bill validator. If something goes wrong or the MDB bill
validator is not connected to the board, then the command
returns “failed” message.
GUI command
RASPIVEND daemon answer
This command will activate the attached MDB bill validator. This
command must be preceded by the MDBBillInit command. You
cannot activate a bill validator if this one is not initialized.
{"MDBBillDisable":"success"}
or
{"MDBBillDisable":"failed"}
5. MDBCoinInit
CommandParameters/Comments
MDBCoinInit[none]
AnswerParameters/Comments
{"MDBCoinInit":"success"}
or
{"MDBCoinInit":"failed"}
6. MDBCoinEnable
CommandParameters/Comments
This command will deactivate the attached MDB bill validator.
GUI command
RASPIVEND daemon answer
This command will initialize the attached MDB coin
acceptor/changer.
GUI command
MDBCoinEnable[none]
AnswerParameters/Comments
{"MDBCoinEnable":"success"}
or
{"MDBCoinEnable":"failed"}
RASPIVEND daemon answer
This command will enable the attached MDB coin
acceptor/changer. This command requires a previous
MDBCoinInit command. You cannot enable a coin
acceptor/changer if it was not previously initialized.
This command will disable the attached MDB coin
acceptor/changer.
GUI command
RASPIVEND daemon answer
Using this command you can get informations about the MDB
connected bill validator.
<BillValues> array contains the bill values that the device will
recognize.
Most of those are low level informations and you do not need to
use them in you application, since all MDB protocol will be
handled by the RASPIVEND board.
You can use, for example, the serial number and model to keep
tracking of the payment systems, service activities, cleaning, etc.
Using this command you can get informations about the MDB
connected coin acceptors/changers.
<CoinValues> array contains the values that the device will
recognize.
<ChangeCoins> array contains informations about the coins that
the device can use to return change. If all elements are “false”,
then the device does not have change capabilities.
Most of those are low level informations and you do not need to
use them in you application, since all MDB protocol will be
handled by the RASPIVEND board.
- 32 bit positive value
When there is a bill in escrow, where <current_MDB_Credit> +
<MDB_escrow_bill_value> is bigger than NNNN, then that bill wil
be returned to the customer.
For coins, your application must disable the coin
acceptor/changer, once the maximum credit is reached.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetMaxCredit":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetMaxCreditOK, after you verify that the
returned value is the same with the sent value.
11. MDBSetMaxCreditOK
CommandParameters/Comments
MDBSetMaxCreditOK[none]
AnswerParameters/Comments
{"MDBSetMaxCreditOK":"success"}
or
{"MDBSetMaxCreditOK":"failed"}
GUI command
RASPIVEND daemon answer
This command will commit the change of the MaxCredit variable
on the RASPIVEND board.
MDBSetCurrentCredit(“NNNN”)Set the value of the MDB module curernt credit.
- 32 bit positive value
This value must be set after each succesful vend and before
issuing the “MDBCashlessRevalue” command. This is the value
that the RASPIVEND board will try to use for revalue.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
This command will modify the value of CurrentCreditCash. You
can read this variable by issuing the MDBPoll command.
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetCurrentCredit":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetCurrentCreditOK, after you verify that the
returned value is the same with the sent value.
13. MDBSetCurrentCreditOK
CommandParameters/Comments
MDBSetCurrentCreditOK[none]
AnswerParameters/Comments
{"MDBSetCurrentCreditOK":"success"}
or
{"MDBSetCurrentCreditOK":"failed"}
GUI command
RASPIVEND daemon answer
This command will commit the change of the CurrentCreditCash
variable on the RASPIVEND board.
MDBSetChange(“NNNN”)Set the value of the change that MDB module will return when
the MDBSetChangeOK command will be issued.
- 32 bit positive value
This value must be set before any change return action
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBSetChange":"NNNN"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBSetChangeOK, after you verify that the
returned value is the same with the sent value.
15. MDBSetChangeOK
GUI command
CommandParameters/Comments
MDBSetChangeOK[none]
AnswerParameters/Comments
{"MDBSetChangeOK":"success"}
or
{"MDBSetChangeOK":"failed"}
16. MDBCreditReset
CommandParameters/Comments
MDBCreditReset[none]
AnswerParameters/Comments
{"MDBCreditReset":"success"}
or
{"MDBCreditReset":"failed"}
RASPIVEND daemon answer
This command will commit the MDBSetChange command and
will try to return the requested amount to the customer.
You need to check the changer status by repeatedly issuing the
MDBPoll command and parsing the changer status variable.
This variable will be described on MDBPoll section.
GUI command
RASPIVEND daemon answer
This command will set the CurerntCreditCash variable to 0.
It is recommended to use this command before activating the
payment systems on each transaction.
This command will return the current MDB module's information.
It is recommended to issue this command at least twice a
second while the transaction is opened (when the payment
systems are enabled), to check the current credit and to disable
the payment systems when the credit is the same or bigger than
the selected product price.
- <CurrentCreditCash> is the accumulated cash credit;
- <CurrentCreditCashless> is the credit available on the
customer's cashless payment media;
- <BilStat> contains the last 4 hexadecimal bill validator status
codes (according with the Table 2 on page 14). The leftmost
value is the older one.
- <CoinStat> contains the last 4 hexadecimal coin acceptor
status codes (according with the Table 3 on page 15). The
leftmost value is the older one.
- <CaslessStat> contains the last 4 hexadecimal cashless
devices status codes (according with the Table 4 on page 16).
The leftmost value is the older one.
- <CashlessID> contains the internal ID of the customer's media.
You can use this for tracking purposes.
It is recommended to keep an eye on this informations during the
transaction. When there is no transaction open it is
recommended to periodically poll this status variable to detect
payment systems jam.
If a payment system was not initialized, it's corresponding status
variable will have “FFFFFFFF” value.
18. MDBResetStatus
GUI command
CommandParameters/Comments
MDBResetStatus[none]
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBResetStatus":"success"}
or
{"MDBResetStatus":"failed"}
This command will set to “00000000” all MDB payment system
status variables.
If a payment system was not initialized, it's corresponding status
variable will have “FFFFFFFF” value.
19. MDBCashlessInit
CommandParameters/Comments
MDBCashlessInit(N)“N” is the address of the cashless to be initialized (1 for the first
AnswerParameters/Comments
GUI command
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
{"MDBCashlessInit":"success"}
or
{"MDBCashlessInit":"failed"}
20. MDBCashlessEnable
CommandParameters/Comments
MDBCashlessEnable(N)“N” is the address of the cashless to be enabled (1 for the first
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessEnable":"success"}
or
{"MDBCashlessEnable":"failed"}
21. MDBCashlessDisable
This command will perform all initialization tasks for the attached
MDB cashless system. If something goes wrong or the MDB
cashless system is not connected to the board, then the
command returns “failed” message.
GUI command
cashless device and 2 for the second cashless device)
This command will activate the attached MDB cashless system.
This command must be preceded by the MDBCashlessInit
command. You cannot activate a cashless system if this one is
not initialized.
GUI command
CommandParameters/Comments
MDBCashlessDisable(N)“N” is the address of the cashless to be disabled (1 for the first
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessDisable":"success"}
or
{"MDBCashlessDisable":"failed"}
This command will return the specified cashless device low level
informations. You will probably don't need those informations,
unless you want to track the payment systems for
service/maintenance reasons.
23. MDBCashlessVendRequest
GUI command
CommandParameters/Comments
MDBCashlessVendRequest(NNNN)Set the value of the requested credit will be withdrawn from the
customer's cashless media..
- 32 bit positive value
Thisvaluemustbesetbeforeany
MDBCashlessVendRequestOK command.
The value is multiplied by the 100 scaling factor (for example, for
1EUR you have to set this value to 100).
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendRequest":"100"}This command will return the value you have sent. For safety
reasons (eliminate the communication errors), you must commit
this action with MDBCashlessVendRequestOK, after you verify
that the returned value is the same with the sent value.
MDBCashlessVendRequestOK(N)“N” is the address of the cashless to request vend permission(1
for the first cashless device and 2 for the second cashless
device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendRequestOK":"success"}
or
{"MDBCashlessVendRequestOK":"failed"}
This command will commit the MDBCashlessVendRequest
command.
You must use the MDBPoll command to verify the response of
the cashless system (vend approved or vend denied) according
to Table 4 on page 16. If the status changes to “vend approved”
thenyouhavetoissuethecommand
“MDBCashlessVendSuccess”towithrawalthe
MDBCashlessVendRequest value from the customer's cashless
payment media.
25. MDBCashlessVendSuccess
GUI command
CommandParameters/Comments
MDBCashlessVendSuccess(N)“N” is the address of the cashless to withdraw (1 for the first
cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendSuccess":"success"}
or
{"MDBCashlessVendSuccess":"failed"}
This command will send transaction success information to the
cashless system.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
26. MDBCashlessVendFailed
GUI command
CommandParameters/Comments
MDBCashlessVendFailed(N)“N” is the address of the cashless to notify that the transaction
has failed (1 for the first cashless device and 2 for the second
cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessVendFailed":"success"}
or
{"MDBCashlessVendFailed":"failed"}
This command will send transaction failed information to the
cashless system.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
27. MDBCashlessRevalue
CommandParameters/Comments
MDBCashlessRevalue(N)“N” is the address of the cashless to revalue (1 for the first
RASPIVEND daemon answer
AnswerParameters/Comments
GUI command
cashless device and 2 for the second cashless device)
{"MDBCashlessRevalue":"success"}
or
{"MDBCashlessRevalue":"failed"}
This command will send load the CurentCreditCash value to the
cashless.
You must use the MDBPoll command to verify the response of
the cashless system according to Table 4 on page 16).
Also, your application must handle the maximum revalue
settings for the cashless system. You have to set the cashless
revalue only in it's aloud range. If you will not manage this, then
the cashless can randomly goes to overflow.
28. MDBCashlessEndSession
GUI command
CommandParameters/Comments
MDBCashlessEndSession(N)“N” is the address of the cashless to close the session (1 for the
first cashless device and 2 for the second cashless device)
RASPIVEND daemon answer
AnswerParameters/Comments
{"MDBCashlessEndSession":"success"}
or
{"MDBCashlessEndSession":"failed"}
This command will force the cashless system to close the
current session. If the media is not removed, most of the time,
the cashless system will automatically open a new session.
29. SetMUXChannel
GUI command
CommandParameters/Comments
SetMUXChannel(“channel”)This commend selects the cnannel for communication.
“channel” can take the following values:
- RS232_1
- RS232_2
- VTLCOMBUS
- ccTalk
RASPIVEND daemon answer
AnswerParameters/Comments
{"SetMUXChannel":"channel"}
or
{"SetMUXChannel":"failed"}
CCTHopperDispense(N,M)“N” is the hopper address and “M” is the number of coins to
AnswerParameters/Comments
This command will perform a full init of the hopper with provided
address. The response include the status for each stage in the
initialization procedure. Your application must decide, based on
those statuses, if the init procedure is a success or not. In our
example, the procedure is a success, since the test hopper does
not support “ClearComms” command, but successfully answered
on the most important init procedures and also to the
“HopperEnable” command.
GUI command
dispense.
RASPIVEND daemon answer
{“HopperDispenseNormal":"success"}
or
{“HopperDispenseNormal":"failed"}
This command will instruct the hopper to payout a number of
coins. After issuing this command, the customer’s application
should keep polling with command CCTHopperCheckDispense,
to get informations about the status, number of coins dispensed,
number of coins to dispense and error.
32. CCTHopperCheckDispense
GUI command
CommandParameters/Comments
CCTHopperCheckDispense(N)“N” is the hopper address.
This command will return a message regarding the last known
hopper status.
After issuing CCTHopperDispense or
CCTHopperDispenseCipher commands, the customer’s
application should periodically poll the hopper with this command
until one of the following situation appears:
- “Dispensed” has the same value as the number of coins
requested. The dispense is fine and the transaction is finished.
- “NotDispensed” has a value bigger than 0. In this situation, the
dispense failed and there a remaining “NotDispensed” coins that
could not be supplied. It is up to the customer’s application to
decide if it will try another dispense command or return to the
main loop.
33. CCTHopperDispenseCipher
GUI command
CommandParameters/Comments
CCTHopperDispenseCipher(N,M)“N” is the hopper address and “M” is the number of coins to
dispense using cipher key instead of serial number. Cipher key is
required by some hoppers instead of plain 3 bytes serial number.
Try to use this in case your hopper is correctly initialized but is
not dispensing any coin.
RASPIVEND daemon answer
AnswerParameters/Comments
{“HopperDispenseCipher":"success"}
or
{“HopperDispenseCipher":"failed"}
This command will instruct the hopper to payout a number of
coins. After issuing this command, the customer’s application
should keep polling with command CCTHopperCheckDispense,
to get informations about the status, number of coins dispensed,
number of coins to dispense and error.