Transfer files over a command interface
If you need to manage a VTAP reader at a remote location or you want to update many devices, it becomes impractical to simply access the VTAP reader as a mass storage device on a PC, to upload new files. Also, on many Android builds, the USB mass storage FAT12 format is not supported by default, which means a custom module has to be added to the operating system before files can be transferred.
To avoid these difficulties you can use the Zmodem protocol to transfer files, such as a firmware update, key update or configuration file. By default the VTAP reader is always listening for Zmodem commands on any ports where the Command Interface is enabled. There are two ways that you might make use of the Zmodem file transfer facility:
-
To send a file: Simply choose to 'transfer a file', select the 'Zmodem' option and select the file to send. TeraTerm or PuTTY-nd are examples applications to use on Windows. Similar applications exist for other platforms. You simply choose to transfer a file, select the Zmodem option and select the file to send.
Note: You need to use PuTTY-nd, Le Putty or extraPuTTY, because the original version of PuTTY does not support Zmodem
Note: In TeraTerm, use File > Transfer, not File > Send. You may want to edit the ZModem sending parameters ZmodemDataLen=<data sub packet length in bytes> and ZmodemWinSize=<window size for sending in bytes>. These default to larger sizes for faster sending, but the VTAP has very low data processing capabilities, so these numbers should be set to 100. If you need to send a receipt set ZmodemRcvCommand=rz, and adjust timeouts ZmodemTimeouts=10,0,10,3 (where the first number relates to the serial port, second the TCP/IP port, 3rd initial packet, 4th final packet).
-
To receive a file: Use the command !<filename> over any serial port on which commands are allowed (by the CommandInterfaces setting). Then run 'Zmodem receive' in the client. The VTAP reader will continue sending the file until it is acknowledged.
It is expected that developers would be more likely to implement their own code, which includes actions that trigger a Zmodem transfer. We generally recommend the use of our Zmodem Developer Toolkit and the serial command interface to customers who are building a deeper integration between their systems and our VTAP readers.
The following code examples are currently available on request, to help you take advantage of the Zmodem file transfer facility:
-
VTAP Serial Interface and File Transfer API C/C++
C language source and header files implementing a serial communications interface to the VTAP reader. This provides easy access to the full functionality of the VTAP command interface and the ability to send and receive files to/from the VTAP file system.
-
VTAP Android Java Developer Toolkit
Java classes that provide a lightweight interface to the VTAP command interface via the USB virtual COM port. An example Android app that demonstrates the use of these classes is included. This provides easy access to the full functionality of the VTAP command interface and the ability to send and files to the VTAP100 file system using the ZModem protocol.
-
ZmTest - Zmodem Command Line Test Utility
A Windows command line test tool for file transfer between Windows and the VTAP reader. It can be used to transfer files, such as firmware or config.txt between the VTAP reader and a connected Windows system. It can also be useful to test Zmodem functionality when implementing a serial communications interface to the VTAP reader using the other toolkit resources (Java Developer Toolkit and C language source code).
To obtain these developer toolkits, or if you need other examples in C/C++/Python/Java contact vtap-support@dotorigin.com and we will do our best to help.
We recommend that you set the interface you are using for a Zmodem transfer to passive mode, or receive routine pass (or card/tag) read data on a different interface. This is because user taps could interrupt other operations.