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:
READ FAQS BEFORE CONTINUING:
Summary Q: What's the purpose of this extension?
A: Create different ESC/POS commands that thermal printers can interpret as text, images, bar codes, qr codes. In order to print RECEIPTS
Q: How does this extension manage the connection to the printer?
A: My "Thermal printing extension" itself doesn't manage any connection to the printer. You can use the in-built Bluetooth component for that (That method is used in the demo .apk and .aia i provide)…
Description
Simple extension that is able to generate a receipt format, preview it in a Webviewer, convert it into a base64 image so it can be printed in ESC/POS thermal printers.
As some users who have worked with thermal printers will know, working with them can be a headache, considering that each thermal printer is different and has limitations in terms of characters, fonts, styles and designing a receipt can be a complicated task. Definitely the best way to send to print with this kind of …
and i think it can also be used with this one:
The ESC/POS Simple Converter enables to send formatted text, images, bar codes and QR codes from App Inventor to a bluetooth thermal printer without the need of having knowledge in ESC/POS programming.
This extension manages a permission asked on runtime when a usb printer is attached to the device and shows an alert like this one:
Available blocks
Events:
USBConnectionSucceeded
Event raised when the connection to the printer was successful
USBConnectionFailed
Event raised when the connection to the printer failed
Parameter
Type
errorMessage
text
PermissionDenied
Event raised when the connection the permission to access the USB was denied by the user
USBDeviceAttached
Event raised when an USB devices is attached to the device
Parameter
Type
deviceName
text
USBDeviceDetached
Event raised when an USB devices is detached to the device
Parameter
Type
deviceName
text
Methods:
ConnectUSBPrinter
Connect to the USB printer connected to the device
IsPrinterReady
Validates if is printer is ready to receive printing commands
Return Type: boolean
GetAttachedDevices
Returs a list that contains the usb devices attached to the device
Return Type: list
SendDataToUSBPrinter
Send data to USB printer
CloseConnection
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
ABG
September 1, 2025, 6:05pm
5
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
system
Closed
September 16, 2025, 8:09pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.