Project

General

Profile

Problem with Cups and PSTOEDIT

Added by acubino over 11 years ago

Hi.

I'm try to test CUPS (visicut works mostly), but I have some problems with the package.

Package are make from GIT, and printer installed into CUPS, but I try to print and printer do not work. I try to test using command line, I have view some bugs.

root@acubino-portege:/usr/lib/cups/backend# ./cups-laos 1 jaap test 1 opts /home/acubino/Software/cups-laos/examples/block.ps

Say error, because pstoedit is not in /usr/local/bin/pstoedit by the way I add a symbolik link:
ln /usr/bin/pstoedit /usr/local/bin/pstoedit

Pstoedit say error, because are one missing parameter.
root@acubino-portege:/usr/lib/cups/backend# ./cups-laos 1 jaap test 1 opts /home/acubino/Software/cups-laos/examples/block.ps
CRIT: No URI
CRIT: Start process commandline
CRIT: jobname set (1)
CRIT: username (jaap)
CRIT: title ()
CRIT: options (opts)
CRIT: option opts read (opts)
CRIT: readArgs done
CRIT: Created ps-file (/var/spool/cups/tmp/laos-11468.ps)
CRIT: pstoedit command built (TMPDIR=/tmp /usr/local/bin/pstoedit /var/spool/cups/tmp/laos-11468.ps /var/spool/cups/tmp/laos-11468.lgc)
pstoedit: version 3.60 / DLL interface 108 (built: Apr 3 2012 - release build - g++ 4.6.3 - 64-bit) : Copyright (C) 1993 - 2011 Wolfgang Glunz
No output format specified (-f option) and format could not be uniquely deduced from suffix .lgc of output file
Available formats :

I use the cups-laos as example in README.

Main problem is that LGC file was not created, using directly CUPS or using directly cups-laos.

In cups say:
ftp cmnd: /usr/bin/tftp 192.168.1.169 69 -m binary -c put /var/spool/cups/tmp/laos-12948.lgc tulo.lgc"
But no file is create on tmp

Any help?.


Replies (18)

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Sorry, I forgot to tell i use Debian.

I make another test, but laser machine makes crazy, i think this is no the correct filetype.
root@acubino-portege:/usr/lib/cups/backend# pstoedit -rgb -f gcode -psarg "-r300x300" /home/acubino/Software/cups-laos/examples/block.ps block.gcode
pstoedit: version 3.60 / DLL interface 108 (built: Apr 3 2012 - release build - g++ 4.6.3 - 64-bit) : Copyright (C) 1993 - 2011 Wolfgang Glunz
root@acubino-portege:/usr/lib/cups/backend# /usr/bin/tftp 192.168.1.169 69 -m binary -c put block.gcode tulo.lgc

RE: Problem with Cups and PSTOEDIT - Added by jaap over 11 years ago

Step one is to get a .lgc output file.
The filetype should be "laos", if you try "pstoedit block.ps block.lgc", you should get a .lgc file which looks like this:

; Generated by pstoedit 3.61 from eofill.ps at Tue Apr  9 16:05:08 2013 
7 201 0
7 202 210002
7 203 0
7 204 297000
7 100 100000
7 101 5000
0 33147 56250
9 1 55 4294967294 33554430
1 35412 56250
0 35947 56205
9 1 81 4294967294 4294967294 524286
1 32612 56205
0 32283 56160
9 1 98 4294967294 4294967294 4294967294 14
1 36318 56160
......

If that doesn't work, you probably did not have the right libraries to compile pstoedit on your computer.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Hi.

I check my version is 3.60 in Debian testing. I down tar.gz from webpage and compile, but appears the same version 3.60. Problem is the same as before, do not detect the filetype:

root@acubino-portege:/home/acubino/pstoedit-3.61/pstoedit-3.61# /usr/local/bin/pstoedit /home/acubino/Software/cups-laos/examples/block.ps block.lgc
pstoedit: version 3.60 / DLL interface 108 (built: Apr 3 2012 - release build - g++ 4.6.3 - 64-bit) : Copyright (C) 1993 - 2011 Wolfgang Glunz
No output format specified (-f option) and format could not be uniquely deduced from suffix .lgc of output file
Available formats :

I attach you the complete message.

RE: Problem with Cups and PSTOEDIT - Added by jaap over 11 years ago

You need to download the pstoedit version with a LaOS patch from github: https://github.com/LaosLaser/pstoedit

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Hi.

I check, that need PSTOEDIT from Laos GIT and is not valid the official package. But I have problem compiling.

