Java Print on Raspberry

Antwort erstellen

Bestätigungscode
Gib den Code genau so ein, wie du ihn siehst; Groß- und Kleinschreibung wird nicht unterschieden.
Smileys
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[url] ist eingeschaltet
Smileys sind eingeschaltet

Die letzten Beiträge des Themas
   

Ansicht erweitern Die letzten Beiträge des Themas: Java Print on Raspberry

Re: Java Print on Raspberry

von pichel » Sa 5. Jan 2019, 18:41

Hello,

the number of digits for the time is not sufficient for the small width of the receipt. You should specify in the template the number of digits. For example use

Code: Alles auswählen

d:llllllllllllllllll;s:   ;a_#:rrrrrr
in the template to achieve that the time stamp and the id of the receipt are both completely visible in the line.

Regards,

Stefan

Re: Java Print on Raspberry

von bocko » Mi 5. Dez 2018, 04:51

pichel hat geschrieben: Fr 16. Nov 2018, 22:45 You need to specify a baud rate that the Com2USB adapter can handle.
In windows it is set to 56000 and working, how to set a baud rate in linux on Raspi?

"To check if the printer works at all with your adapter in the middle"
it is not my adapter, it is a built in adapter by manufacture, it is inside, not reachable
And yes it works with your sw in windows

"please test on Windows with the driver of the printer. Can you print out the content "
Here are 2 bills printed with your sw on that printer, it works good
https://imgur.com/a/YYrNASK

but as you can see on the left bill time and date is
"27.10.2018. 06:1" and the last digit is missing, i duno why
when i remove on the left bill in the same line on the left side ID of a bill on right is #15
the time is correct, why?

Re: Java Print on Raspberry

von pichel » Fr 16. Nov 2018, 22:45

You need to specify a baud rate that the Com2USB adapter can handle.
There should be a code page for German character set.
Rest of parameters do not say anything about the protocol.

To check if the printer works at all with your adapter in the middle please test on Windows with the driver of the printer. Can you print out the content of a one-line text file?

Re: Java Print on Raspberry

von bocko » Fr 16. Nov 2018, 22:22

I am not sure which DIP should I move here is a pinout

https://imgur.com/a/3Ouchv3

Re: Java Print on Raspberry

von bocko » Mi 14. Nov 2018, 02:18

Yes you are totally right, I admire your knowledge, really

The printer is Datecs EP60, and you are right it doesnt use straight USB , it is actually working through COM port and it uses built in Converter to USB.
I know that because in Windows you must first install USB to serial driver and then install printer on COM port even it is USB connection.

It has DIP switches I will try to set it up on ESC/POS

Thanx very much

Re: Java Print on Raspberry

von pichel » Mo 12. Nov 2018, 20:10

Hello,

is the error message of the print server the same after you changed the values in the config.json?

The output of lsusb is a bit strange. Typically I would expect a print device being shown. Maybe this time it is a USB adapter that is registered. Or have you connected the printer with a converter like paralell to USB, or such?

Some printers have switches to select the mode they work in. If this is the case, you need to switch to ESC/POS. These switches are often mini switches, that you can reach when you open the device. In this case the documentation should give more information.

Which printer is it, that you use?

Best regards,

Stefan

Re: Java Print on Raspberry

von bocko » Sa 10. Nov 2018, 23:25

I found vendor id and product id, change it, and now I got this

Read: config.json
Instance: 1
Config: Config [printersize=32, vendorid=0403, productid=6001, currency=Euro, decpoint=,, companyinfo=RESTAURANT
DALMACIJA GRILL
Habelschwedter Allee 1
14195 Berlin
Tel.:030 / 831 43 34
Täglich geöffnet von 12-23 Uhr, escinits=[27, 64, 27, 116, 0], escposts=[29, 86, 66, 10, 27, 64], printcode=123, baseurl=http://localhost, baseusername=, basepass=, verbose_closing_summary=1]
Scaled from 640 to width: 384 by scale 0.6
Print Receipt Job: 1
Endpoint: 2
809 bytes sent

But nothing printed, is that ok???

This ls usb with no printer attached
^Cpi@raspi:/usr/local/bin $ lsusb
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspi:/usr/local/bin $

This lsusb with printer attached and on
pi@raspi:/usr/local/bin $ lsusb
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspi:/usr/local/bin $

This line is added
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
0403 is vendor id
6001 is product id

I changed config file to
}
"instance" : 1,
"vendorid" : "0403",
"productid" : "6001",
"printersize" : 32,
"printcode" : "123",
"baseurl":"http://localhost",
"baseusername" : "",
"basepass" : "",
"escinits" : [ 27, 64, 27, 116, 0 ],
"escposts" : [ 29, 86, 66, 10, 27, 64],
"useeveryprintdevice" : 0,
"verbose_closing_summary" : 1,
"smallformat" : 0,
"logoscale" : 1.0
}


This lsusb -v

Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x6001 FT232 USB-Serial (UART) IC
bcdDevice 6.00
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 90mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 2
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

Re: Java Print on Raspberry

von pichel » Sa 10. Nov 2018, 22:32

Hello,

in the lsusb output I cannot see any printer being connected to the USB port. Are you sure that you run lsusb when the printer was connected and turned on?

Please try again. lsusb will output vendorid and productid. If you do not know which of the values is meaning what you may call "lsusb -v" which will give a verbose output.

Once you know vendorid and productid you need to change the vendorid and productid in the config.json as well as setting the entry "useeveryprintdevice" to 0.

Best regards,

Stefan

Re: Java Print on Raspberry

von bocko » Sa 10. Nov 2018, 15:09

This is the content of config.json, i didnt change anything from download
{
"instance" : 1,
"vendorid" : "4348",
"productid" : "5584",
"printersize" : 32,
"printcode" : "123",
"baseurl":"http://localhost",
"baseusername" : "",
"basepass" : "",
"escinits" : [ 27, 64, 27, 116, 0 ],
"escposts" : [ 29, 86, 66, 10, 27, 64],
"useeveryprintdevice" : 1,
"verbose_closing_summary" : 1,
"smallformat" : 0,
"logoscale" : 1.0
}
This is lsusb, i think there is printer on Device 004

pi@raspi:~ $ lsusb
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspi:~ $

Re: Java Print on Raspberry

von pichel » Sa 10. Nov 2018, 13:48

Hi,

I assume you did not set the printer parameters correctly in the config file for the Javaprinter (vendor ud, product id, and flag useeveryprinter=0)

Please send me output of lsusb while printer is connected and the content of the config file.

Regards,

Stefan

Nach oben