OpenWrt + scanner

Hello! I used scanner behind 1043ND router that worked like charm.
Then I found some ZSUN card readers that were not used, so I decided to convert scanner to wifi scanner. Everything went ok.
Got Openwrt 18.06 compiled and installed.
lsusb command shows my scanner:

root@Canon_Pixma_Scanserver_ZSUN:~# lsusb
Bus 001 Device 002: ID 04a9:263d Canon, Inc. PIXMA MP370
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Then I installed all the scanner packages that were in the 1043ND server. Seems that the scanner is recognized.

root@Canon_Pixma_Scanserver_ZSUN:~# scanimage -L
device `pixma:04A9263D' is a CANON PIXMA MP370 multi-function peripheral

The ZSUN is connected to my home network throught WAN connection. So I had to open input from wan to access it from my local network.
Then I reviewed my config in the 1043ND and I had opened port in firewall, so I created the similar rule into the zsun reader:

config rule
	option target 'ACCEPT'
	option src 'wan'
	option proto 'tcp'
	option dest_port '6566'
	option name 'Skänner'

Now I try to find scanner from network, but nothing.

[kaarel@gigabyte ~]$ scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

It seems like something? is blocking the access to it? Or some ports are closed from WAN connection?
I converted my printer to wifi with the other zsun card reader that I had and this is working like charm, just opened one port 9100 from wan. Does anybody know what could block it?

So I solved it somehow.
I did reset the router to default settings.
Then I followed the openwrt scanner guide. Opened port in firewall and computer found the scanner. Seems that I did something wrong or left undone last time. :slight_smile:

2 Likes

Silly question, but how did you connect your scanner (or anything USB, for that matter) to the ZSun, electrically, and in config? I have a few Zsun lying around that could get another chance at being useful. Edit: Just connect both the Zsun and the USB device to a hub?

I did use the D- and D+ pins that are used for usb. The Zsun has connected to the D+ and D- the card reader. As I didn't need the card reader I desoldered the pins from memeory card and mainboard. Then I soldered some jumper wires to the D+ and D- pads.

And I desoldered usb socket from the printer mainboard. Then I connected the d+ and d- to the right pads. Powered everyhting on and it didn't work. I found out that the printer usb +5v line wants +5v to turn the usb side on.

I found from the printer one pad where I could get 4,5V and after connecting that to usb input it worked like charm. I also powered on the zsun from that 4,5V.

For scanner I used same method, but I couldn't get any 5v line. I only found one line where I could get 3,5V. I connected that to zsun power and usb input and it worked.

1 Like

Ah, thank you for the details. I didn't try my hand on it yet, I just had in my mind the following detial from the Zsun wiki page

GPIO13: USB mode 0=device, 1=host

and wrongfully assumed that, in the context of the Zsun, this would relate to the big USB A connector.

And it's now clear that it doesn't. That GPIO should probably always be set/left at 1. The WAS7227Q connects the card reader's D+/D- either to the SoC or the USB-A connector, but D+/D- from the USB-A connector can never reach the SoC. Picking up D+/D- from the card reader interconnector is really the only way to attach any other USB device to the SoC.

I can work with that, especially since removing D+/D- from the card reader still leaves the "SD detect" pin functional -- which is important for emergency recovery.

Emergency recovery would be useful.
I didn't want to mess with the WAS7227Q so I didn't touch that.
Before connecting the device to the printer I did also flash bootloader and newer firmware from this thread:

Then I compiled my own 18.06 newest fw with all the things I needed.

I believe there's no point anyway. The WAS7227Q is a very simple device, it's basically a double-throw switch that connects D+/D- from the card reader either to the USB-A connector or to the SoC. One could connect D+/D- from the SoC to the USB-A connector, but that's quite fiddly soldering and not really useful anyway (unless you want to make the ZSun a USB "Gadget" ... which we don't.)

I'm aware of this thread, my Zsuns are already running 19.07.3 from @brunompena's repository. That's what I was referring to with "emergency recovery", it's built into the images and is triggered by the SD card reader, presumably monitoring the "SD detect" pin. One could probably remove the SD card reader altogether, and when needed short the "SD detect" pin to trigger the emergency flash facility -- I just don't know if the pin should go high (to 5v) or low (to ground) to do that, I would have to check with a multimeter.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.