Documentation for Javascript API

A Amey BHATKAR 2 years 11 months ago
186 3 0

Is there a document, post or a link from Zebra officially to explain how we can communicate with the printers with WebSocket using JavaScript as a language?

I have checked quite a few links and documentations from the Zebra web site, but was unable to print anything through a ws connection.

I was able to receive the discovery message after the Main channel was opened:
{
"discovery_b64" : "OiwuBAIBAAFaQlIAAFgAAAA ..."
}

But after that, I was unable to connect with either a Raw Channel or a Configuration Channel, and thus unable to print anything from Javascript in the end.

It would be a great help if you can send the official documentation or even blogs (I couldn't find any) which specify on how I can print with JavaScript.

Thanks in advance.

Please register or login to post a reply

3 Replies

A Amey BHATKAR

We have read the documentation available online here
https://www.zebra.com/content/dam/zebra/software/en/application-notes/a…

The details on our tests :

We have created our proper webSocket server node.js, with our endpoint
We have launched the webSocket server
We have configured the printer to connect on our endpoint with a tool jar
We see on our log the packet { "discovery_b64" : "OiwuBAIBAAFaQlIAAFgAAAA ..." }. It means the printer is connected on the Main Channel.
Then for printing, we try to open the raw channel with the command in JSON : { "open" : "v1.raw.zebra.com” } , sent on the Main channel.
Normally we must receive the message { "unique_id" : "XXXYYYZZZ", "channel_name" : "v1.raw.zebra.com", "channel_id" : "2" } but we receive nothing, and the websocket client disconnects, with the error 1003.
On documentation the explanations about the error 1003 are : « However, the printer only supports Binary frames. If the printer receives text frames it will terminate the connection with response code 1003 indicating that only binary frames are acceptable. » …

The question : why after sending the command { "open" : "v1.raw.zebra.com" }, the printer disconnect from webSocket server ?

PS: We converted the JSON command in Base 64 and Binary for sending to printer after reading the point 7 above, but that resolved nothing.

B Brian Moore

Amey,

The documentation that you are looking for can be found in the Link-OS Multiplatform SDK | Zebra

Once this is installed, the websocket documentation can be found at the following path (assuming you installed to C:\)

C:\Program Files\Zebra Technologies\link_os_sdk\Webservices\v2.14.5198\documentation\Weblink WebSocket Endpoint Configuration.pdf

Thanks,
Brian Moore
Software Engineer Kutir Mobility
Posted on behalf of Zebra Technologies

S Sander Roest

The document you are referring to does not help to decode the discovery_b64. It contains binary data and the specifications can not be found.

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