I add the GIT to my debian like this: http://redmine.laoslaser.org/projects/laos/wiki/Pstoedit_with_laos_support

git clone -b laos https://github.com/LaosLaser/pstoedit.git

But problem in make:
(finally of the text)
libtool: link: (cd ".libs" && rm -f "libp2edrvstd.so.0" && ln -s "libp2edrvstd.so.0.0.0" "libp2edrvstd.so.0")
libtool: link: (cd ".libs" && rm -f "libp2edrvstd.so" && ln -s "libp2edrvstd.so.0.0.0" "libp2edrvstd.so")
libtool: link: ( cd ".libs" && rm -f "libp2edrvstd.la" && ln -s "../libp2edrvstd.la" "libp2edrvstd.la" )
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -DHAVE_MKSTEMP -DDEFAULTGS=/usr/bin/gs -DPSTOEDITDATADIR="\"/usr/local/share/pstoedit\"" -DPSTOEDITLIBDIR="\"/usr/local/lib/pstoedit\"" -DBUGGYGPP -pedantic -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wno-long-long -D_LITTLE_ENDIAN -g -O2 -DINTERNALBOOL -MT drvlaos.lo -MD -MP -MF .deps/drvlaos.Tpo -c -o drvlaos.lo drvlaos.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -DHAVE_MKSTEMP -DDEFAULTGS=/usr/bin/gs -DPSTOEDITDATADIR=\"/usr/local/share/pstoedit\" -DPSTOEDITLIBDIR=\"/usr/local/lib/pstoedit\" -DBUGGYGPP -pedantic -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wno-long-long -D_LITTLE_ENDIAN -g -O2 -DINTERNALBOOL -MT drvlaos.lo -MD -MP -MF .deps/drvlaos.Tpo -c drvlaos.cpp -fPIC -DPIC -o .libs/drvlaos.o
In file included from drvlaos.cpp:45:0:
drvlaos.h:35:17: fatal error: png.h: No such file or directory
compilation terminated.
make2: * [drvlaos.lo] Error 1
make2: se sale del directorio `/home/acubino/pstoedit2/pstoedit/src'
make1:
[all] Error 2
make1: se sale del directorio `/home/acubino/pstoedit2/pstoedit/src'
make: *
* [all-recursive] Error 1

RE: Problem with Cups and PSTOEDIT - Added by Springuin over 11 years ago

drvlaos.h:35:17: fatal error: png.h: No such file or directory

That looks like you need to install libpng12-dev (Debian or Ubuntu) or the equivalent for your distribution. If you get more of these errors after installing libpng12-dev you can just look the .h file up on http://packages.ubuntu.com/ or http://www.debian.org/distrib/packages. Use the "Search the contents of packages" section of the page.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Hi.

Yes, problem was libpng12-dev is not installed, and need to downgrade the libpng12 for make. All ok, installed.

But (all times are one but), when I try to print any document (text etc) laser move a little but no print anyone, and appears to be "hang up".

I check the output of pstoedit, and appear to be some bad.
root@acubino-portege:/home/acubino/Software/cups-laos/examples# cat helloworld.lgc
; Generated by pstoedit 3.61 from helloworld.ps at Tue Apr 9 19:10:54 2013
7 201 0
7 202 210002
7 203 0
7 204 297000

root@acubino-portege:/home/acubino/Software/cups-laos/examples# cat block.lgc
; Generated by pstoedit 3.61 from block.ps at Tue Apr 9 19:06:22 2013
7 201 0
7 202 210002
7 203 0
7 204 297000

The same output for block and helloworld from examples. Only appear to be to use the 7, and use for put the max X and max Y, but no data for print or laser power on.

pstoedit tell some error, but i don't think if is only a warning:
root@acubino-portege:/home/acubino/Software/cups-laos/examples# pstoedit -f laos helloworld.ps helloworld.lgc
pstoedit: version 3.61 / DLL interface 108 (built: Apr 9 2013 - release build - g++ 4.7.2 - 64-bit) : Copyright (C) 1993 - 2012 Wolfgang Glunz

drvlaos: (c) 2010-2012 Peter Brier & Jaap Vermaas (www.laoslaser.org)
pstoedit: symbol lookup error: /usr/local/lib/pstoedit/libp2edrvlaos.so: undefined symbol: png_sig_cmp

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

i check problem, probably is related to libpng.

