-
alxscott started following Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand) , [PhAzE] Plugins for Unraid 5/6 , Silverstone DS380 / ASRock C2550D4I Build and 7 others
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Awesome news about IPy... I kinda gave up what with the IP Address issue and plus I think another plugin was cause sleep issues. Ill give it another go tonight!
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Thanks for posting Nimrodel! Been playing with this for hours now and its giving me headaches! Installed al the packages ( which was an issue due to some of the plugins i run ) Then it still couldnt register with the sleep proxy even after your additions to the go file. That i think was due to me having IPMI and remote management on the board. I think i got around it by hard coding my IP address into the script... But now whenever I try and run the script my server locks and needs hard restarting. Arrrgh!
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Thank you very much Nimrodel that seemed to work a treat! Been busy at work so haven't been able to play around much but now I seem to have the issue where it works as advertised once ie run the script on sleep, services stay advertised and server wakes when accessed... However now if the server sleeps a second time it doesn't seem to keep the services advertised
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Thank you very much, I'll have a play around when I get home tonight!
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Ah, brilliant! Don't know anything about Python so don't suppose you could point me in the right direction?
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
No worrys Greg, that's for all your help anyway! I haven't had time either till recently and I'm still having the link local issues!! Anybody out there got any suggestions? I'm thinking it has something to do with my ApEx configuration...
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Any news on a possible package Greg?!
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Firstly Greg just want to say really appreciate the time your taking with helping me our here! Really good of you! Reference the link local IP allocation : I havent manually set this IP address for my Airport Express. From reading an apple Support document I think the ApEx advertises itself on two addresses, one of which being a link local address so it can always be found via the configuration utility even if there is a net woprk connectivity issue. Below is a screen shot from the Apple Airport Config utility; showing a "normal" network address and a link-local address. I have also configured my network router to assign the Airport Express a static IP address. I restarted my ApEx and my router, ran the above command again and it came back with the same results ie only the link local IP address. I pinged the 192.168.xxx.xxx IP address which the config utility was listing from my unRAID box and it pinged it no problem, its just not detecting it. Dont know if it is of relevance however, I'm not using my ApEx as a access point or anything, its on my network purely for streaming music to another room, and hopefully as acting as a sleep proxy sever! Thanks again for looking at this... Im off to work again!
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Run that command Greg and it it detected it : +;eth0;IPv4;50-35-10-70\032Alex\039s\032AirPort\032Express;_sleep-proxy._udp;local =;eth0;IPv4;50-35-10-70\032Alex\039s\032AirPort\032Express;_sleep-proxy._udp;local;Alexs-AirPort-Express.local;169.254.85.73;63516
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Cheers for that Greg... I'm at work at minute but I'll try when I finish and let you know! Alex
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Can anybody send some help this way?!?
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Greg, very much appreciated you taking the time to post the walk through for installing your script! However.com, All bonjour advertised services from my unRAID box are dying 30-40 seconds after the box has gone to sleep . Its been a very quick trial as I only have an hour before starting work, however this is where I'm at so far... Copied the required packaged both PythonDNS and Python to /boot/extras and installed without reboot. Installed your script to /boot/scripts/. Installed your modified WebGUI and S3Sleep addon. Added the script call line to the Sleep Settings with eth0 <myip> and <my-unRAID-HW-ADD>. Rebooted. Selected Sleep Now from the WebGUI, sever went to sleep after 5-8 seconds. Tried connecting from my Mac... No connection. Checked Bonjour Browser... Saw services advertised for 30 seconds, then the disappeared. Woke my Server and ran the script from console to see any errors... Saw none. Restarted my Airport Express ( for info the APEx is showing the sleep proxy service on BonjourBrowser) Tried Sleep again, same issues... Wrote this and now heading to work! haha Any ideas? UPDATE: Well, I've never looked at a python script in my life never mind debugged one, but i ran : python -m trace --trace /boot/scripts/sleepproxyclient.py eth0 192.168.1.67 00:25:90:38:2d:a4 | grep sleepproxyclient.py > debug.txt I hoped to get an output of where the script is failing, as it brings up no error message or issue when I run it. It seems to end on the "No sleep proxy" arguement, although I can defo confirm there is one showing on the network on my BonjourBrowser. Hope this helps cause I'm way out of my depth! haha sleepproxyclient.py(22): import dns.update sleepproxyclient.py(23): import dns.query sleepproxyclient.py(24): import dns.rdtypes sleepproxyclient.py(25): import dns.rdata sleepproxyclient.py(26): import dns.edns sleepproxyclient.py(27): import dns.rrset sleepproxyclient.py(28): from dns.exception import DNSException sleepproxyclient.py(30): import struct sleepproxyclient.py(31): import sys sleepproxyclient.py(32): import subprocess sleepproxyclient.py(33): import socket sleepproxyclient.py(42): DEVICE_MODEL = "unRAID" sleepproxyclient.py(47): TTL_long = 7200 # 2 h sleepproxyclient.py(51): TTL_short = 120 sleepproxyclient.py(54): def main() : sleepproxyclient.py(63): def sendUpdateForInterface(interface) : sleepproxyclient.py(145): def discoverServices(ip): sleepproxyclient.py(172): def discoverSleepProxies(interface): sleepproxyclient.py(194): main() sleepproxyclient.py(56): iface = sys.argv[1] sleepproxyclient.py(57): try: sleepproxyclient.py(58): sendUpdateForInterface(iface) sleepproxyclient.py(66): proxies = discoverSleepProxies(interface) sleepproxyclient.py(175): proxies = [] sleepproxyclient.py(176): cmd = "avahi-browse --resolve --parsable --no-db-lookup --terminate _sleep-proxy._udp 2>/dev/null | grep '=;.*;IPv4;'" sleepproxyclient.py(178): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) sleepproxyclient.py(179): for line in p.stdout.readlines(): sleepproxyclient.py(180): lineArr = line.rsplit(";") sleepproxyclient.py(183): if (len(lineArr) < 10) : sleepproxyclient.py(187): ip = lineArr[7] sleepproxyclient.py(188): port = lineArr[8] sleepproxyclient.py(189): proxies.append({ "ip" : ip, "port" : port}) sleepproxyclient.py(179): for line in p.stdout.readlines(): sleepproxyclient.py(191): retval = p.wait() sleepproxyclient.py(192): return proxies sleepproxyclient.py(67): if (len(proxies) == 0) : sleepproxyclient.py(71): ip4Addr = sys.argv[2] sleepproxyclient.py(72): hwAddr = sys.argv[3] sleepproxyclient.py(75): ip4Arr = ip4Addr.rsplit(".") sleepproxyclient.py(76): ip4ArrInv = ip4Arr[:] sleepproxyclient.py(77): ip4ArrInv.reverse() sleepproxyclient.py(78): ip4Inv = ".".join(ip4ArrInv) sleepproxyclient.py(80): host = socket.gethostname() sleepproxyclient.py(81): host_local = host + ".local" sleepproxyclient.py(84): update = dns.update.Update("") sleepproxyclient.py(87): update.add(ip4Inv + '.in-addr.arpa', TTL_short, dns.rdatatype.PTR, host_local) sleepproxyclient.py(88): update.add(host_local, TTL_short, dns.rdatatype.A, ip4Addr) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(148): services = [] sleepproxyclient.py(149): cmd = "avahi-browse --all --resolve --parsable --no-db-lookup --terminate 2>/dev/null | grep '=;.*;IPv4;' | grep ';" + ip + ";'" sleepproxyclient.py(151): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(148): services = [] sleepproxyclient.py(149): cmd = "avahi-browse --all --resolve --parsable --no-db-lookup --terminate 2>/dev/null | grep '=;.*;IPv4;' | grep ';" + ip + ";'" sleepproxyclient.py(151): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(153): lineArr = line.rsplit(";") sleepproxyclient.py(156): if (len(lineArr) < 10) : sleepproxyclient.py(161): if (lineArr[7] == ip) : sleepproxyclient.py(162): service = lineArr[4] sleepproxyclient.py(163): port = lineArr[8] sleepproxyclient.py(164): txtRecords = lineArr[9].replace('" "', ';').replace('\n', '').replace('"', '').rsplit(';') sleepproxyclient.py(165): services.append([service, port] + txtRecords) sleepproxyclient.py(152): for line in p.stdout.readlines(): sleepproxyclient.py(167): retval = p.wait() sleepproxyclient.py(168): return services sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[i] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[i] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[i] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(99): txtrecord = chr(0) sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(99): txtrecord = chr(0) sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(99): txtrecord = chr(0) sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[ i ] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[i] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(92): type = service[0] + ".local" sleepproxyclient.py(93): type_host = host + "." + type sleepproxyclient.py(94): port = service[1] sleepproxyclient.py(97): txtrecord = "" sleepproxyclient.py(98): if (len(service) == 2 or service[2] == "") : sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(102): txtrecord += " " + service[i] sleepproxyclient.py(101): for i in range(2,len(service)) : sleepproxyclient.py(104): update.add(type_host, TTL_long, dns.rdatatype.TXT, txtrecord) sleepproxyclient.py(105): update.add('_services._dns-sd._udp.local', TTL_long, dns.rdatatype.PTR, type + ".local") sleepproxyclient.py(106): update.add(type, TTL_long, dns.rdatatype.PTR, type_host) sleepproxyclient.py(107): update.add(type_host, TTL_short, dns.rdatatype.SRV, "0 0 " + port + " " + host_local) sleepproxyclient.py(91): for service in discoverServices(ip4Addr) : sleepproxyclient.py(111): update.add(host + '._device-info._tcp.local.', TTL_long, dns.rdatatype.TXT, "model=" + DEVICE_MODEL + " state=sleeping") sleepproxyclient.py(117): leaseTimeOption = dns.edns.GenericOption(2, struct.pack("!L", 7200)) sleepproxyclient.py(121): cleanMAC = hwAddr.replace(":", "") sleepproxyclient.py(122): ownerOption = dns.edns.GenericOption(4, ("0000" + cleanMAC).decode('hex_codec')) sleepproxyclient.py(127): update.use_edns(0, TTL_long, 1440, None, [leaseTimeOption, ownerOption]) sleepproxyclient.py(130): for proxy in proxies : sleepproxyclient.py(131): try: sleepproxyclient.py(132): errStr = "Unable to register with SleepProxy " + proxy['ip'] + ":" + proxy['port'] sleepproxyclient.py(134): response = dns.query.udp(update, proxy['ip'], timeout=10, port=int(proxy['port'])) sleepproxyclient.py(140): except DNSException, e: sleepproxyclient.py(141): print e sleepproxyclient.py(130): for proxy in proxies :
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Hahaha! Two hours of my life I'll never get back! That would be brilliant mate, thanks again for your time! Alex
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Definitely leaving this one with you Greg... Just spent the last two hours trying to get python to compile ( don't know why it wouldn't, I've done it before!!) and also trying to find a slackware package for netifaces... Failed miserably on both!! Haha
-
Apple Bonjour Sleep Proxy Client Implementation (Wake on Demand)
Greg, Thanks for letting me know! Was just logging on to ask! Haha. Thanks again! Alex
alxscott
Members
-
Joined
-
Last visited