Read ZD220T status using Python

// Expert user has replied.
R Rafael Nicolay 3 years 6 months ago
379 2 0

Hello!
I'm currently sending a label to a ZD220T printer using Zebra package in Python. It works fine.
But how do I read the status of the printer to check if I'm able to send a label to it?
I'm aware of the ~HS command. But how do I send this command and get a response?
Thanks!

Please Register or Login to post a reply

2 Replies

M Manuel Caicedo-Rivera

Hi,
Theoretically, You could add bi-directional by wraping some of our Link-OS communication APIs available in Java or C#, or in the future through RESTFul APIs. However, there are some complexities involved, so it should be recommended to work with the driver option that you are using without bi-directional communication. The advantage of the API in Java is that you could use it through different OS. 
Here, a link of how to research to do it.
https://stackoverflow.com/questions/3652554/calling-java-from-python
Here, a link where you can download the Zebra Multiplatform SDK, it contains C# and Java options, so you can try your-self, we don't support any wrapping APIs. 
https://www.zebra.com/us/en/products/software/barcode-printers/link-os/l...
https://techdocs.zebra.com/link-os/2-14/pc/content/com/zebra/sdk/comm/Tc...
https://techdocs.zebra.com/link-os/2-14/pc/content/com/zebra/sdk/comm/Us...
Another way is through our SendFileToPrint Cloud-Api, so you can wrap it in Python as well. However, it is unidirectional API. We are planning to release some bi-directional Cloud APIs in the future, but not in the short term. Here, some links below for your investigation for this type of integration.
https://developer.zebra.com/apis/sendfiletoprinter
https://www.nylas.com/blog/use-python-requests-module-rest-apis/
https://realpython.com/api-integration-in-python/
https://towardsdatascience.com/restful-apis-in-python-121d3763a0e4
Thanks,
MC

M Manuel Caicedo-Rivera

Hi, 
Zebra has not developed a Python SDK library yet, but there is a proposal in the market that you could use, I'm not sure if this is that one you are using. Please, search the link below for more details. However, if the library is using the win2print command means that it is using the driver and you cannot use bi-directional comamnds with it. You can send raw info to the printer, but it won't receive anything back. If the OS is Linux or MacOSX , the SDK expects you to use CUPS drivers. 
https://pypi.org/project/zebra/
Thanks, 
MC

CONTACT
Can’t find what you’re looking for?