I comment this line, but say another error related.
if (png_sig_cmp(header, 0, 8)) {
errf << "[read_png_file] File " << pngname.value() << "is not recognized as a PNG file" << endl;
return;
}

I installed all libpng* packages:
root@cubi-i3-ssd:/home/acubino/laos/libpng-1.2.50# dpkg -l | grep libpng
ii libpng++-dev 0.2.5-1 all C++ interface to the PNG (Portable Network Graphics) library
ii libpng-sixlegs-java 2.0-1 all Sixlegs Java PNG Decoder
ii libpng-sixlegs-java-doc 2.0-1 all Documentation for Sixlegs Java PNG Decoder
ii libpng12-0:amd64 1.2.49-1 amd64 PNG library - runtime
ii libpng12-0:i386 1.2.49-1 i386 PNG library - runtime
ii libpng12-dev 1.2.49-1 amd64 PNG library - development
ii libpng3:amd64 1.2.49-1 amd64 PNG library - runtime
ii libpnglite-dev 0.1.17-1 amd64 lightweight C library for loading and writing PNG images
ii libpngwriter0-dev 0.5.3-3 amd64 easy to use graphics library (development)
ii libpngwriter0c2 0.5.3-3 amd64 easy to use graphics library (runtime)

Also, I make second instalation of pstoedit in my home PC, the result is the same.

Incorrect version of libpng?, buggy?

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

pstoedit tell me that have a valid version of libpng :(

root@cubi-i3-ssd:/home/acubino/laos/pstoedit# ./configure | grep png
configure: WARNING: * libplotter driver is disabled.
configure: WARNING: *
libming driver is disabled.
configure: WARNING: * libMagick++ driver is disabled.
configure: WARNING: *
Cannot find libEMF. libEMF supports are disabled.
configure: WARNING: ** Cannot find emf.h. libEMF supports are disabled.
checking See if we have libpng and zlib... you seem to have compatible version of libpng
root@cubi-i3-ssd:/home/acubino/laos/pstoedit# make | grep png
root@cubi-i3-ssd:/home/acubino/laos/pstoedit# make install | grep png
libtool: install: warning: relinking `libp2edrvstd.la'
libtool: install: warning: relinking `libp2edrvlaos.la'

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Any help?.

I try in 3 different debian pcs with no change. Is my version of libpng deprecated?, i didn't find deb for version 1.6 of libpng, and i'm not sure if with "make" installing of new version are ok, because I can't remove the old one due dependency.

RE: Problem with Cups and PSTOEDIT - Added by jaap over 11 years ago

I compiled pstoedit on Debian Squeeze with libpng12-dev. I don't get any errors. Did you remove the old pstoedit (debian package) from your system?

I see that I have this in /etc/ld.so.conf.d/libc.conf

/usr/local/lib
/usr/local/lib/pstoedit

Maybe that helps?

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

- Remove manually all pstoedit files in system.

root@cubi-i3-ssd:/home/acubino/laos# locate pstoe
root@cubi-i3-ssd:/home/acubino/laos# dpkg -l | grep psto
(no results)

- Checking libpng

root@cubi-i3-ssd:/home/acubino/laos# dpkg -l | grep libpng12
ii  libpng12-0:amd64                                  1.2.49-1                           amd64        PNG library - runtime
ii  libpng12-0:i386                                   1.2.49-1                           i386         PNG library - runtime
ii  libpng12-dev                                      1.2.49-1                           amd64        PNG library - development
(installed ok, including libpng12-dev)

- Installing git clone.

root@cubi-i3-ssd:/home/acubino/laos# git clone -b laos https://github.com/LaosLaser/pstoedit.git
Cloning into 'pstoedit'...
remote: Counting objects: 438, done.
remote: Compressing objects: 100% (263/263), done.
remote: Total 438 (delta 211), reused 396 (delta 169)
Receiving objects: 100% (438/438), 1.05 MiB | 428 KiB/s, done.
Resolving deltas: 100% (211/211), done.

- Configure and installing package

root@cubi-i3-ssd:/home/acubino/laos/pstoedit# ./configure > log.txt
configure: WARNING: ** libplotter driver is disabled.
configure: WARNING: ** libming driver is disabled.
configure: WARNING: ** libMagick++ driver is disabled.
configure: WARNING: ** Cannot find libEMF. libEMF supports are disabled.
configure: WARNING: ** Cannot find emf.h. libEMF supports are disabled.
root@cubi-i3-ssd:/home/acubino/laos/pstoedit# nano log.txt 
root@cubi-i3-ssd:/home/acubino/laos/pstoedit# make > log2.txt
dynload.cpp: In member function 'void (* DynLoader::getSymbol(const char*, int) const)()':
dynload.cpp:212:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [enabled by default]
F:\pstoedit\devbase\src\lexyy.cpp: In function 'int yy_get_next_buffer()':
F:\pstoedit\devbase\src\lexyy.cpp:3227:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
pstoedit.cpp: In function 'int grep(const char*, const char*, std::ostream&)':
pstoedit.cpp:143:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drvdxf.cpp: In static member function 'static RSString DXFLayers::normalizeColorName(const RSString&)':
drvdxf.cpp:521:41: warning: cast from type 'const char*' to type 'char*' casts away qualifiers [-Wcast-qual]
drvnoi.cpp: In member function 'void drvNOI::LoadNOIProxy()':
drvnoi.cpp:148:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [enabled by default]
drvhpgl.cpp: In member function 'virtual void drvHPGL::show_path()':
drvhpgl.cpp:485:66: warning: ISO C++ does not support the '%lg' gnu_printf format [-Wformat]
drvlaos.cpp: In member function 'int drvLAOS::Substitute(std::string&, std::string, std::string)':
drvlaos.cpp:245:47: warning: overflow in implicit constant conversion [-Woverflow]
drvlaos.cpp: In member function 'void drvLAOS::engrave_images()':
drvlaos.cpp:554:14: warning: variable 'color_type' set but not used [-Wunused-but-set-variable]
drvlaos.cpp:555:14: warning: variable 'bit_depth' set but not used [-Wunused-but-set-variable]
drvlaos.cpp:559:9: warning: variable 'number_of_passes' set but not used [-Wunused-but-set-variable]
root@cubi-i3-ssd:/home/acubino/laos/pstoedit# make install > log3.txt
libtool: install: warning: relinking `libp2edrvstd.la'
libtool: install: warning: relinking `libp2edrvlaos.la'
(log.txt files are uploaded into the post).

- At last, trying luck.

root@cubi-i3-ssd:/home/acubino/laos/pstoedit# pstoedit -f laos /home/acubino/laos/Software/cups-laos/examples/block.ps /home/acubino/output.lgc
pstoedit: version 3.61 / DLL interface 108 (built: Apr 15 2013 - release build - g++ 4.7.2 - 64-bit) : Copyright (C) 1993 - 2012 Wolfgang Glunz

drvlaos: (c) 2010-2012 Peter Brier & Jaap Vermaas (www.laoslaser.org)
pstoedit: symbol lookup error: /usr/local/lib/pstoedit/libp2edrvlaos.so: undefined symbol: png_sig_cmp

- No luck.

pstoedit version 3.61 with laos driver ok, but same problem.

- Also, I change my file like your.

root@cubi-i3-ssd:/# cat /etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib
/usr/local/lib/pstoedit

- And my debian is debian Testing, you use the stable, but i didn't know if must be a bug from Debian.

I'm making crazy.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

I installed on virtualbox debian squeeze (stable), and the same result.

I must be making some bad.

Can you send me your log for check the exactly commands have you used?

Thanks, Amador.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Hi.

I just installed a new one (second), Debian Squeeze (stable) without GNOME, KDE ... only the basic shell.

By the way, pstoedit and libpng was not installed by default.

The problem persist, and is the same.

I get another error, telling that problem with libpstoedit.so.0. I copy too in /usr/lib/local/pstoedit and execute ldconfig.
Error remove, but undefined symbol: png_sig_cmp persists.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

I forgot, this time I installed a i386 debian instead of amd64 I use last times.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Installed on to Centos as same problems.

Have you time for check my logs and see if have any user problem?.

RE: Problem with Cups and PSTOEDIT - Added by acubino over 11 years ago

Hi.

A friend that know C check the code and found the solution. Problem is that libpng was not linked with laosdrv.

Only need to make a change in the file Makefile.in from SRC

Line 80 must be:
$(CXXFLAGS) $(libp2edrvlaos___la_LDFLAGS) $(LDFLAGS) $(LIBPNG_LDFLAGS) -o $@

But i didn't know why I only have the problems in all distros (debian testing, stable, centos ...)

Output code appear to be OK, i need to test in the laser.

RE: Problem with Cups and PSTOEDIT - Added by jaap over 11 years ago

I don't understand why it compiles fine on my computer and it needs this extra flag on yours. Anyways, the extra flag doesn't seem to hurt either, so I've added it to the GIT repository.

    (1-18/18)