exile
Posts: 3
Joined: Thu Oct 17, 2019 1:52 pm

Reading a signal USB port only

Thu Oct 17, 2019 2:02 pm

Hi,

I'd like to read from a printer which is sending a usb signal and use it on the RPi3 with a Python script.

My printer is connected directly on the RPi3 on usb and I don't want to use Serial USB Converter.

Thanks for help

Best regards

User avatar
topguy
Posts: 6607
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Reading a signal USB port only

Fri Oct 18, 2019 9:06 am

I'd like to read from a printer which is sending a usb signal and use it on the RPi3 with a Python script.
You should give more details about the printer, doing low-level USB communication is not easy.
What does the Pi say then you connect the printer with USB ? ( plug the printer in after boot and look at the last lines of the output from "dmesg" command )

exile
Posts: 3
Joined: Thu Oct 17, 2019 1:52 pm

Re: Reading a signal USB port only

Fri Oct 18, 2019 9:34 am

Printer is CITIZEN S651.

When I connect the PI to printer, dmesg command say :

[ 206.952462] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[ 207.085926] usb 1-1.5: New USB device found, idVendor=1d90, idProduct=2028
[ 207.085944] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 207.085953] usb 1-1.5: Product: Thermal Printer
[ 207.085961] usb 1-1.5: Manufacturer: CITIZEN
[ 207.085972] usb 1-1.5: SerialNumber: 00000000
[ 207.132202] usblp 1-1.5:1.0: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x1D90 pid 0x2028
[ 207.133219] usbcore: registered new interface driver usblp
[ 208.736322] usblp0: removed
[ 208.743752] usblp 1-1.5:1.0: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x1D90 pid 0x2028
[ 208.757016] usblp0: removed

User avatar
topguy
Posts: 6607
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Reading a signal USB port only

Fri Oct 18, 2019 12:57 pm

Its a little bit worrying that it reports:

Code: Select all

[ 208.736322] usblp0: removed
[ 208.743752] usblp 1-1.5:1.0: usblp0: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x1D90 pid 0x2028
[ 208.757016] usblp0: removed
I'm assuming that you didnt yank the cable out again after inserting it..
Its interesting to run the "lsusb" command and "ls -l /dev/usblp*" to see if its still logically connected to the Pi.

I'd like to read from a printer which is sending a usb signal and use it on the RPi3 with a Python script.
But Ideally when the device is connected, you can read whatever the printer sends from "/dev/usblp0"
But since its a printer I would assume you would be more concerned with writing to it...

exile
Posts: 3
Joined: Thu Oct 17, 2019 1:52 pm

Re: Reading a signal USB port only

Fri Oct 18, 2019 1:13 pm

Thanks for reply,

lsusb command :

Code: Select all

Bus 001 Device 007: ID 1d90:2028
Bus 001 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ls -l /dev/usblp* command :

Code: Select all

pi@raspberrypi:/BorneJeu $ ls -l /dev/usblp*
ls: impossible d'accéder à /dev/usblp*: Aucun fichier ou dossier de ce type
And I'm more concerned with read information from printer. The CITIZEN printer can detect end of paper and I need to retrieve this.

User avatar
DougieLawson
Posts: 39543
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Reading a signal USB port only

Fri Oct 18, 2019 1:49 pm

The Linux kernel can't find a device driver for your Citizen 1d90:2028 device. So it may not be supported on ANY Linux systems ARM, AMD or Intel based.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

fruitoftheloom
Posts: 23813
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Reading a signal USB port only

Fri Oct 18, 2019 1:59 pm

exile wrote:
Fri Oct 18, 2019 1:13 pm
Thanks for reply,

lsusb command :

Code: Select all

Bus 001 Device 007: ID 1d90:2028
Bus 001 Device 005: ID 046d:c31c Logitech, Inc. Keyboard K120 for Business
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ls -l /dev/usblp* command :

Code: Select all

pi@raspberrypi:/BorneJeu $ ls -l /dev/usblp*
ls: impossible d'accéder à /dev/usblp*: Aucun fichier ou dossier de ce type
And I'm more concerned with read information from printer. The CITIZEN printer can detect end of paper and I need to retrieve this.

If it is a CT-S651, Citizen list a driver:

https://www.citizen-systems.co.jp/engli ... index.html
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

Return to “Automation, sensing and robotics”