-
Notifications
You must be signed in to change notification settings - Fork 280
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
Printer Emulator Connection Issue #637
Comments
Hi @rodhoff ! Well, I think you are not using our python-escpos library but some other escpos library written in python. Anyway, your issue looks like a permission problem. Sadly, I can't help you much more. |
Hi @belono ! Sorry for the mistake, I'm trying several approaches to understand why it's not working. I have tried to run this sample code for the python-escpos even though:
And I got the same error message, even running from an elevated powershell:
I'm using VSPE to emulate the COM2 - COM5 pair and the Bematech printer emulator. |
As I'm using VSPE, and emulated a pair of com ports (COM2<=>COM5) I believe it will use COM2 to emulate the printer, and would listen for requests from COM5... When I changed COM2 to COM5, I don't get any error - but don't get anything printed as well... |
It seems that Bematech doesn't support ESC/POS commands, so you can't print with this library on a Bematech printer. Did you choose a Bematech emulator because you have to support a printer of that specific model? EDIT: Some Bematech printers have dual command set support ESCBema/ESCPOS, so you could print with the help of python-escpos. |
Thanks @belono ! No specific reason for using Bematech, it's only that I've found it first. Is there any other reasonable one which you know I could use? |
Depending on your needs, there are some tools more or less related to our library that you can use to check your code is working.
Surely, there are more and maybe better tools to simulate an escpos printer but these are the ones I know. |
I have:
Bug description
As I don't have a thermal printer, I've opted in for using an emulator. I'm currently using VSPE to emulate a pair of COM ports (COM2 and COM5), and then running the emulator for Bematech MP-4200. It runs perfectly. I've used WinTFI2 RAT to send commands to the printer, and it worked fine.
Problem is, for some reason, when I try to send text to print from my python code, I receive errors saying I'm not allowed to use the port.
This kind of confused me, because the printer is connected as expected in the port COM2, but when I access it to send data it says I'm not allowed.
As for the code, I've tried this approach:
If I run it with the printer emulator off, I get no message. If the printer emulated is on, I receive the following error message:
serial.serialutil.SerialException: could not open port 'COM2': PermissionError(13, 'Access denied.', None, 5)
Could you please help to understand why the emulator can't receive the connection?
The text was updated successfully, but these errors were encountered: