Wednesday, February 11, 2015

Using a Netgear WNDR3400 as an OpenWRT Wireless Print Server (Part 4)

Note: Don't follow these directions because the avahi-daemon is terrible and it will hurt your feelings. You can read this garbage but I'd advise you against actually following the directions.

Ready to turn back? Part 3 of this series tells you how to use mDNSResponder instead and you should go there.



First, I got bored of the system having a stupid default hostname and being the wrong timezone so I updated them. Use `vi /etc/config/system` or however you want. Possibly don't do it at all because it's not important.

        option hostname N600
        option timezone CST6CDT,M3.2.0,M11.1.0

Second, get the Avahi bits up and running for ZeroConf so the printer can be automatically detected.
opkg install avahi-daemon
/etc/init.d/avahi-daemon enable
Now, tweak the Avahi config because the avahi-daemon is consistently compiled badly. So run `vi /etc/avahi/avahi-daemon.conf` and disable the dbus piece by adding the below option to the [server] section of the config file. Here you'll need to enable access to wlan1 because that's what the interface on radio1 is called.
enable-dbus=no
allow-interfaces=wlan1
Lastly, enable avahi and start it up.
/etc/init.d/avahi-daemon enable
/etc/init.d/avahi-daemon start
Third, setup your Avahi services properly. So delete the services that exist because they aren't going to be used and create a new service file.
rm /etc/avahi/services/http.service
rm /etc/avahi/services/ssh.service
vi /etc/avahi/services/p910nd.service
Your own service file will be a little different. Enter a model name close to the name of your actual printer and the Mac add printer dialog will be pretty helpful in finding the right drivers. I was surprised that mine worked without a problem.

This is an XML blob but blogger decided it hated me and totally destroyed it. As I don't suggest you use Avahi-Daemon anyway I'm not going to fix it. Buyer Beware.

  Lexmark E232 on WiFi
 
    _pdl-datastream._tcp
    9100
    qtotal=1
    usb_MFG=Lexmark
    usb_MDL=Lexmark E232
    Color=F
    Duplex=F
    Bind=F
    Collate=F
    Sort=F
    Staple=F
    Punch=F
    PaperMax=legal-A4
 
You can probably remove a lot of those records about binding and collating, but they were in the example I had and I didn't want to make sure.

Fourth, reboot your router again and cross your fingers. If you are lucky you are done fiddling on the command line and you can get back to the real world of mouses and dialog boxes. If you are unlucky you will end up restarting the avahi-daemon service every time you boot your router. So get used to logging in and using
/etc/init.d/avahi-daemon restart
Fifth, uninstall avahi-daemon because you have to manually restart the daemon every time you restart your router and this whole thing was an exercise in futility because the mdns stuff is so much easier to work with and is intentionally really lightweight and all around better.
/etc/init.d/avahi-daemon stop
/etc/init.d/avahi-daemon disable
opkg remove avahi-daemon --autoremove

No comments:

Post a Comment