How to reach my LAN printer

In my LAN I’ve a thermal printer with an embedded web server.
The printer accepts a data packet in XML format that can contain commands and data to be printed.
I would like to know if any of you have experienced such a scenario with success.

Many thanks!! :slight_smile:

Are you familiar with Apps Script?
I’d imagine it would be fairly trivial to craft an XML payload and send it across using UrlFetchApp.fetch

Probably the biggest challenge would be getting the packets to your printer. If it’s on your local LAN, then you’ll need to either give it a routable IP address, or setup some port-forwarding on your gateway router.

1 Like

Hola @Roldy

@Darren_Murphy is a master on AppScripts but if you are looking for something less techy check this post out and see if that’s what you’re looking for.

1 Like

Yes I’m familiar with Apps Script
I would like to stay in the Glide realm, but I don’t think it’s possible using webhooks either. Can you confirm?

You could send a webhook to Integromat, and then use the Integromat HTTP module to send the XML payload, I guess.

2 Likes

Grazie @Santiago_Perez1 I have read but that scenario does not seem applicable due to the necessary delay in printing that would occur. I need a real-time printout after clicking on the button.

1 Like

How many seconds do you think it takes before printing takes place in this case?

I’d say it would be surprisingly fast. I’ve done tests where I’ll have an action that:

  • Sends a webhook to an Integromat scenario that updates a row in a GSheet, and
  • Does a Set Columns on the same sheet

Consistently, the update from Integromat always arrives in the spreadsheet before the same update from Glide.

So the Integromat option is probably a better option than the Apps Script option, if speed is the primary concern.

3 Likes

Thanks @Darren_Murphy I will try in that direction

Seeing the integromat purchase plans, I notice that a one minute wait (standard plan) will be necessary between one print and the next. It might be eligible in my scenario, but it’s not the best. :thinking:

I think that’s only if you’re polling, but you’d be using a webhook.

1 Like

Well, that’s interesting. I was just about to disagree with you, but then I checked at Pricing | Integromat, where I found:

The reason I was about to disagree with you is that we have a scenario in @Mark_Turrell’s Covessa project that’s driven by an incoming webhook from Glide, and a few days ago we found that operations were consistently being queued. When I investigated, I found that the queuing always seemed to happen when we had two or more webhooks arriving in the same one minute cycle. So I arrived at the conclusion that we were being bitten by the one minute minimal interval. And certainly, since we’ve dialled down the frequency of the webhook, the queuing has stopped…

Screen Shot 2021-07-04 at 10.32.38 AM

June 29 was when the queuing was happening the most, and we had 1881 operations on that day (more than the number of minutes in a day - 1440).

So now I’m not so sure, and I’m almost inclined to contact Integromat support and seek clarification. :thinking:

4 Likes

I think that you should @darren because we do not experience that and we are using LOTS of webhooks. Let me know.

2 Likes

I do think , however, that webhooks arriving at a specific scenario will be serialised, so that might account for your experience assuming the webhook takes some time to complete. Don’t quote me on this but I’m pretty certain it’s correct.

2 Likes

Yeah, I think you’re right. Although this particular scenario typically takes 1-2 seconds to complete…

2 Likes

Hola @Roldy

If you want to know how fast a command is received by a device from an APP using a Webhook I can tell you that is fast!
I can say that around 3-5 sec your device should be receiving the data.

Your case seems similar to my IoT demo APP although I don’t use a web printer or Integromat, in my case I used an IoT device and IFTTT service.
In this thread you can see the video and check how fast the data and feedback are sent/received:

My APP doesn’t control a printer or send a document to be printed but it is able to control a monitor/TV which is turned on when a new order is received and is turned off when all orders were approved from APP.

With regard to Integromat’s minimal interval set to 1 min, this would apply if you set a timer trigger to your scenario to make an HTTP call periodically (a polling operation) but I think it’s not your case due to your printer doesn’t call or read data from your APP, your APP is who sends data to printer asynchronously.

Just for curiosity: what brand/model is your printer? I like this kind of problems!! :wink:

Feliz día!

2 Likes

I thank you all for giving me your point of view and sharing your direct experience. Now I can better orient myself to find a solution to the problem.
@Darren_Murphy thank you for your disagreement / agreement :slight_smile: I hope you and @Mark_Turrell are able to fine-tune the Covessa project, as it seems to me worth every effort. Please let me know how your research went with integromat support.
:astonished: @gvalero I am fascinated by your work with IoT devices!
The printer is a fiscal meter and the APP is a Point of Sale that I developed for a small chain of shops.
This is the printer model: https://www.custom.biz/en_GB/product/hardware/printers/pos-printers/kube-ii
Therefore the use is in the context of retail shops, for this reason it is important that the receipt is issued in real time (or almost).

3 Likes

Thanks @Roldy and great idea what you have.

I think I have seen this fiscal printer in my country but I couldn’t see its right info due to your link forbids seeing the page outside your region (Europe/Italy) :upside_down_face:

Is it the Kube II? I try to find out the section about TCP/IP and XML support.

Saludos

1 Like

Yes it is! The exactr model name is: Kube II-F Eth.
I’ve a guide for the embedded web services but is in italian. Let me know if you want and I’ll send you!

Yes please!

Let me learn about this device

1 Like