Hi, Sorry for hijacking old thread but seems like indeed there is still indeed an unresolved bug in umDNS. I am using custom build OpenWRT 19.07. But without any modification to packages involved. I have followed the guide here: https://openwrt.org/docs/guide-developer/mdns
But my locally advertised printer is not on the list.
I have placed /etc/umdns/printer_service.json with the following content:
{
"HP\032LaserJet\032P1005\032Series": {
"service": "_printer._tcp",
"port": "9100",
"txt": [
"txtvers=1",
"qtotal=1",
"rp=RAW",
"priority=50",
"note=Livingroom",
"ty=HP LaserJet P1005",
"product=(HP LaserJet P1005)",
"usb_MFG=Hewlett-Packard",
"usb_MDL=HP LaserJet P1005",
"Color=F",
"Duplex=F",
"Bind=F",
"Collate=F",
"Sort=F",
"Staple=F",
"Punch=F",
"PaperMax=legal-A4"
]
}
}
I've checked the syntax with some online JSON syntax checked and I had a typo but I fixed it and its correct JSON now. Also I verified that printer is working besides network discovery. The printer works normally via network when added manually on Linux box and it prints. The firmware is loaded etc. I just want to make it discoverable on the br-lan.
I have two devices in network a router and ap both Turris Omnias and when I issue: root@router:~# ubus call umdns browse
{
"_ssh._tcp": {
"ap": {
"ipv4": "$AP_IPv4",
"ipv6": "fe80::da58:d7ff:fe00:3d9e",
"port": 22
}
}
}
The same on the AP the router's SSH service is discoverable: root@ap:~# ubus call umdns browse
{
"_ssh._tcp": {
"router": {
"ipv4": "$ROUTER_IPv4",
"ipv6": "fe80::da58:d7ff:fe00:20ac",
"port": 22
}
}
}
So it seems like umDNS is working but ignoring services defined in /etc/umdns/*.json.
Could it be some permission/ownership issue? Any ideas?
EDIT: I forgot to mention that printer is connected to dumb AP's USB port.
EDIT2: I forgot to mention my local DNS uses domain .lan instead of .local.
if you run umdns on the wan port, make sure to open the 5353 port on the wan interface inside the firewall, otherwise wan side machines can see you but local browse wont see the remote machines.
I have this rule on both devices; the rule is the last one:
/etc/config/firewall config rule option src_port '5353' option name 'Allow-mDNS' option target 'ACCEPT' list dest_ip '224.0.0.251' option dest_port '5353' list proto 'udp' option src '*'
Also this is the scan from other device in the network:
root@wizard:~# nmap -sU -p 5353 ap.lan Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-17 13:58 UTC Nmap scan report for ap.lan ($AP_IPv4) Host is up (0.00012s latency). PORT STATE SERVICE 5353/udp open|filtered zeroconf MAC Address: D8:58:D7:00:3D:9E (CZ.NIC, z.s.p.o.) Nmap done: 1 IP address (1 host up) scanned in 0.79 seconds
EDIT: I've runned wireshark with remote ssh session on br-lan of ap device and I could see mdns traffic with this filter udp && ip.dst == 224.0.0.251. The traffic was from $ROUTER_IPv4, from $AP_IPv4 and from some IP of Android device advertising PTR records for SSH and GoogleCast respectively. All to 224.0.0.251 protocol MDNS. So it seems like it's no firewall issue but more likely a bug in umdns package ignoring services in /etc/umdns/*.json.
its on my ~/todo for next week ... so allow me a few days. having written the large part of that code I really wanna fix this I did work when I initially dropped the code, lol
root@ap:~# cat /etc/umdns/printer_service.json | curl -F 'clbin=<-' https://clbin.com
HERE it is to preserve formatting and whitespaces: https://clbin.com/uEsnd
I've checked with https://jsonchecker.com/ and its correct JSON.