Printer Setup for the SendFileToPrinter API
To connect to Zebra Data Services cloud, the printers are required to use the Weblink/WebSocket. Zebra Link-OS printers are featured with Weblink/WebSocket capability. Make sure that you have Link-OS printers when using Zebra Data Services cloud platform.
Download the Printer Weblink Configuration String
- Download the Weblink configuration string by clicking on Add Device button on My Devices page at https://developer.zebra.com/my-devices. To access My Devices page, you need to log into your developer account.
- The Weblink configuration string is in JSON format. See an example of the Weblink configuration string below.
- Replace the value of query parameter r (The r in weblink.ip.conn1.location must be in lowercase) with your printer enrollment code, an auto-generated code by clicking on Add Device button on My Devices page.
{}{
"weblink.logging.max_entries":"500",
"weblink.ip.conn1.location":"https://savanna-device.zpc.zebra.com/weblink/connect?r=a6f47ecf23e841c8f5c94f82c3d2ede8",
"device.reset":"1"
}
The above JSON string can be sent to the printer as a file to configure weblink.ip.conn1.location by using the Printer Setup Utility for Windows, Android or iOS.
Notes:
- There should be no space between the braces in the above JSON string, i.e. no spaces in "{}{".
- You can have two Weblinks configured at the same time on a Link-OS printer, i.e. weblink.ip.conn1.location and weblink.ip.conn2.location. However, they cannot point to the same Weblink URL. If they point to the same Weblink URL, they will cancel each other’s connection and cause a ping-pong effect. Refer to the Using Weblink section in ZPL Programming Guide for additional info.
- Zebra Data Services only supports one Weblink connection per Link-OS printer at a time. You can only use one Weblink on the printer to connect to Zebra Data Services. The other Weblink can be used for other services.
- Make sure the previous Weblink configuration is not unintentionally overwritten. The following commands can be used to check if the Weblinks are already in use, before overwriting either one of them with the JSON configuration string.
{}{
"weblink.ip.conn1.location":null,
"weblink.ip.conn2.location":null
}
! U1 getvar "weblink.ip.conn1.location"
! U1 getvar "weblink.ip.conn2.location"
- Unregister and disconnect the printer
{}{
"weblink.ip.conn1.location":"",
"device.reset":"1"
}
By passing an empty string ("") to the weblink.ip.conn1.location, the above JSON configuration string will remove the Weblink URL and disconnect the Weblink connection from weblink.ip.conn1.location. You can do the same for weblink.ip.conn2.location, if it is configured for connecting to Zebra Data Services cloud platform. NOTE: When removing or reconfiguring a Weblink URL, please be cautious to not impact or disrupt other applications use of the Weblink connection.
Send the Weblink Configuration to the Printer
Send the JSON configuration string to the printer as a file by using the Printer Setup Utility for Windows, Android or iOS. The Printer Setup can also be used for setting up the networking configuration on the printers.
Use Printer Setup for Windows to send the configuration to the printer
- Download and install the Printer Setup for Windows from here.
- Connect the printer to the PC, then launch the application.
- Select the printer and click on Open Printer Tools button.
- Click on Settings and navigate to the Weblink configuration file in Send file field. (With older version of printer driver, click on Action tab and select Send file from the list, then navigate to the Weblink configuration file.)
- Click on Send button.
Use Printer Setup for Android or iOS to send the configuration to the printer
- Download the Printer Setup app from the Google Play or Apple App Store.
- Store the Weblink configuration string as a file on the mobile device.
- Launch the Printer Setup app and connect to the printer
- Click on Available Files option and navigate to the location where the file is stored.
- Select the file and click on Send to Printer.
Once the Weblink configuration file is sent, the printer will take a reset to make the configuration effective. This takes a couple of seconds. Assuming the printer is already connected to the internet either through a WiFi or wired network connection, then the printer will connect to Zebra Data Services cloud once it completes the reset.
Notes:
Use the following SGD command to check the Weblink log and verify whether the printer is connected to the Zebra Data Services cloud.
! U1 getvar "weblink"