LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-16-2018, 09:07 AM   #1
w00tus
Member
 
Registered: Jun 2017
Location: Mars on the first shuttle available.
Distribution: Debian, Kali, Raspbian
Posts: 44
Blog Entries: 4

Rep: Reputation: Disabled
Rdesktop USB forwarding. Can forward one printer, but not the other.


Hello again, Gurus! It's w00tus, your favorite problem child..

The issue I have today is with rdesktop. Here's the skinny of what I'm working with and what I'm trying to do:

I've got a AIO pc I'm using just to run rdesktop. It's got Debian Stretch installed with LXDE installed, along with rdesktop (obviously, lol) all of it's dependencies and apache2 and cups for extra measure. I'm using the following command..

Code:
rdesktop 192.168.0.21 -f -u guestservices -r printer:MFC-L2740DW -r printer:"Star TSP700" -r usb:MS9520 -r usb:MSR90
Where the last two things are a bar code scanner and a credit card reader, respectively. I took a guess on how to redirect them and it worked.

I'm rdesktopping to a Lenovo server with Windows 2016 Datacenter Edition installed. (It had Debian 9 for two years.. But when we brought it down to the spa, the single most important piece of software that can't be done away with ONLY works on windows..) Everything is connected via LAN/Cat5, no wireless between any thin client and the host server.

The remote works great, program works great, credit card reader and bar code scanner work. Brother Printer works.. Latency is shockingly low considering the only way I could get a network cable to the server was to patch two long ones in the middle with RJ-45 tips and a FF connector and then hop through an old Airport Extreme.

I've installed the Star TSP700 thermal receipt printer drivers to the server exactly as the directions said on the support site, which I've done successfully three times now on three other computers as we where playing musical chairs just to keep the business open for daily operations. Both printers are plugged directly into existing usb ports, not through a hub.

What I think my problem is, is that I just can't get the stupid USB port to forward to the server. It shows up on the "devices and printers" screen exactly as I typed it in the command line from the thin client. But unlike the Brother printer, I can't add a new printer by searching. It simply cannot detect it.

Any ideas?

*update*

I thought, 'maybe I didn't install the drivers right on the thin client running Debian Stretch?' So, in a terminal, I typed..

Code:
lpstat -p
And sure enough, only my Brother printer showed up. So, I headed back over to Star's website and got a fresh new copy of the Linux drivers/firmware, extracted it and started following the instructions:

Code:
libstario
---------

***********
Explination
***********

This is the libstario package, providing the libstario.so component and related development headers.

The libstario.so provides the following functionality:

* Binary input and output communications channels to Star printer and Visual Card devices over serial, parallel, or USB ports
* Status reading from Star printers in a parsed & easy to use format
* Block checked output to Star printers giving the client application the ability to detect printing completion and/or error.
* Hardware reset of Star printers allowing client applications to recover the device back to a know state
* Command transaction execution for Star Visual Card devices allowing client applications to execute Visual Card commands including both tx and rx data.

**********************************
Package usage via makefile targets
**********************************

This project is built and installed using the included makefile.  The following is an explination of the various targets contained in this makefile and what they do:

cmd & target: 'make'
--------------------
Build all project sources and create a new libstario.so component version.

cmd & target: 'make clean'
--------------------------
Clean the project and return it to the initial configuration.

cmd & target: 'make install'
----------------------------
Installs the compiled libstario.so component and related header files.  The libstario.so component is installed (by default) into the /usr/lib directory.  The header files prototyping this component's API are installed (by default) into the /usr/include/stario directory.

Note, this target requires root user permissions to execute.

cmd & target: 'make remove'
---------------------------
Removes any previously installed libstario.so component and related header files.

Note, this target requires root user permissions to execute.

cmd & target: 'make help'
-------------------------
Prints a summary of the various targets contained in this makefile.

******************************************
Device & client application configuration
******************************************

When using libstario, please configure your device and client applications as such:

usb printer or Visual Card
--------------------------
Turn DIP switches 1-5 and 1-8 OFF (under panel on bottom of device, see printer user manual for details).

Applications should pass a string of the following form in the portName parameter to the openPort API:

usb:TSP700;sn:12345678
|   |     |   |
|   |     |   |
|   |     |   |--> usb serial number
|   |     |
|   |     |------> beginning of usb serial number sub-string - optional
|   |
|   |------------> Device ID (one of SP512, SP542, TSP613, TSP600, TSP700
|                                    TSP800, TUP900, TUP992, TCP300)
|
|----------------> beginning of usb portName string

Note, libstario effects usb communications via the libusb architecture; make sure that this is installed.  In addition, Linux allows only the root user to access usb device by default - execute your application under the root account or give user-level access to the device by customizing the hot-plug configuration.

serial printer or Visual Card
-----------------------------
Turn serial interface card DIP switches 1-7 and 1-8 ON (remove interface card from back of printer, see printer user manual for details).

Applications should pass a string of the following form in the portName parameter to the openPort API:

/dev/ttyS0
|        |
|        |
|        |--> serial port number (0, 1, ... n)
|
|-----------> beginning of serial portName string

The portSettings parameter is also required in the following form:

38400,none,8,1,hdwr
|     |    | | |
|     |    | | |
|     |    | | |--> flow control (one of hdwr, none)
|     |    | |
|     |    | |----> stop bits (fixed at 1)
|     |    |
|     |    |------> data bits (one of 8, 7)
|     |
|     |-----------> parity (one of none, even, odd)
|
|-----------------> baud rate (one of 38400, 19200, 9600, 4800)

parallel printer
----------------
Turn DIP switch 1-8 OFF (under panel on bottom of device, see printer user manual for details).

Applications should pass a string of the following form in the portName parameter to the openPort API:

/dev/parport0
|           |
|           |
|           |--> parallel port number (0, 1, ... n)
|
|-----------> beginning of parallel portName string

Note, libstario effects parallel communications via the PPDEV module.  Many distributions install and load this module by defualt.  If the /dev/parport0 node is not present on your system, please install and configure the PPDEV module.

***********************************
Sample application stariotest usage
***********************************

This package includes the a sample client application called stariotest that demonstrates client usage of the libstario component and API.  This sample application is based on QT3, and as such, requires QT3 to be available.

To execute stariotest, enter the stariotest directory and enter the following command: './stariotest'

This will launch the stariotest application.  Use the above application configuration instructions to populate the portName and portSettings fields, then click the 'Open Port' button.  Excercise the API and the device by clicking the various other buttons.

Note, the stariotest application contains functionality not directly exposed by the libstario API.  For example, stariotest support image printing; this is done by generating image printing commands within the stariotest application and then passing those commands to libstario for output to the device.  Please take note of this fact when designing your own application.

Also note that when using stariotest (and libstario in general) with a Star usb device, the application must be run under the root use account (see above for further explination).

******************************
Client application development
******************************

The primary purpose of libstario is to facilitate the development of client applications that control Star printer and Visual Card devices.  Here is a minimal set of steps required to use libstario:

1. Add the line, '#include <stario/stario.h' in your source file(s)
2. Add the '-lstario' compile option to your linker command

The API exposed by libstario is prototyped in the stario.h header file.  Included within this file are explinations of each API function.  Please open this header file and read these explinations while developing your own application.

**********************
Open Source  - License
**********************

All source code for the libstario component and the stariotest application are included in this package.  Please feel free to look at and change this source code at your will.  If you make changes that are usefull, and would like to share those changes, send them to albert at star-m.jp.

libstario is licensed under the GNU Lesser General Public License.  This license is included in this package for your reference.

What the LGPL means for you - a totally non-legal(ly binding) explination:

The LGPL allows you to link your applications with libstario and release your application under any license of your choosing (open or closed source).  This is important to you because, you are NOT forced to open source your application as a result of linking with libstario.

***************
Support contact
***************

My name is Albert Kennis.  I am a proud employee of Star Micronics - the leading manufacturer of POS printers and card products.  I hope that you find libstario useful.  If you have any problems, questions, or suggestions - please email me at:

albert at star-m.jp

*******
History
*******

              Version
Date          (Major.Minor)     Notes
----          -------------     -----
July 16, 2004 0.0               initial public release
And here's where I'm stuck.. (On my screen)

Code:
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make installer
mkdir bin
cat src/installer.in | sed -e 's/(MAJOR)/0/g' | sed -e 's/(MINOR)/0/g' | sed -e 's/(COMPILE)/107/g' > installer
chmod +x installer

root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make install
#installing
/bin/sh: 1: [: Illegal number: 
mkdir -p /usr/include/stario
mkdir -p /usr/include/stario/example
cp -f src/stario.h /usr/include/stario
cp -f src/stario-structures.h /usr/include/stario
cp -f src/stario-error.h /usr/include/stario
cp -f bin/teststario /usr/include/stario/example
cp: cannot stat 'bin/teststario': No such file or directory
makefile:79: recipe for target 'install' failed
make: *** [install] Error 1
I made sure I had the current/right headers installed with:

Code:
apt install linux-headers-$(uname -r)
Grasping at straws currently..

Perhaps I'm not calling the printer by the right name in the rdesktop command line? Or I need to specify the driver.. I read this in the man page for rdesktop:

Code:
-r printer:<printername>[=<driver>],...
    Redirects a printer queue on the client to the server. The <printername> is the name of the queue in your local system. <driver> defaults to a simple PS-driver unless you specify one. Keep in mind that you need a 100% match in the server environment, or the driver will fail. The first printer on the command line will be set as your default printer.

Last edited by w00tus; 11-16-2018 at 12:56 PM. Reason: resolved new issue
 
Old 11-17-2018, 10:09 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,376

Rep: Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756
Quote:
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make installer
mkdir bin
cat src/installer.in | sed -e 's/(MAJOR)/0/g' | sed -e 's/(MINOR)/0/g' | sed -e 's/(COMPILE)/107/g' > installer
chmod +x installer

root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make install
#installing
/bin/sh: 1: [: Illegal number:
mkdir -p /usr/include/stario
mkdir -p /usr/include/stario/example
cp -f src/stario.h /usr/include/stario
cp -f src/stario-structures.h /usr/include/stario
cp -f src/stario-error.h /usr/include/stario
cp -f bin/teststario /usr/include/stario/example
cp: cannot stat 'bin/teststario': No such file or directory
makefile:79: recipe for target 'install' failed
You do not appear to have run 'make', so 'make install' fails.

The Star TSP700 does not appear to be a postscript printer, so you will need to specify the driver.

PS - I do not think that the options ' -r usb:MS9520 -r usb:MSR90' do anything.
 
Old 11-17-2018, 12:21 PM   #3
w00tus
Member
 
Registered: Jun 2017
Location: Mars on the first shuttle available.
Distribution: Debian, Kali, Raspbian
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Code:
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make
libusb not available - exiting
makefile:57: recipe for target 'stario.o' failed
make: *** [stario.o] Error 1
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make installer
make: 'installer' is up to date.
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make install
#installing
/bin/sh: 1: [: Illegal number: (That means it failed, right?)
cp -f src/stario.h /usr/include/stario
cp -f src/stario-structures.h /usr/include/stario
cp -f src/stario-error.h /usr/include/stario
cp -f bin/teststario /usr/include/stario/example
cp -f src/teststario.c /usr/include/stario/example
cp -f bin/libstario.so.0.0.* /usr/lib
ldconfig
ln -sf /usr/lib/libstario.so.0 /usr/lib/libstario.so
Good catch! Tried it again.. No dice..

I'll try and specify the printer next time I can.. At the moment, Windows Server decided I'm not allowed to remote to it anymore. I called a place and they're going to have someone remote in and line all that out in a few hours. So hopefully I'll be back on track today.

I think you're right,
Code:
-r usb:MS9520 -r usb:MSR90
doesn't do squat. What's interesting though, is that rdesktop forwarded those on it's own.. Veeeeery interesting..

Thank you so much now and in advance (if you have the time to revisit)!

Last edited by w00tus; 11-17-2018 at 12:22 PM. Reason: make it more purdier
 
Old 11-17-2018, 05:57 PM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,376

Rep: Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756
Quote:
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make
libusb not available - exiting
makefile:57: recipe for target 'stario.o' failed
make: *** [stario.o] Error 1
It appears that 'make' cannot locate a required library.
 
Old 11-19-2018, 11:39 AM   #5
w00tus
Member
 
Registered: Jun 2017
Location: Mars on the first shuttle available.
Distribution: Debian, Kali, Raspbian
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
It appears that 'make' cannot locate a required library.
I'm guessing that this may be because the packages are so old, either the library reference is obsolete/non-existent or possibly the entire library is in some Boolean cemetery?

I hate it.. But the "feeling" I'm getting is that rdesktop automatically forwards attached devices that are recognized by the host OS with drivers. No drivers and/or recognition = no redirection. Do you think there's any validity to this feeling? If so.. Since I don't have the time to learn what I need to know to either make a library, or somehow find the old code that was referenced and insert it, I may just have to go shopping for a new receipt printer with good Linux support.

*later edit*

I called Star tech support and asked them what they had with modern linux support. They made some suggestions and I'm going to order the TSP100III (futurePRNT) printer and CD3-1616BK58-S2 as a cash drawer. I'll come back to this post once they come in for an update on how well they work with Debian 9 and rdesktop in case someone else googles this thread in the future.

Thanks again for all of your help!

Last edited by w00tus; 11-19-2018 at 03:59 PM. Reason: Updated info
 
Old 11-19-2018, 04:41 PM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,376

Rep: Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756Reputation: 2756
Quote:
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make
libusb not available - exiting
makefile:57: recipe for target 'stario.o' failed
make: *** [stario.o] Error 1
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make installer
make: 'installer' is up to date.
root@guestservices:/home/guestservices/Documents/TSP700/libstario-0.0.5107# make install
To compile the driver, the order of the commands should be: 'make installer', 'make', 'make install'.
 
Old 11-24-2018, 04:49 PM   #7
w00tus
Member
 
Registered: Jun 2017
Location: Mars on the first shuttle available.
Distribution: Debian, Kali, Raspbian
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Thanks for all the help, peeps! Unfortunately, I ran out of time to try everything suggested, though I do still have the printer which I plan to tinker with at a later time in the main office. (So people can check out in there when we're slammed.

The new printer came in yesterday and today I got to install it. It wasn't USB as advertised (or pictured) on eBay, it was a network printer. So, unfortunately, I didn't get to see if it would work with Linux.. Yet...

But, it does work with Windows Server 2016 Datacenter (completely bypassing the Debian thin client). It took some fenangling to get the stupid software to install, but once I got it and gave it a static IP, it worked like a champ. Wish it was as easy with Brother printers..

For the googles, the exact model of this new receipt printer is:
Star
TSP100
AKA TSP143LAN
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rdesktop: it does not see my printer any more xri Linux - Software 3 06-10-2012 02:38 PM
How can I forward ports with IPtables? I want to forward 80 to 8080 abefroman Linux - Networking 3 05-23-2008 10:05 AM
rdesktop - how can I get my local printer to work? ingar Linux - Networking 1 03-10-2006 09:33 AM
rdesktop - how can I get my local printer to work? ingar Linux - General 0 03-07-2006 11:05 AM
I want .forward to not forward attachments nigelj12 Linux - Software 1 09-30-2004 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration