react-native-bluetooth-escpos-printer
react-native-bluetooth-escpos-printer copied to clipboard
SUNMI Bluetooth Printer
Hi,
I used your package januslo/react-native-sunmi-inner-printer
to Print in INNER SUNMI Printer.
I used also your package januslo/react-native-bluetooth-escpos-printer
to Connect to EXTERNAL SUNMI Printer via bluetooth.
They are working fine. Thanks.
Can I use this package react-native-sunmi-inner-printer
to connect to bluetooth printer?
Or using this one react-native-bluetooth-escpos-printer
to connect but print with this one react-native-sunmi-inner-printer
?
Thanks in advance.
could you please help me with inner sunmi printer implementation? kinda stuck in implemeting this pkg
@waleediqbal224 just follow the steps here https://github.com/suraneti/react-native-sunmi-v2-printer
hey guys, I'm using expo,
I run:
npx expo prebuild
and npx expo run:android
but its throwing errors
anyone know how to solve it?
@matheusbento this package does not support Expo
@amcjml Should I create a react native from scratch?
If you just started the then create it again with React Native from scratch. If not, you should eject the existing Expo project.
On Fri, May 3, 2024, 13:26 Matheus Bento @.***> wrote:
@amcjml https://github.com/amcjml Should I create a react native from scratch?
— Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-bluetooth-escpos-printer/issues/193#issuecomment-2092915919, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXLIYEVX4ZLTXIKUYK425UDZAN66NAVCNFSM5Y33XO3KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBZGI4TCNJZGE4Q . You are receiving this because you were mentioned.Message ID: <januslo/react-native-bluetooth-escpos-printer/issues/193/2092915919@ github.com>
Guys, I was able to create from react native, but I still have an issue here.
If I do something like that:
await BluetoothEscposPrinter.printText(
'TEST\n\r',
{
encoding: 'UTF-8',
},
);
the printer will works but it will not show, but if I do this:
await BluetoothEscposPrinter.printText(
`test2 -\r\n`,
{
encoding: 'UTF-8',
codepage: 1,
widthtimes: 1,
heigthtimes: 1,
fonttype: 1,
},
);
it works but the font size is bigger, I would like some font lower, can you guys help me?
@matheusbento here is the possiblities for font sizes:
Large font size
{
encoding: 'UTF-8',
widthtimes: 1,
heigthtimes: 0,
fonttype: 0,
}
Medium font size
{
encoding: 'UTF-8',
widthtimes: 1,
heigthtimes: 0,
fonttype: 1,
}
Small font size
{
encoding: 'UTF-8',
widthtimes: 0,
heigthtimes: 0,
fonttype: 0,
}
@amcjml
Thanks for you reply, but I tried this way:
await BluetoothEscposPrinter.printText("Hello, World!\r\n", {
encoding: 'UTF-8',
widthtimes: 0,
heigthtimes: 0,
fonttype: 0,
});
the Hello, World doesn't print, I can't see anything.
but now if I change some params like:
await BluetoothEscposPrinter.printText(
"Hello, World!\r\n",
{
encoding: 'UTF-8',
codepage: 1,
widthtimes: 1,
heigthtimes: 1,
fonttype: 1,
},
);
Maybe is an issue on my sunmi v2?
write multiple await BluetoothEscposPrinter.printText()
with different parameter each time to test what is working for you.
Example:
await BluetoothEscposPrinter.printText(
"Hello, World!\r\n",
{
encoding: 'UTF-8',
codepage: 0,
widthtimes: 0,
heigthtimes: 0,
fonttype: 0,
},
);
await BluetoothEscposPrinter.printText(
"Hello, World!\r\n",
{
encoding: 'UTF-8',
codepage: 0,
widthtimes: 1,
heigthtimes: 0,
fonttype: 1,
},
);
// and so on...
Yep. I tried, just this way I mentioned for you worked.
But this is a large font, I need a small size.
Do you had the same issue before?
The possiblities for font sizes I showed you is working for me.
Which version of sunmi are you working with?
We are working with a package created by us by making changes to the original package. https://www.npmjs.com/package/react-native-ec-thermal-printer Sorry I forgot about this. There is no documentation at this moment. But you can check the EcThermalPrinterInterface in EcThermalPrinter.ts file.
great, thanks @amcjml I will test it.
I tested this one: https://github.com/suraneti/react-native-sunmi-v2-printer and it works.
I will test yours, I would like to do something generic to all possible printers.
@amcjml just a question, can you share the github project?
Are you still using Bluetooth or do you find a way to native connect?
@matheusbento yes I'm still using Bluetooth in addition of USB and Network.
Sorry, the project is confidential, I can't share it.
Bluetooth and 2g Wireless use the same radio frequency, if the POS machine doesn't have a great arch, it can become slow, do you already have this issue?
I also have a q2i pos machine, which enables only 2G and not 5G as SUNMI,
The internet connection with that is really slow when turning on Bluetooth for the printer.
@amcjml
@matheusbento no I didn't have this problem before.
@amcjml Does your library supports sunmi v2?
I'm having issues with the current one, it printing really slow.
Yes it support SUNMI V2. I don't have any idea.