Drucker in Netzwerk wird nicht gefunden

Ich muss mal nachsehen, ob ich wo noch eine Anleitung habe
Hallo,
solltest du noch eine Anleitung haben würde ich sie gerne nehmen. Deinstalliert hab ich, hab auch diverse Anleitungen zu CUPS gefunden, komme aber nicht wirklich weiter da ich entweder einen passenden CUPS-Treiber, bei Linux hatte ich CUPS-Wrapper, benötige oder ein passendes PPD File benötige. Das PPD was ich finden konnte wird als nicht korrekt abgewiesen
 
Folgendes ist auf der von dir angegebenen Seite beschrieben:
Konfigurieren von Wide Area AirPrint
Mit dem Befehl dns-sd -Z _ipp._tcp,_universal wird das lokale Netzwerk nach für AirPrint nutzbaren IPP-Druckern durchsucht.
Dazu erhalte ich folgende Ausgabe:
Code:
roland-mac-mini@Mini-von-Silvia ~ % dns-sd -Z _ipp._tcp
Browsing for _ipp._tcp
DATE: ---Sun 18 Jun 2023---
11:46:05.230  ...STARTING...

; To direct clients to browse a different domain, substitute that domain in place of '@'
lb._dns-sd._udp                                 PTR     @

; In the list of services below, the SRV records will typically reference dot-local Multicast DNS names.
; When transferring this zone file data to your unicast DNS server, you'll need to replace those dot-local
; names with the correct fully-qualified (unicast) domain name of the target host offering the service.

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

_ipp._tcp                                       PTR     Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp SRV     0 0 631 Mac-mini-von-Silvia.local. ; Replace with unicast FQDN of target host
Brother\032DCP-135C\032@\032Mac\032mini\032von\032Silvia._ipp._tcp TXT     "txtvers=1" "qtotal=1" "rp=printers/Brother_DCP_135C" "ty=Brother DCP-135C CUPS" "adminurl=https://Mac-mini-von-Silvia.local.:631/printers/Brother_DCP_135C" "note=" "priority=0" "product=(DCP-135C)" "pdl=application/octet-stream,application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster" "UUID=5dd5524b-e5c8-34e1-4189-f2d9d4829b1c" "TLS=1.2" "Color=T" "Copies=T" "Scan=T" "printer-state=3" "printer-type=0x480904E"

Dazu weitere Beschreibung: "Du kannst die Einträge entweder in die primäre Zonendatei oder alternativ in eine Subdatei mit dem Namen „AirPrint“ eintragen, die du über die Anweisung $INCLUDE einbindest."
Leider weiß ich nicht wo genau ich die oben stehende Info Eintagen soll
 
Da steht im TXT record, das ist vom DNS.
In dem Fall vom wohl vom Bonjour mDNS.

Wenn dns-sd eh schon installiert ist, fällt der Schritt doch in #4 weg und du kannst das airprintfix.rb wohl so nutzen.
 
Aus der Beschreibung vom #4 Link würde ich nun verstehen das ich die Ausgabe von zuvor mittels einem Texteditor eingeben soll. Allerdings hab ich noch nicht verstanden wie genau die Drei aussehen muss (sorry - ich tu mich da wirklich sehr schwer)
 
Script hab ich runtergeladen, steht im Downloads, kann es nicht ausführen -->
roland-mac-mini@Mini-von-Silvia Downloads % sudo ./airprintfix.rb -t
Password:
sudo: ./airprintfix.rb: command not found
roland-mac-mini@Mini-von-Silvia Downloads %
(ich verzweifle und steh hier wirklich als letzter Depp da :()
 
Hast es überhaupt ausführbar gemacht mit chmod a+x?
~/Downloads/airprintfix.rb geht nicht?
Nicht, dass Safari da ein .txt dran gehängt hat.
ls -l ~/Downloads/a*
sagt was?
 
Hallo,

./dateiname ist immer aktuellen Verzeichnis.
Je nach Situation müsstest Du sonst den Pfad absolut oder relativ anpassen.
Hast Du unter Linux gar nicht im Terminal gearbeitet?

Viele Grüße
 
roland-mac-mini@Mini-von-Silvia Downloads % ls -l ~/Downloads/a*
-rwxr-xr-x@ 1 roland-mac-mini staff 4502 18 Jun 13:20 /Users/roland-mac-mini/Downloads/airprintfix.rb

roland-mac-mini@Mini-von-Silvia Downloads % sudo ./airprintfix.rb -t
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dnssd (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from ./airprintfix.rb:3:in `<main>'
 
Jetzt findet der dns-sd nicht, weil es nicht über ruby installiert ist.
Versuch mal das require dns-sd auszukommentieren im Script, einfach ein # vor.
 
Ok, dann jetzt nochmal:
roland-mac-mini@Mini-von-Silvia ~ % sudo gem install ruby_dev
Password:
Fetching ruby_dev-0.1.0.gem
Successfully installed ruby_dev-0.1.0
Parsing documentation for ruby_dev-0.1.0
Installing ri documentation for ruby_dev-0.1.0
Done installing documentation for ruby_dev after 0 seconds
1 gem installed

roland-mac-mini@Mini-von-Silvia 2.6.0 % sudo gem install dns-sd
Fetching dns-sd-0.1.3.gem
Successfully installed dns-sd-0.1.3
Parsing documentation for dns-sd-0.1.3
Done installing documentation for dns-sd after 0 seconds
1 gem installed

roland-mac-mini@Mini-von-Silvia Downloads % sudo ./airprintfix.rb -t
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dnssd (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from ./airprintfix.rb:3:in `<main>'
 
Warum kompiliert das denn jetzt?
Hast du ein anderes Ruby installiert?
Dann musst du es auch damit ausführen.

Warum kommentiersr du die require Zeile nicht einfach aus?
 
Ändere die Script Datei, wenn das Paket dns-sd statt dnssd heißt, muss das so auch im require stehen.
 
Hatte ich schon gemacht
Code:
require 'dns-sd'
require 'timeout'
require 'optparse'

class Airprint

  attr_accessor :service, :domain, :script, :timeout

  def initialize
    self.service="_ipp._tcp"
    self.domain="local"
    self.script="airprintfix.sh"
    self.timeout=5
  end

  def browse(s=self.service, d=self.domain, t=self.timeout)
    printers=[]
    t = Thread.new do
        puts "Browsing for #{s} services in domain #{d}..."
        dns-sd.browse s, d do |reply|
          dns-sd.resolve reply do |r|
            puts "Resolved #{r.name}"
            printers.push r
          end
        end

Bekomme dazu dann die Fehlermeldung:
roland-mac-mini@Mini-von-Silvia Downloads % sudo ./airprintfix.rb -t
Password:
./airprintfix.rb:22: syntax error, unexpected tIDENTIFIER, expecting end
dns-sd.browse s, d do |reply|
./airprintfix.rb:23: syntax error, unexpected tIDENTIFIER, expecting end
dns-sd.resolve reply do |r|
./airprintfix.rb:35: syntax error, unexpected end, expecting end-of-input
end
 
Hatte die Suche benutzt...

Code:
#!/usr/bin/env ruby
#
require 'dns-sd'
require 'timeout'
require 'optparse'

class Airprint

  attr_accessor :service, :domain, :script, :timeout

  def initialize
    self.service="_ipp._tcp"
    self.domain="local"
    self.script="airprintfix.sh"
    self.timeout=5
  end

  def browse(s=self.service, d=self.domain, t=self.timeout)
    printers=[]
    t = Thread.new do
        puts "Browsing for #{s} services in domain #{d}..."
        dns-sd.browse s, d do |reply|
          dns-sd.resolve reply do |r|
            puts "Resolved #{r.name}"
            printers.push r
          end
        end
    end
    sleep self.timeout
    Thread.kill t
    # there might be more than one interface
    up = printers.uniq { |r| r.name }
    puts "Found #{up.count} unique from #{printers.count} entries" if up.count > 0
    up
  end

  def expand(fd, r, bg)
    # Expand out the Bonjour response
    puts "Service Name: #{r.name}\nResolved to: #{r.target}:#{r.port}\nService type: #{r.type}"
    txt = r.text_record
    # remove entry inserted by Bonjour
    txt.delete 'UUID'
    # Add Airprint txt fields
    txt['URF'] = 'none'
    txt['pdl'] = 'application/pdf,image/urf'
    txt.each_pair do |k,v|
      puts "\t#{k} = #{v}"
    end
    fd.write "#!/bin/bash\n\n"
    fd.write "dns-sd -R \"#{r.name} airprint\" _ipp._tcp,_universal . 631"
    txt.each_pair do |k,v|
      fd.write " \\\n\t#{k}=\'#{v}\'"
    end
    if bg
      fd.write ' &'
    end
    fd.puts
  end

end


options = {}
cmd = {}

OptionParser.new do |opts|
  opts.banner = "Usage: #{$0} [options] command"

  opts.separator ""
  opts.separator "Command: Choose only one"

  opts.on("-i", "--install", "install permanently, requires sudo") do |v|
    cmd[:install] = v
  end

  opts.on("-u", "--uninstall", "uninstall, requires sudo") do |v|
    cmd[:uninstall] = v
  end

  opts.on("-t", "--test", "test, use CTRL-C to exit") do |v|
    cmd[:test] = v
  end

  opts.separator ""
  opts.separator "Options:"

  opts.on("-f", "--script_file", "script filename") do |v|
    options[:script] = v
  end

  opts.on_tail("-h", "--help", "print this message") do
    puts opts
    exit
  end

end.parse!

if ARGV.count != 0 or cmd.count > 1
  puts "Bad command"
  exit
end


# require sudo to update /Library
isRoot = (Process.euid == 0)
if (cmd.key? :install or cmd.key? :uninstall) and !isRoot
  puts "Run with sudo to install or uninstall"
  exit
end

ap = Airprint.new

# plist for LaunchControl
hostname = `hostname`.strip.gsub(/\..*$/,'')
revhost = "local.#{hostname}.airprintfix"
launchlib = "/Library/LaunchDaemons"
launchfile=revhost + ".plist"

plist=<<EOT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
          <string>#{revhost}</string>
        <key>ProgramArguments</key>
          <array>
                  <string>/Library/LaunchDaemons/#{ap.script}</string>
          </array>
        <key>LowPriorityIO</key>
          <true/>
        <key>Nice</key>
          <integer>1</integer>
        <key>UserName</key>
          <string>root</string>
        <key>RunAtLoad</key>
          <true/>
        <key>Keeplive</key>
          <true/>
</dict>
</plist>
EOT



if cmd.key? :uninstall
  system "launchctl unload #{launchfile}"
  rc = $?.exitstatus
  puts "Uninstalling #{ap.script} from #{launchlib}"
  File.delete File.expand_path ap.script, launchlib
  puts "Uninstalling #{launchfile} from #{launchlib}"
  File.delete File.expand_path launchfile, launchlib
  exit rc
end


# determine existing printers
printers = ap.browse
count = printers.count
if count == 0
  puts "No shared printers were found"
  exit
end

# if not installing, create files in the working directory
wd = cmd.key?(:install) ? launchlib : "."

# write script to register them
bg = (count > 1)
f = File.expand_path(ap.script, wd)
File.open f, 'w', 0755 do |fd|
  printers.each { |r| ap.expand fd, r, bg }
end

# write a plist file to launch it
File.open File.expand_path(launchfile, wd), 'w', 0644 do |fd|
  fd.write plist
end

if cmd.key? :install
  plist = File.expand_path(launchfile, wd)
  system "launchctl load -w #{plist}"
  rc = $?.exitstatus
  puts (rc == 0) ? "Installed" : "Failed to install #{plist}, rc=#{rc}"
  exit rc
end

if cmd.key? :test
  puts "Registering printer, use CTRL-C when done"
  trap 'INT' do exit end
  system "/bin/bash #{ap.script}"
  exit $?.exitstatus
end

exit
 
Zurück
Oben Unten