Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not printing or not detecting any printer maybe #1

Open
mu-irshad011 opened this issue Nov 10, 2022 · 6 comments
Open

Not printing or not detecting any printer maybe #1

mu-irshad011 opened this issue Nov 10, 2022 · 6 comments

Comments

@mu-irshad011
Copy link

I am using TSC TTP-244-pro Thermal printer(3 mm). I am using same native module and same code. But nothing happens when clicking on Print. Please help.

@omdxp
Copy link
Owner

omdxp commented Nov 10, 2022

Hi @mu-irshad011 !

  • for the windows package I'm using ESCPOS so make sure if it's installed in the windows solution (opening up the solution in Visual Studio will do the trick).
  • in this repo I am using a hard written address here because the printer I was working on at the time it uses this address in a local network, so you may need to check what's the address your printer uses in a local network (if it supports it) and make sure your windows machine to be connected in the same network as your printer's.
  • if your printer does not support printing via network you may need to change the native code to work with serial communication.

Hope it helps!

@mu-irshad011
Copy link
Author

Hi @mu-irshad011 !

  • for the windows package I'm using ESCPOS so make sure if it's installed in the windows solution (opening up the solution in Visual Studio will do the trick).
  • in this repo I am using a hard written address here because the printer I was working on at the time it uses this address in a local network, so you may need to check what's the address your printer uses in a local network (if it supports it) and make sure your windows machine to be connected in the same network as your printer's.
  • if your printer does not support printing via network you may need to change the native code to work with serial communication.

Hope it helps!

Firstly, I appreciate that you replied. I have already installed ESCPOS package already. I will try to connect with local network if it supports but I need your help. I have connected printer with USB. So how can I work with this? If printer has bluetooth support then how can we work with that? Also you have typed static address. But if we need dynamic address how can we get that? Please help. Thank you.

@omdxp
Copy link
Owner

omdxp commented Nov 10, 2022

If you want to work with serial communication you just need to change the address value to something like COM3 (you can check the usage here) or even LP1 communications.

I have used a static address because I was connecting to the printer's network which is always the same address (got that info from their manual).

In order to work with dynamic address you first need to search for connected devices and I would suggest you to try search for it on the constructor (also it's good idea to have a button that refresh the list of devices). However, you may need another NuGet package for that.

Also, one thing if you have a POS printer from a supported manufacturer (Epson ESC/POS) for Windows you don't have to install a third package to connect to it. Windows SDK has a namespace specifically for POS devices which includes all necessary thing for POS (printer, cash drawer, ...), you can check the details here.

@mu-irshad011
Copy link
Author

mu-irshad011 commented Nov 11, 2022

If you want to work with serial communication you just need to change the address value to something like COM3 (you can check the usage here) or even LP1 communications.

I have used a static address because I was connecting to the printer's network which is always the same address (got that info from their manual).

In order to work with dynamic address you first need to search for connected devices and I would suggest you to try search for it on the constructor (also it's good idea to have a button that refresh the list of devices). However, you may need another NuGet package for that.

Also, one thing if you have a POS printer from a supported manufacturer (Epson ESC/POS) for Windows you don't have to install a third package to connect to it. Windows SDK has a namespace specifically for POS devices which includes all necessary thing for POS (printer, cash drawer, ...), you can check the details here.

As per this I referred your references and tried but nothing works. I used (COM3, COM2, LPT1, LP1). But no one responded. What can be the issue? It is not detecting the printer or something? Also windows SDK need to install or something like that?

I am using react-native & react-native-windows at latest version which is 0.70.x. is this issue?

@mu-irshad011
Copy link
Author

However the issue is now something else. It shows Access to the path "C://..../esc_pos.temp" is denied. As per this it is creating temp file. Am I right? So how to deal with this? Even I had given access by right click on c drive and then properties and so on. But nothing works. Can you please help?

@omdxp
Copy link
Owner

omdxp commented Nov 11, 2022

You have to know why port your printer is using COM1 or COM2 ... etc. For Windows SDK you don't have to install it, the namespace comes with the SDK but as I told you, your printer have to be supported otherwise you cannot work with it and you have to use third party providers.

As for your issue about the access, I actually didn't face it but I can give you some suggestion like in general. If your app needs any permission you should go to VS and go to Capabilities and check whatever your application needs (it can be found in the app manifest)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants