sbs20 / scanserv

scanserv is a simple web-based UI for SANE which allows you to share a scanner on a network.
GNU General Public License v2.0
41 stars 13 forks source link

openwrt app does not response #7

Closed ZoltanSzeleczki closed 7 years ago

ZoltanSzeleczki commented 7 years ago

Hi. I have installed scanserv into /www/ss folder but when press preview or scan button nothing happens.

results of scanimage -L device `epson2:libusb:001:051' is a Epson NX300 flatbed scanner

And I can scan into tiff by php script this way : shellexec("scanimage --resolution 300 --format=tiff >/mnt/hdd80/image$(date +%Y%m%d-%H-%M).tiff");

One thing I have noticed in chrome's console : "jquery.min.js:5 POST http://192.168.1.1:83/ss/api.js 404 (Not Found)" ...and I cannot find api.js file in scanserv directories

What should I check?

(On my router uhttpd listen on port 83 and works well with Luci ui) (I cannot use scanservjs because on my openwrt version [vargalex v1.1.7 r35342] "nodejs" and "npm" are not available ) (vargalex v1.1.7 r35342 - based on BARRIER BREAKER r35342)

sbs20 commented 7 years ago

Hi. This is odd.

There's a clue here, that you picked up on: One thing I have noticed in chrome's console : "jquery.min.js:5 POST http://192.168.1.1:83/ss/api.js 404 (Not Found)" - the code should never get there. I had originally written the following code

        init: function () {
            api.url = 'api.php';

            api.call({
                type: 'ping'
            }).error(function (data) {
                api.url = 'api.js'
            });

... which executes a test ping against api.php and if there's an error then goes to api.js. My original intention was to have a unified front end for the php and js versions. This needs tidying up.

However - the point is that the only way api.js is attempted is if there's an error occurring. Could you either examine the HTTP calls in the browser using the F12 network debugger. Or change the code above so that: api.url = 'api.js' becomes window.alert(data); - hopefully we'll get more useful information.

ZoltanSzeleczki commented 7 years ago

Hi, thanks for reply. result of alert box is not too detailed :(
https://mega.nz/#!edkDXQqa!Xt2TLrBV6VfmsgX2_2HGA6v9w4sf98hUqI-c9XxPu74 network tab's screenshot (if you download it can be more readable) https://mega.nz/#!eEshwBaI!lHIZhjN45teplxVBuExYHltd8JrWNa9J5IHb4ZtZDH4

While I could not setup scanserv I turned back to PhpSane and after I have configured imagemagick and its "convert" I was able to change PNMTO* calls to "convert" equivalents in PHPSane and it works now.

The only thing I could not set up on my router now how to run saned as a service and use it from my phone or windows pc. Because at high resolution creating final picture takes some minutes on router due to tiff->jpg conversion.

So I am not sure I want to use web client if I can set a stable scanner service on router.

Anyway, thanks for help, and for your efforts in this development. Have a great day!. Zoltan

ps (off): -for those who get delegates.xml error too during running "convert" : I have solved it by unzipping all files from ImageMagick* folder from ImageMagick-i686-pc-mingw32.tar.gz (for my OS I did not found so I used another OS's stuff) and copied them under /etc/ImageMagick folder

-for those who get Segmentation fault error during running saned -d125 command: on my openwrt it was fixed by creating an /etc/inetd.conf file with this line sane-port stream tcp nowait root.root /usr/sbin/saned saned

sbs20 commented 7 years ago

Thanks Zoltan - best of luck