I have an Epson TM-T88VI thermal POS receipt printer. It has an Android and iOS app, TM Assistant, that takes takes an XML string from an HTTP post and sends it to the printer. It works fine it I just type these commands into the web browser, Safari. But I am unable to automate the process with Deluge in Zoho Creator. I have tried postUrl, openUrl, and invokeUrl, but they all give different errors.
Here is the command I type it into Safari:
This works and the printer says "HelloWorld." This tells me the TM Assistant app is working properly.
Attempt with openURL:
openUrl(urltxt,"same window");
TM Print Assistant returns that the XML string cannot be parsed. This tells me that openUrl is trying to call TM Print Assistant, but somehow the message is getting corrupted or is not being received.
Other Attempts:
I have tried different versions of postUrl and invokeUrl always get an unspecified Internal Exception in Zoho. There is no indication that the TM Assistant App is even being called. Here are some of the variations I have tried, and I've tested both string and map data, with and without header data.
postURL with Map Data and Header:
eposdata="<epos-print><text>HelloWorld</text><feed/><feed/><feed/><cut/></epos-print>";
cmds = Map();
cmds.put("ver",1);
cmds.put("data-type","eposprintxml");
cmds.put("data",eposdata);
header = Map();
header.put("Content-Type","application/xml");
response = postUrl(urltxt,cmds,header,false);
postUrl with Map Data w/o Header:
eposdata="<epos-print><text>HelloWorld</text><feed/><feed/><feed/><cut/></epos-print>";
cmds = Map();
cmds.put("ver",1);
cmds.put("data-type","eposprintxml");
cmds.put("data",eposdata);
response = postUrl(urltxt,cmds,false);
postUrl with String Data and Header:
cmdtxt = "ver=1&data-type=eposprintxml&data=<epos-print><text>HelloWorld</text><feed/><feed/><feed/><cut/></epos-print>";
header = Map();
header.put("Content-Type","application/xml");
response = postUrl(urltxt,cmdtxt,header,false);
postUrl with String Data w/oHeader:
cmdtxt = "ver=1&data-type=eposprintxml&data=<epos-print><text>HelloWorld</text><feed/><feed/><feed/><cut/></epos-print>";
response = postUrl(urltxt,cmdtxt,false);
invokeUrl with String Data and no Header:
cmdtxt = "ver=1&data-type=eposprintxml&data=<epos-print><text>HelloWorld</text><feed/><feed/><feed/><cut/></epos-print>";
response = invokeurl
[
url: urltxt
type: POST
parameters: cmdtxt
];
I could go on with other variations, but I can't seem to get past the Internal Exception when I try postUrl or invokeUrl.
Custom Connections:
invokeUrl has an optional parameter for a connection. I don't understand these things well, but i've wondered if I need to set up tmprint assistant as a connection. The
linked help pages say you can set up a custom connection, but in reality that option does not exist. I could really be off base on this one.
I tried writing to Zoho help, but they pretty much blew me off with no suggestions or assistance. I see many posts on related subjects in the forum, so I'm hoping someone who found out how to do it can give me a hand.