[PAID] USB Connector for ESC/POS Thermal Printers

SimpleUSBConnector

Extension to manage connection to an Esc/Pos thermal printer attached to the device via USB/OTG.

This extension doesn't do the esc/pos commands conversion so this extension is a complement for my extensions:

and i think it can also be used with this one:

This extension manages a permission asked on runtime when a usb printer is attached to the device and shows an alert like this one:
image

Available blocks

Events:

USBConnectionSucceeded

USBConnectionSucceededBlock

Event raised when the connection to the printer was successful

USBConnectionFailed

USBConnectionFailedBlock

Event raised when the connection to the printer failed

Parameter Type
errorMessage text

PermissionDenied

PermissionDeniedBlock

Event raised when the connection the permission to access the USB was denied by the user

USBDeviceAttached

USBDeviceAttachedBlock

Event raised when an USB devices is attached to the device

Parameter Type
deviceName text

USBDeviceDetached

USBDeviceDetachedBlock

Event raised when an USB devices is detached to the device

Parameter Type
deviceName text

Methods:

ConnectUSBPrinter

ConnectUSBPrinterBlock

Connect to the USB printer connected to the device

IsPrinterReady

IsPrinterReadyBlock

Validates if is printer is ready to receive printing commands

Return Type: boolean

GetAttachedDevices

GetAttachedDevicesBlock

Returs a list that contains the usb devices attached to the device

Return Type: list

SendDataToUSBPrinter

SendDataToUSBPrinterBlock

Send data to USB printer

Parameter Type
list list

CloseConnection

CloseConnectionBlock

Closes the connection with the usb device if was previously established

Example blocks

Purchase:

You can buy the extension in the following link for $4 USD

2 Likes

Trying to get this to work over a usb cable. other apps will print. The example code provided does not. Here is my stripped down set of blocks I am working with. The printer connects but nothing happens with the line feeds. Any ideas?

What kind of printer are you using?

An embedded thermal receipt printer with USB/TTL interfaces and ESC/POS codes. (Amazon.com). It works over USB from an android tablet using the ESC/POS app on the Play Store but I haven't been able to get it to work with your code (or any of my other attempts in App Inventor). Any suggestions are appreciated.
Bill

If you haven't tried the Serial component, here's a test bed you can try, loaded with a few ESC/POS sample code sequences and some conversion procedures you can use for other codes.

I don't have a serial printer, so I can't test it.


serial_ESC_POS_test.aia (5.3 KB)

The source for the ESC/POS codes is in the Screen1.About attribute.

Thanks for your response and your efforts. This isn't working right off the bat for me but I am getting a Bluetooth enabled printer so hopefully that will be more successful.

I received a bluetooth printer and it works fine with mmnettime's demo app and source code.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.