SambaPOS terminates abruptly on URLPrinter execution

Can you try removing the quotations from your printer template? I thought that looked odd and it could be causing an issue. Also try changing your token char to $ as well as in your URL format on the printer settings.

This is odd. I just replicated the issue and checked the log. There is nothing there and it closed Samba about 5 seconds after closing the ticket. It also closes the program if you preview the printer template.

I removed the {TICKET ID} still closes.

I tried various ways already, same result.
I think we reached the same conclusion.

Is the URL valid? I downloaded the app to my phone and can’t pull up that bot session.

I pasted the URL to browser and it works fine, I get a message to my bot and a a reply to browser

Okay I have some progress. This is foreign to me since the US doesn’t really use this type of service. Its all SMS. I was able to create a chat bot, create the group and send the message via URL printer without it closing. Just have to see whats causing it.

image

Seems to be working with some situation but not in the other. Are developers monitoring this forum. It would be fairly straightforward to track down as long as there is reproducible scenario.

Okay after further review I think its your chat ID causing the issue. I would state that as everyone has indicated custom integration/development isn’t without its trials and tribulation. Its really on you to make these things work and the community is here to help. Its not a fault of Samba.

I appreciate that fact that SambaPOS provides so many tools and custom options for us to be able to implement these type of process which is dissimilar to other software’s. I work in a very locked down industry and I always love that I can create whatever I want with this system.

@Jesse it does seem odd that Samba is closing without logging any errors due to an unauthorized JSON response from the Telegraph.Org API. I didn’t think that the URL printer did anything with the response and maybe its something that should be reviewed.

Here is the successful setup FYI this bot is now shut down

I’m using:

https://api.telegram.org/bot1718784875:AAGKMTcMVhy3arzZ1ci3ZbyUvWgyNhJJlgg/sendMessage?chat_id=-584589244&text=$message$

To get your chat_id do something like this:

https://api.telegram.org/bot1718784875:AAGKMTcMVhy3arzZ1ci3ZbyUvWgyNhJJlgg/getUpdates

or

image

image

1 Like

Alright, so this comes down to having a numerical chat id instead of the moniker.
Great find. The tutorial would be great help for the future. Thank you for the help.

Its most likely the @ symbol and maybe that needs to be escaped. Either way, with anything that is more custom you need to troubleshoot. This could have easily been fixed with a Google web search and testing the URL string. Its not the responsibility of the community or SambaPOS to build tutorials for all types of API web services.

Please remember the community is here to help, and please contribute/respond to other members.

2 Likes

The steps you provide might be working for you but not for me. The application is still terminating abruptly.
I changed the chat_id moniker with the numerical ID (minus sign in front of it).
Tested the URL in browser and everything fine. In SambaPOS same scenario - application simply terminates with no error message and no log file.
In your tutorial you provide steps to get the chat_id, while the steps are valid for a group, but for a bot you can use this tool Get Telegram Chat ID. How to get a Chat ID of a Telegram
 | by Sean Bradley | Medium.

Here is my current printer setup

Try changing your token char like I said before from @ to $

Recap:

  1. The tutorial referred above by Joseph “How to Create a Telegram Bot and Send Messages via API” is outdated information.
  2. Using moniker or numerical chat id in the URL has the same effect - SambaPOS terminates abruptly.
  3. As of this writing it appears the way to have SambaPOS talk to the Telegram Bot is via script, as per the sample suggested above by Posflow. The drawback of this approach is the amount of coding required. It would be ok if you only need to pass small amount of information.

Dude I don’t know what else to say to you. The URL printer works fine and you aren’t following direction. It also seems that you feel entitled to custom support. This is a community forum. You can email SamaPOS support or pay someone to configure this for you if you can’t troubleshoot your own setup. I don’t work for Samba I’m just a regular user.

I’ll leave you to it at this point.

2 Likes

Dear Joseph
I am hoping we are on the same page as far as finding a solution, getting personal is unlikely to lead to that outcome.

I was merely recapping the situation for whomever ends up reading this thread in the future.

As far as following directions - I did follow the steps you outlined and now double checked them. The steps you outline lead to the same result as before - SambaPOS terminating. There is the possibility that the configuration you are running is different from mine which could lead us to have a different outcome while doing the same thing. As you stated yourself community is here to help, I feel it is quite helpful to state the end result from my end. You can do the same.

This has not been done.

2 Likes

Case and point


5 Likes

Its likely he found a way to configure something that has an output or reaction we did not anticipate.

@indrek I can add this crash to our dev tracker however its unlikely to get immediate attention as we have other much more important projects atm. The only issue I can see is that we did not capture that response for a crash prompt I can not find any URL printer issue with what you have posted. URL printer does work. SambaPOS allows nearly infinite configuration options even we cant predict every way people intend to try and use sambapos. If we tried to fix every single little small nuance with specific user configurations we would never find the time to progress sambapos. We have to evaluate requests and spend time on ones that makes sense for entire community as much as possible.

Forum users are super important to us, as are all users of SambaPOS. But unfortunately our time is very valuable and scarce so we cant always monitor and fix every request right away especially when its only 1 or 2 people with the issue. I hope you can understand that.

2 Likes

Jesse, I understand the limitations. I was a programmer in previous life. I mostly worked for finance institutions and crashing app received an immediate attention. My apologies for expecting the same, I have adjusted my expectations. While widely used due to its price and configurability SambaPOS resembles tool for hobbyists, something along the lines like Linux and DOS were in the early days.

As far as the configuration - what is the most peculiar, it seems my printer configuration is virtually same with joseph. He is referring to the token character as a culprit, however, I have tried various and the result is same for me. I am reasonably confident if he changes his token to @ it will work for him.