Still can't print after 6 months (Canon MF445dw) -- at the end of my rope

@wynandm
To finish up the previous post, the relevant part (really just one line) of my configuration.nix is above. Also (and I’m not really sure this is important), I’m running unstable. After almost a year fighting with trying to install the driver manually, hacking the .deb/.rpm files supplied by Canon, etc., I had given up, removed every vestige of the printer from my configuration, but left the printing (cups) service enabled in order to be able to print to pdf.

I had also left avahi enabled as well (imported as a separate file):

  { config, lib, pkgs, ... }: {
    services.avahi.enable = true;
    services.avahi.openFirewall = true;
    services.avahi.publish.enable = true;
    services.avahi.publish.addresses = true;
    services.avahi.nssmdns = false;
    system.nssModules = with pkgs.lib; optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
    system.nssDatabases.hosts = with pkgs.lib; optionals (!config.services.avahi.nssmdns) (mkMerge [
      (mkOrder 900 [ "mdns4_minimal [NOTFOUND=return]" ]) # must be before resolve
      (mkOrder 1501 [ "mdns4" ]) # 1501 to ensure it's after dns
    ]);
  }

I assume the statement,
services.printing.enable = true;
automatically adds the necessary bits from cups, as cups is nowhere declared explicitly.

At this point, after removing the driver reference,
drivers = [ pkgs.canon-cups-ufr2 ];
from my configuration.nix, I had expected the printer to disappear from the system, but to my amazement cups found and configured the printer itself, choosing a “driverless” configuration, which seems to work just fine. Here’s what cups reports at http://localhost:631/printers/Canon_MF440_Series


Description: Canon_MF440_Series
Location:
Driver: CNMF440 Series, driverless, cups-filters 1.28.17 (color, 2-sided printing)
Connection: implicitclass://Canon_MF440_Series/
Defaults: job-sheets=none, none media=na_letter_8.5x11in sides=one-sided

And here’s the status of the various cups daemons:

$ systemctl status cups.socket cups-browsed.service cups.service
● cups.socket - CUPS Scheduler
     Loaded: loaded (/etc/systemd/system/cups.socket; enabled; preset: enabled)
    Drop-In: /nix/store/m9dyjxib3fbxdq6kcpfr1rkva4vzc87g-system-units/cups.socket.d
             └─overrides.conf
     Active: active (running) since Thu 2023-08-24 15:22:27 CDT; 1h 18min ago
   Triggers: ● cups.service
     Listen: /run/cups/cups.sock (Stream)
             127.0.0.1:631 (Stream)
         IP: 0B in, 0B out
         IO: 0B read, 0B written
      Tasks: 0 (limit: 57871)
     Memory: 8.0K
        CPU: 517us
     CGroup: /system.slice/cups.socket

Aug 24 15:22:27 biggieNixOS systemd[1]: Listening on CUPS Scheduler.

● cups-browsed.service - CUPS Remote Printer Discovery
     Loaded: loaded (/etc/systemd/system/cups-browsed.service; enabled; preset: enabled)
     Active: active (running) since Thu 2023-08-24 15:22:54 CDT; 1h 18min ago
   Main PID: 1713 (cups-browsed)
         IP: 221.6K in, 6.0K out
         IO: 7.5M read, 48.0K written
      Tasks: 4 (limit: 57871)
     Memory: 6.8M
        CPU: 168ms
     CGroup: /system.slice/cups-browsed.service
             └─1713 /nix/store/madrmm91biki8x560a07nhxwbw0h432f-cups-filters-1.28.17/bin/cups-browsed

Aug 24 15:22:54 biggieNixOS systemd[1]: Started CUPS Remote Printer Discovery.

● cups.service - CUPS Scheduler
     Loaded: loaded (/etc/systemd/system/cups.service; linked; preset: enabled)
    Drop-In: /nix/store/m9dyjxib3fbxdq6kcpfr1rkva4vzc87g-system-units/cups.service.d
             └─overrides.conf
     Active: active (running) since Thu 2023-08-24 15:23:03 CDT; 1h 18min ago
TriggeredBy: ● cups.socket
       Docs: man:cupsd(8)
    Process: 1773 ExecStartPre=/nix/store/1dhyhnmscx0dx2pa43m1qbdabimnzfnr-unit-script-cups-pre-start/bin/cups-pre-start (code=exited, status=0/SUCCESS)
   Main PID: 1811 (cupsd)
     Status: "Scheduler is running..."
         IP: 5.8K in, 30.6K out
         IO: 7.8M read, 88.0K written
      Tasks: 2 (limit: 57871)
     Memory: 7.3M
        CPU: 186ms
     CGroup: /system.slice/cups.service
             ├─1811 /nix/store/9jfwkrzdhy66xj1cgk6abqmp4gjb5q0s-cups-2.4.6/sbin/cupsd -l
             └─1914 /nix/store/75qk53f4c4y40xkzklriqpgw80wi1q75-cups-progs/lib/cups/notifier/dbus dbus://

Aug 24 15:23:34 biggieNixOS cupsd[1811]: Saving printers.conf...
Aug 24 15:23:34 biggieNixOS cupsd[1811]: Generating printcap /etc/printcap...
Aug 24 15:23:34 biggieNixOS cupsd[1811]: Saving subscriptions.conf...
Aug 24 15:25:22 biggieNixOS cupsd[1811]: REQUEST localhost - - "POST / HTTP/1.1" 200 562 Create-Printer-Subscriptions successful-ok
Aug 24 15:25:53 biggieNixOS cupsd[1811]: Saving subscriptions.conf...
Aug 24 16:23:42 biggieNixOS cupsd[1811]: Subscription 214 has expired...
Aug 24 16:23:42 biggieNixOS cupsd[1811]: REQUEST localhost - - "POST / HTTP/1.1" 200 183 Renew-Subscription successful-ok
Aug 24 16:24:13 biggieNixOS cupsd[1811]: Saving subscriptions.conf...
Aug 24 16:27:28 biggieNixOS cupsd[1811]: [Client 9] Started "/nix/store/75qk53f4c4y40xkzklriqpgw80wi1q75-cups-progs/lib/cups/cgi-bin/printers.cgi" (pid=7509, file=15)
Aug 24 16:30:23 biggieNixOS cupsd[1811]: [Client 9] Started "/nix/store/75qk53f4c4y40xkzklriqpgw80wi1q75-cups-progs/lib/cups/cgi-bin/printers.cgi" (pid=7598, file=15)

So, in the end, I ended up doing nothing explicit with respect to the printer, printer driver, etc., and it worked. I don’t know if this was a result of bug fixes subsequent to my earlier attempts, so I really don’t know how this was problem was “solved”. But the “driverless” configuration does work, prints cups test pages OK, etc., and incidentally also seems to be the configuration used by MacBooks that connect to this same printer. I can post the rest of my NixOS configuration if that would be of any help, but I think most of that is irrelevant.

Hope this helps, and hope you get your MF655Cdw to print from NixOS. My sense is that if mine worked, yours should too.

4 Likes