Hi everyone,
I'm trying to send a certificate file .NRD using a Python Socket and ZPL commands. At this moment the printer (ZT411) receives the file but it's not working. This certificate is used for weblink, i'm trying to send it to multiple devices to the same time. I think that my ZPL command is wrong or i skipped a step. Can anyone help me to understand if i need someting else?
This is my code:
import socket
import os
from _thread import *
from flask import Flask, request
import re
import zebra
def zebra (cert_test, hosts):
port = 9100
for host in hosts:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
result = s.connect_ex((host, port))
print(result)
if result == 0:
s.send(str.encode(cert_test))
print (s.recv(1024)) #ACK
return (" [*] Port " + str(port) + " open!" + host)
else: return("[+] CLOSE HOST " + host + ":" + str(port))
except:
pass
hosts = ['10.XX.XX.XX']
#I'm sending the certificate in binary format Example: "2D2D2D2D2D424"
cert_test = cert_test = "^XA~DYE:WEBLINK1_CA,A,NRD,2182,,A,<My Cert in Binary>^XZ"
zebra (cert_test,hosts)
3 Replies
Hi everyone,
Now i'm using another method, sending the whole file over a tcp socket with a .zpl file. But the result it's the same, the printer don't read the certificate. Can anyone help me?
prueba.zpl file
The printer needs a reset in order to read the cert file. Can you try to FTP the cert to the printer's E: drive to see if the printer reads the cert file? If the printer still doesn't read the cert file after the FTP, it might be the cert file is not valid.
Thanks Steven i will try with other Cert.