× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

AirPrint and ReadyNASOS6

tadgy
Star

AirPrint and ReadyNASOS6

Hey,

  I've been trying to get my ReadyNAS to operate as a 'print server' for my local network, including with AirPrint functionallity.  I have a Brother wifi printer (so it's not connected via USB) and have sucessfully installed the required CUPS and foomatic filter packages, and have the printer shared with my network without issue.

 

The next issue was AirPrint.  I've read all the posts in this forun where people have sucessfully got it working with pre-iOS6 clients; but have had no success with the post-6 devices.  I believe I have figured out why....

 

The issue is Avahi, and the advertising of the printer as an AirPrint printer.

Previous to iOS6, the Avahi .service file did not make use of the <subtype> directive; but since iOS6, a specific <subtype> setting is required in order for iOS to 'see' the printer.

 

Unforunately, it is the use of the <subtype> directive in the .service file which is causing Avahi to crash on the ReadyNAS - and thus prevent the NAS from advertising the AirPrint printers to the local network.

 

The Avahi .service file for my Brother wifi printer was created with this script:

https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py

 

The script spits out a valid .service file which contains everything which SHOULD be required in order to advertise the printer via mDNS/Bonjour for the iOS devices to pick up.

 

The problem is that Avahi crashes while it is parsing any .service file which contains a <subtype> option.  This can easily be reproduced if you upload a .service file created using the above script (or any other example you find with google) and run Avahi from a terminal as root.

 

The .service file for my Brother wifi printer is:

<?xml version="1.0" ?><!DOCTYPE service-group  SYSTEM 'avahi-service.dtd'>
<service-group>
  <name replace-wildcards="yes">AirPrint Brother_DCP-1610W @ %h</name>
  <service>
    <type>_ipp._tcp</type>
    <subtype>_universal._sub._ipp._tcp</subtype>
    <port>631</port>
    <txt-record>txtvers=1</txt-record>
    <txt-record>qtotal=1</txt-record>
    <txt-record>Transparent=T</txt-record>
    <txt-record>URF=none</txt-record>
    <txt-record>rp=printers/Brother_DCP-1610W</txt-record>
    <txt-record>note=Brother DCP-1610W</txt-record>
    <txt-record>product=(GPL Ghostscript)</txt-record>
    <txt-record>printer-state=3</txt-record>
    <txt-record>printer-type=0x80b004</txt-record>
    <txt-record>pdl=application/octet-stream,application/pdf,application/postscript,image/gif,image/jpeg,image/png,image/tiff,image/urf,text/html,text/plain,application/vnd.adobe-reader-postscript,application/vnd.cups-command,application/vnd.cups-pdf</txt-record>
  </service>
</service-group>

(different printers will obviously have different output from the script... but the key point of note here is the inclusion of the  <subtype> directive)

 

If the <subtype> directive is commented out, Avahi on the ReadyNAS will parse and load the file without issue (but the printer is not picked up by iOS due to the missing directive):

Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Successfully dropped root privileges.
avahi-daemon 0.6.31 starting up.
Successfully called chroot().
Successfully dropped remaining capabilities.
Loading service file /services/AirPrint-Brother_DCP-1610W.service.
Loading service file /services/frontview.service.
Loading service file /services/nut.service.
Joining mDNS multicast group on interface bond0.IPv4 with address 192.168.67.248.
New relevant interface bond0.IPv4 for mDNS.
Joining LLMNR multicast group on interface bond0.IPv4 with address 192.168.67.248.
New relevant interface bond0.IPv4 for LLMNR.
Network interface enumeration completed.
Registering new mDNS address record for 192.168.67.248 on bond0.IPv4.
Registering new LLMNR address record for 192.168.67.248 on bond0.IPv4.
Server startup complete. Host name is NAS.local. Local service cookie is 2760298420.

All host RR's have been announced/verified : SERVER RUNNING
Service "NAS" (/services/nut.service) successfully established.
Service "ReadyNAS Administration on NAS" (/services/frontview.service) successfully established.
Service "AirPrint Brother_DCP-1610W @ NAS" (/services/AirPrint-Brother_DCP-1610W.service) successfully established.

However, with the <subtype> option present, Avahi crashed out at startup:

Found user 'avahi' (UID 84) and group 'avahi' (GID 84).
Successfully dropped root privileges.
avahi-daemon 0.6.31 starting up.
Successfully called chroot().
Successfully dropped remaining capabilities.
Loading service file /services/AirPrint-Brother_DCP-1610W.service.
Loading service file /services/frontview.service.
Loading service file /services/nut.service.
Joining mDNS multicast group on interface bond0.IPv4 with address 192.168.67.248.
New relevant interface bond0.IPv4 for mDNS.
Joining LLMNR multicast group on interface bond0.IPv4 with address 192.168.67.248.
New relevant interface bond0.IPv4 for LLMNR.
Network interface enumeration completed.
Registering new mDNS address record for 192.168.67.248 on bond0.IPv4.
Registering new LLMNR address record for 192.168.67.248 on bond0.IPv4.
Server startup complete. Host name is NAS.local. Local service cookie is 1803852026.
avahi-daemon: running [NAS.local]: entry.c:1080: avahi_server_add_service_subtype: Assertion `flags & AVAHI_PUBLISH_USE_MULTICAST || flags & AVAHI_PUBLISH_USE_WIDE_AREA' failed.

I believe this is an issue related to the version of Avahi present on the ReadyNAS.  Is there any chance of Netgear upgrading the version to one which doesn't contain this bug, or at the very least patch something which will cause Avahi to crash at start?

 

I'd appreciate if anyone else can test their system to see if they get a similar problem with Avahi - just to make sure i'm not doing something completely brain-dead 🙂

 

If we can get this crashing issue resolved, i'm pretty sure we can get AirPrint working again in ReadyNASOS6.

 

Cheers.

Message 1 of 7
tadgy
Star

Re: AirPrint and ReadyNASOS6

So, no one can verify this problem with Avahi?

Or noone but me is interested in getting AirPrint working?! 😛

 

I at least expected a reply from one of the Netgear employees acknowledging that their software has an issue which can cause a denial of service....

Message 2 of 7
WhoCares_
Mentor

Re: AirPrint and ReadyNASOS6

I think I found the source of the problem and reported it to NETGEAR together with a suggested solution.

 

-Stefan

Message 3 of 7
tadgy
Star

Re: AirPrint and ReadyNASOS6

Sorry for the late reply.

 

Glad you found the source of the issue 🙂

 

Any chance you can provide some more detail?  What was the problem?  Is there a bug entry somewhere that I can read?

 

Cheers.

Message 4 of 7
bartw
Aspirant

Re: AirPrint and ReadyNASOS6

Guys,

 

any issues on this Airprint story ?

 

Kindes regards,

 

Bart

Message 5 of 7
tadgy
Star

Re: AirPrint and ReadyNASOS6

The MD5sum of the avahi-daemon binary is the same on 6.3.5 as it is on the newly released 6.4.0, so my guess is that this issue has not been fixed.

 

I suspect we won't know until WhoCares can detail what the actual bug was and where the fix applies.

 

I don't currently have a test box available to replicate my original experiments, but you could have a go yourself and let us know 🙂

Message 6 of 7
bartw
Aspirant

Re: AirPrint and ReadyNASOS6

I have devices availble but not the time to go experiment at this time ... Smiley Frustrated 

Message 7 of 7
Top Contributors
Discussion stats
  • 6 replies
  • 5104 views
  • 1 kudo
  • 3 in conversation
Announcements