Java Print on Raspberry
Java Print on Raspberry
I followed instructions and installed app and it is working, just I can not set up a printer
lsusb shows printer connected, i try command "sudo java -jar javaprinter.jar config.json" I am in javaprinter folder so i didnt give any path and I get this screen
https://imgur.com/a/uKxZgEM
java printer is in /usr/local/bin
config.json i default didnt change anything
Thanx
lsusb shows printer connected, i try command "sudo java -jar javaprinter.jar config.json" I am in javaprinter folder so i didnt give any path and I get this screen
https://imgur.com/a/uKxZgEM
java printer is in /usr/local/bin
config.json i default didnt change anything
Thanx
-
pichel
- Administrator
- Beiträge: 1447
- Registriert: So 13. Sep 2015, 19:48
- Wohnort: Hamburg
- Kontaktdaten:
Re: Java Print on Raspberry
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
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
Stefan Pichel
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Re: Java Print on Raspberry
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:~ $
{
"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:~ $
-
pichel
- Administrator
- Beiträge: 1447
- Registriert: So 13. Sep 2015, 19:48
- Wohnort: Hamburg
- Kontaktdaten:
Re: Java Print on Raspberry
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
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
Stefan Pichel
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Re: Java Print on Raspberry
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
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
-
pichel
- Administrator
- Beiträge: 1447
- Registriert: So 13. Sep 2015, 19:48
- Wohnort: Hamburg
- Kontaktdaten:
Re: Java Print on Raspberry
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
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
Stefan Pichel
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Re: Java Print on Raspberry
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
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
-
pichel
- Administrator
- Beiträge: 1447
- Registriert: So 13. Sep 2015, 19:48
- Wohnort: Hamburg
- Kontaktdaten:
Re: Java Print on Raspberry
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?
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?
Stefan Pichel
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Entwickler der Kassensoftware OrderSprinter (http://www.ordersprinter.de)
Re: Java Print on Raspberry
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?