Android Question Can the "Printing" library be used to print via Bluetooth?

vecino

Well-Known Member
Licensed User
Longtime User
Hello, that's my doubt, I've been testing but I haven't found any example.
I am referring to this library.
Thank you.
 

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I have a BT printer and was trying to print, but it doesn't seem to show the BT printers, it only shows the LAN and WIFI ones.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
The first thing to solve is can you print from any Android app? If not you have to solve that first.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I don't understand, what I want is to print from my application.
Thank you.
 
Upvote 0

amorosik

Expert
Licensed User
To quote Erel in post 27 of the library

So what did you do so far?

It's not clear what mean 'printer adapter app'
For example for Paperang P1 ther is his app provided from factory
But this is not like a 'printer driver' which allows applications to logically 'see' a printer
Is a classic app, with discovery and printing function
Then, what is exactly a 'printer adapter app' ?
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
What I mean is that if you cannot address and print via blue-tooth to your printer from a non-b4x app, then you have a printer installation problem that had to be fixed prior before you ever can use a B4X application which should print via blue-tooth to your printer.

The specification with Paperang P1 indicate a wireless and not a blue-tooth connection.
 
Upvote 0

amorosik

Expert
Licensed User
What I mean is that if you cannot address and print via blue-tooth to your printer from a non-b4x app, then you have a printer installation problem that had to be fixed prior before you ever can use a B4X application which should print via blue-tooth to your printer.

The specification with Paperang P1 indicate a wireless and not a blue-tooth connection.

"..wireless an not blue-tooth.." ???
Bluetooth IS wireless
In any case, the name of the printer appears in the list of bluetooth devices visible from any phone or tablet, and clicking on it also correctly performs the pairing operation, and therefore the printer is definitely ALSO bluetooth
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
The website is very sparse with information and hidden away there is indeed a bluethooth connection.
But there is also talk of printing a QRCode. Is it sometimes the case that it is an ESC/POS printer. The question is whether your printer is an ESC/POS printer and if you do not take this into account you can put it on tilt very quickly if your printer driver does not take this into account. Switching it off and on and only sending a simple text line and see what happens (printing, printing character, etc.) is the first step. You can also try Bluetooth ESC/POS Printer Class. to see if you can sent any thing to the printer (even with cluttering output, the first step is to see if the printer is receiving something what he tries to print.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Thanks folks, I really have been suffering from random problems with bluetooth printers for several months now, and I am almost convinced that the culprit for all the problems is the printer, which are all the same brand and same model.
I have created several threads lately and they have all been motivated by different problems with those printers, and I'm even embarrassed to ask around here anymore.
I am going to try to get a different printer and hope that it works well because everyone who has participated in the various threads has no problem with their printers, so it makes me believe that the problem is with these damn printers that have touched me.
Thanks again.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
For example for Paperang P1 ther is his app provided from factory
I see the specifications that it supports Bluetooth 4.0 meaning it may be using Bluetooth Low Energy (BLE). Search this forum for BLE Print.

 
Last edited:
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Venico printers have always been difficult to get up and running without any problems. A first tip if something does not go as you expect, you should first turn off the printer, then wait a while and then turn it on again. In this way, the printer (re)starts in the default setting and you overrule any incorrect settings.

I understand from the web site that it seems that the printer is initially only usable in China only or only outside China. The question is whether you were able to activate the printer via the app on the phone and whether you can then communicate on that phone via bluethoot. As long as that has not been successful, you can never connect via the B4X app.

1685955314495.png
 
Upvote 0

amorosik

Expert
Licensed User
Venico printers have always been difficult to get up and running without any problems. A first tip if something does not go as you expect, you should first turn off the printer, then wait a while and then turn it on again. In this way, the printer (re)starts in the default setting and you overrule any incorrect settings.

I understand from the web site that it seems that the printer is initially only usable in China only or only outside China. The question is whether you were able to activate the printer via the app on the phone and whether you can then communicate on that phone via bluethoot. As long as that has not been successful, you can never connect via the B4X app.

View attachment 142607

What mean 'Venico printers..' ?
Anyway, my printer (Paperang P1) is correctly visible from all devices with bluetooth interface
Also from all B4X programs using the various libraries
Even the phase of connection to the printer is successful
But then, sending even just strings of text nothing happens
While with the Paperang app, on smartphone or tablet, the printer works correctly
As far as I know, there is no 'debug' mode or anything like that that allows me to understand what the printer 'sees' when I send text strings
I assume that the printer does not understand the 'esc/pos' protocol and therefore probably has a proprietary programming language
I would need a bluetooth sniffer to understand what the Paperang app sends to the printer and replicate it
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
What mean 'Venico printers..' ?
I started the line with de name of the poster of the first question.😅😂

What is also interesting is whether you can simply print via Bluetooth without WiFi and without a data bundle connection. If that is not the case, it means that all print traffic goes through a central Internet server (in China).

Update: Google Playstore writes "No internet required. Print easy as "share". Print service plugin."
So you need to install successfully the app to use the printer.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
As far as I know, there is no 'debug' mode or anything like that that allows me to understand what the printer 'sees' when I send text strings
If you tried out some code examples in this forum, I believe you will be able to see the data received in B4A logs. Have you tried the example I attached in the link I share above and read the whole thread? There are some apps that you can also download to test BLE peripherals.
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Cant you use the share function and then select BT (and then the printer)?
 
Upvote 0

amorosik

Expert
Licensed User
So, tests performed on both smartphones and Samsung tablets
The printer is detected when I turn off/enable bluetooth on my phone/tablet
The pairing takes place correctly, and therefore I see the printer among the 'associated devices'

Using Aeric example with library BLE2 doesn't connect to printer, doesn't see it after pressing SCAN&CONNECT, then i assume that ble is not usable with Paperang P1

Using the example of Star-Dust, and clicking on the Bluetooth option (there are Bluetooth, Ble, Usb, Lan) the "Wait search..." starts and after a few seconds the name of the printer appears correctly on the right, and on the window of log of B4A
I also correctly see the address made up of six pairs of hexadecimals
If I click on the printer name on the right, the "Ready to print" message appears and therefore I assume that the printer responds to the program's request
Then if I press the TEXT or IMAGE key nothing appears because the library is in demo version and therefore it does not send anything to the printer

But using other routines the process described above is repeated:
- the printer is seen and associated
- the printer address is detected by the program
- the connection request is answered positively
- then when you send any text string the printer does nothing
 
Upvote 0
Top