|
How to print receipts using an OTG USB Adapter on Android
Overview
How it works
Installing Adapter
Checking Adapter Settings
Configuring Printer
Testing & Troubleshooting Overview
USB On-The-Go, often abbreviated to USB OTG or just OTG, is a specification
first used in late 2001 that allows USB devices, such as tablets or mobile
phones, to act as a host, allowing other USB devices, such as receipt printers
with USB interfaces, to be attached to them. |
|
A USB connection is one of the newer
connection types
of connection between the computer and the printer. The data cable connects the USB port on the
computer to the USB adapter card on the printer. |
Required Components
|
When you plug two devices together using USB there is a one
device acting as a host and the other as a
client. Simply put the host device supports the client device. Most devices are
either dedicated clients or hosts. When you plug a USB client device like a
keyboard, the host provides the power and the driver software to interact with
the keyboard. Android devices can act as either host or clients. When you plug
an Android device into a computer, the Android operating system asks if you want
the Android device to ask a host or a client. When acting as a host it controls
the device, when acting as a client it is controlled by another device. The OTG
USB is a regular USB cable with one of the pins grounded. Plugging an OTG cable
into an Android device indicates to the device that it should act as a host to
al connections made with the cable. This allows you to plug in ‘dumb’ devices
without having the device negotiate with the Android O/S who will act as a host.
The host must supply the drivers to interact with the client device.
Attaching the Cable
Use a standard USB 2.0 printer cable to connect the printer. One end has a male USB
type B connector, the other end has a male USB type A plug that goes into the
OTG cable. The OTG cable plugs into the tablet or phone.
|
USB (connector on printer end)
USB cards use
USB Type B Cables
|
|
|
USB Printer Cable
$9.95
USBAB6 |
OTG USB Adapter
$3.95
OTGUSB1 |
Star Micronics' TSP100III Utility
Star Micronics
TSP100III Utility allows you to do setup, operation test and settings changes
easily. It is a free utility from Star Micronics available from the Google Play
store or directly from Star at
www.star-m.jp/tsp100iii-app.html.
What TSP100III Utility can do
Installation
Ethernet setup
Search for the network printer and connect to it
Change the network setting of the connected printer
Details
Confirm printer operation
Confirm cash drawer operation
Appendix
Confirm device condition
Confirm device information
Confirm the connection with the device
Settings
Details
Change memory switch
Technical Information
To use an attached USB device you need to have:
•A USB OTG (USB On-The-Go) cable
•USB Host Mode drivers loaded on your device
•A version of the Android operating system loaded on that device that
supports USB Host Mode
•An Android device (eg phone or tablet) that has built-in hardware
support for USB Host Mode
•And finally there need to be drivers on your device, for whatever USb
device you're plugging in.
Operating System
USB Host Mode support was introduced in Android version 3.1 (Honeycomb),
so if you have Android 3.1, or newer installed on your device then you should
have the necessary support for it in your OS, Android 4 also adds additional USB
and OTG support. Also, many third-party ROMs add support for USB Host Mode to
phones that have the hardware support, but don't have the necessary OS or driver
support in the official operating system release.
Host Mode Drivers
Most devices that have both hardware support and a new enough OS will
have the necessary drivers loaded to enable USB Host Mode, but some don't. You
can find driver apps on the Play Store for some models that don't have built in
drivers. Some models with 3rd party instructions and drivers available are:
•Nexus One
•HTC Desire
•HTC Incredible
Cable
You can't just use a normal USB cable. As these devices can act as both a
USB "slave" device (for instance so that you can plug them into a PC and copy
music onto your phone, or copy pictures off the phone) and a USB "host" (for
example so that you can plug a USB memory stick into your tablet and copy files
on or off it) they need some way to tell which they should act as at a given
time.
A USB OTG (USB On-The-Go) cable is what is used to tell your device to
act as a host, this is like a normal USB cable but it has one of the internal
pins connected to Ground at one end to let that device know that it should act
as the host (technically pins 4 & 5 are shorted to ground in an OTG cable).
Additionally, as most phones have micro-USB sockets, but most USB dongles
have "full-size" USB plugs, as below many OTG cables have a male micro-B USB
plug at one end, and a female USB-A plug at the other to convert between the
different sized connectors.
Motorola USB OTG cable)
The Motorola Camera Connection kit, which is a USB OTG cable
USB OTG cables can be bought fairly cheaply on places like eBay or the
Amazon marketplace, as well as many small electronics shops. You may also find
that your device's manufacturer sells an official, branded one, often called
something like a "Camera Connection Kit" or "USB Memory Stick Connection Cable".
If you're brave you can also find various tutorials on the web on how to make
your own OTG cable from a standard USB cable.
USB device drivers
When you plug your USB device into your Android phone or tablet it needs
to know what that USB device is and what to do with it. For common devices, like
USB memory sticks, or cameras that support PPTP or USB Mass Storage, these will
often already be built into the OS. For other USB devices, like Wifi, 3G or
Bluetooth dongles there may not be drivers pre-built into the OS, or only
drivers for certain specific devices.
How can you determine if your device has USB Host Mode (OTG) support?
Some Android devices can act as a USB host, so that you can use other USB
devices attached to them. For instance, browse or import the photos stored on a
camera from your phone, or copy files onto a USB memory stick attached to your
tablet, plug a full-size USB keyboard or mouse into a tablet, or use an external
GPS or wifi device.
How to determine if device support for USB
Host?
When an mobile device acts as a USB host, you can use other USB devices such as
USB printer, USB storage attached to it. However, there is not all device has
USB Host Mode support. How can you determine if your device has USB Host Mode
supported?
- USB Host Mode drivers
loaded on your device
- A version of the Android
OS loaded on that device that supports USB Host Mode
- An Android device (eg
phone or tablet) that has built-in hardware support for USB Host Mode
Android OS
USB Host Mode support was introduced in Android version 3.1 (Honeycomb), so if
you have Android 3.1, or newer you should have the necessary support for it in
your OS, Android 4 also adds additional USB and OTG support. Also, many
third-party ROMs add support for USB Host Mode to phones that have the hardware
support.
Testing & Troubleshooting
Test your device
There are some apps that can help you test whether you have all of the necessary
hardware and software to do this, such as USB Host Diagnostics. Using it to test
your device's capabilities is very simple:
- Install an USB host
diagnostics app from the Google Play store. You can install any app by
searching "USB Host" including: USB
Host Diagnostics, USB
Host Test).
- Run the app.
- Tap the Start Diagnostics
link (or similar function), and following the directions first ensure that
you have nothing plugged into USB on your device and then plug a device
(such as a USB flash drive) in when prompted.
USB Host Diagnostics running
If everything works you should end up with a summary screen like this,
showing firstly a few details about your device and the running OS, then letting
you know whether or not your device says that it supports USB Host Mode, and
then the all important final Verdict that lets you know whether testing the Host
Mode access worked or not:
USB Host Diagnostics results screen
If everything is working and the app successfully detected your USB
device (showing that your USB Host Mode is working) you should have "Yes"s in
the ringed sections, and some details showing how much access 3rd party (i.e.
non-built-in) apps have to the device. If not, there should be details there to
help you track down where the problem is.
Reference content from Star Micronics and Stack Exchange
Need some help? Try our Epson printer test utility
|