The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

I was trying to output to POS printer directly fro 1c:Enterprise, but got error on linux. The same code works fine on windows.
If I output to the same device (/dev/ttyXXX) from the console everything is just fine. So I am confused:
- could it be some behavior that tries to open file with restrictions not available for device files?
- which username does 1c enterprise use to run under linux? (file mode) It could be group restriction

 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Alexey!

In File mode 1C:Enteprise applications run as a current user. And yes, if the user does not have appropriate permissions to write to the device, the operation will fail.

 
#3
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

The user does have appropriate permissions, I can copy file to that device, no error with copying. (same user)

So, I think I need your assistance

You could repeat the error by installing Ubuntu 16.04 and writing to any /dev/tty /dev/usb/lp port using TextWriter Object. Version used 8.3.7.latest

 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Do you use File/Print command or some other option?
Did you try to print using other application?
What do you try to print? MXL or maybe there is some unsupported data by the POS?

 
#5
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

No, I do not use File/Print. I use TextWriter.Write("/dev/ttyXXX") to output to device directly. The same code works fine on windows, there are no problems with forbidden symbols or printer incompatibility. There are also no problem with the user who running 1C:Ent platform to write to this device, it passes every test. The user is inside appropriate group with the permissions needed to write. The problem is just with 1C:Ent platform.
ITS says that under linux I just have to change "COM" -> "/dev/ttyXXX", but It does not work. If you "Echo" to the exact same device it works just fine.

 
#6
People who like this: 0 Yes / 0 No
Active user
1C:Professional
Rating: 6
Joined: May 8, 2013
Company: 1C Company

Hi Alexey,

Could you, please, give me the following additional information on the issue?

1. Can you print anything to the same printer from the same 1C application using standard 1C:Enterprise printing features (rather than TextWriter.Write)? Say, if you run any report and then send it to the printer with "Print" menu command, will it work or not?

2. What is the purpose of sending strings to the printer one by one instead of preparing the entire document and then printing it out with standard "Print" feature?

3. I need a tech log of the issue, so could you, please, do the following:

  • Stop the app one click before the start of the printing procedure
  • Copy the logcfg.xml file (see attached) to the /1cv8/conf catalog on the client computer (the one 1cv8 is run on)
  • Run the printing procedure
  • Archive the content of /var/log/1c/logs catalog and sent it to me

Edited: Konstantin Rupasov - Aug 02, 2016 05:41 PM
 
#7
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Hello Konstantin.

1. There is no point to print normally to this printer because it is a fiscal printer, it accepts special codes like "cut the paper" o "print a barcode", and it is times faster than working directly (without cups subsystem)

2. It is the way it is designed to work. Graphics mode for this printer is very slow and it is not for what the printer is designed.

3. I will make a test PC for this problem, and will provide you with the access.

p.s. call me to provide you more detail.

 
#8
People who like this: 0 Yes / 0 No
Active user
1C:Professional
Rating: 6
Joined: May 8, 2013
Company: 1C Company

1. Alexey, I didn't mean you should change the printing method. I just need more information to diagnose the issue. Can you try printing anything to this printer in more conventional way just for test?

 
#9
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

I haven't tried to use standard printing because there is no need. I have not even install printer driver for graphical interface because it functions like an old matrix printer and these printers do not used in graphics mode.

Moreover on windows if you install printer drivers for the same printer it could interfere and block port for it own (driver) reason and direct printing could fail. Without any drivers on windows outputting to the printer port works just fine. (COM, LPT, net use, Virtual Com and so on)

Also I could confirm that there is nothing blocking 1c to successfully output to the printer port because I could output with echo command some data to the printer port with success while 1c is running. After an attempt to output from 1c the port is blocked, 1c shows error on writing to device file and I need to disconnect the printer to make it available again to write.

While I am preparing a tech. log, could you help me with workaround. Is it possible to run some bash command within 1c in linux?
Another solution could be UPOS interface for 1c. Is there any driver for connecting UPOS devices? O some native component to output directly to some device?

Edited: Alexey Gerasimov - Aug 04, 2016 06:43 PM
 
#10
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Aug 5, 2016
Company: 1C-Poland

Alexey, try to use RunApp command to run bash scripts on Linux

 
#11
People who like this: 0 Yes / 0 No
Active user
1C:Professional
Rating: 6
Joined: May 8, 2013
Company: 1C Company

1. "After an attempt to output from 1c the port is blocked

How do you know the port is blocked? Can you echo anything to the printer after 1C printing attempt?

2. "1c shows error"

What kind of error? Can I see the text?

3. "Is it possible to run some bash command within 1c in linux?"

RunApp should work all right.

 
#12
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Konstantin,
1. No I can't echo to the port after 1c error. I could again after reconnecting the device

2. I can't reproduce exactly error message, but it is like "Error writing to file <file/device name>"

3. Thanks. I'll try this.

Aldo thanks to Pawlo for the suggestion.

 
Subscribe
Users browsing this topic (guests: 3, registered: 0, hidden: 0)