Windows dns-sd (Bonjour/ZeroConf) did not discover iPhone service via USB - ios

I have a Bonjour _http._tcp. service published on iPhone. With the iPhone Wifi Off; running the following dns-sd command on MacBook's terminal:
dns-sd -B _services._dns-sd._udp
then connect the iPhone to MacBook with USB Lighting cable, dns-sd would discover the following iPhone service:
Timestamp A/R Flags if Domain Service Type Instance Name
19:22:45.126 Add 3 5 . _tcp.local. _http
disconnect the USB Lighting cable from the MacBook would show:
Timestamp A/R Flags if Domain Service Type Instance Name
19:22:45.126 Add 3 5 . _tcp.local. _http
19:23:53.924 Rmv 1 5 . _tcp.local. _http
However, repeating the above steps (running dns-sd, connect and disconnect USB Lighting to PC) on Windows 10 PC, dns-sd did not discover the service.
With the iPhone Wifi On, dns-sd on PC would discover the iPhone service:
Timestamp A/R Flags if Domain Service Type Instance Name
19:32:36.238 Add 2 13 . _tcp.local. _http
when the iPhone Wifi Off, dns-sd on PC would show:
Timestamp A/R Flags if Domain Service Type Instance Name
19:32:36.238 Add 2 13 . _tcp.local. _http
19:33:38.471 Rmv 0 13 . _tcp.local. _http
I had Bonjour SDK v333.10 installed from https://developer.apple.com/download/more/?=Bonjour%20SDK%20for%20Windows; and iTunes is working fine (can show the iPhone) on the PC too.
Why dns-sd (Bonjour/ZeroConf) on PC did not discover the iPhone service via USB?
Many thanks.

Bounjour communication is Socket base. When the iPhone is connected to the MacBook via USB cable, MacBook assigns a private IP address (169.254.x.x) to the iPhone.
Using Discovery - DNS-SD Browser on MacBook, when the iPhone's wifi is Off, Discovery shows the discovered Bonjour service via USB, with the private IP address:
When the iPhone's wifi is On, Discovery will show the discovered Bonjour service with two IP addresses (one wifi's, and one USB's):
Therefore, dns-sd on MacBook was able to discover the service on iPhone without wifi.

Related

Connecting an iPhone to a libvirt virtual machine running OSX

I have created an OSX Mojave virtual machine and am attempting to pass an iPhone to it, so that I can use XCode. I have tested passing a keyboard through to the guest, and this works fine. However, the iPhone does not.
When I use virt-manager to add the USB Host Device, the iPhone makes a sound to indicate it has been connected, however, it does not appear to be connected to the guest.
Some things I have noticed that may help with resolving this:
If I add the USB Host Device, and then very quickly switch to the VM and run system_profiler SPUSBDataType, the iPhone is shown as connected. This only lasts for a few seconds though. Running system_profiler SPUSBDataType after a few seconds shows the iPhone is no longer connected.
I have tested passing the iPhone to a Linux guest. When passing it to a Linux guest, it does seem to stay connected.
People have reported success passing an iPhone to a VMWare virtual machine by adding usb.quirks.device0 = "0x05ac:0x12a8 skip-reset, skip-refresh, skip-setconfig" to their VMWare VMX file, I mention this as I think replicating these settings in libvirt somehow may resolve the issue.
When I add the USB Host Device, I get this in dmesg on the host:
[178165.281031] audit: type=2501 audit(1540468134.413:1654): pid=604 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=cgroup reason=allow vm="macos-high-sierra" uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 cgroup="/sys/fs/cgroup/devices/machine.slice/machine-qemu\x2d34\x2dmacos\x2dhigh\x2dsierra.scope/" class=path path="/dev/bus/usb/003/050" rdev=BD:131 acl=rw exe="/usr/bin/libvirtd" hostname=? addr=? terminal=? res=success'
[178165.284135] audit: type=2501 audit(1540468134.417:1655): pid=604 uid=0 auid=4294967295 ses=4294967295 msg='virt=kvm resrc=dev reason=attach vm="macos-high-sierra" uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 bus=usb device="003.050" exe="/usr/bin/libvirtd" hostname=? addr=? terminal=? res=success'
[178165.562355] usb 3-11: reset high-speed USB device number 50 using xhci_hcd
[178165.702290] usb 3-11: device firmware changed
[178165.702489] usb 3-11: USB disconnect, device number 50
[178165.825523] usb 3-11: new high-speed USB device number 51 using xhci_hcd
[178165.966944] usb 3-11: New USB device found, idVendor=05ac, idProduct=12a8, bcdDevice= 6.01
[178165.966946] usb 3-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[178165.966948] usb 3-11: Product: iPhone
[178165.966949] usb 3-11: Manufacturer: Apple Inc.
[178165.966950] usb 3-11: SerialNumber: 71e8245949fde7db02fa88199e22c939196f3ec1
It seems like the iPhone is reconnecting (maybe it's changing connection mode?) and that libvirt is then not passing it back to the guest?

Unable to connect Rainbow Hat/Raspberry pi3 with Android Things using adb

I'm using Pimoroni Rainbow-Hat Raspberry pi3 kit. I have loaded android things image on sdcard. I have power cable and ethernet cable connected.
I can see Android things boot screen on display but i don't see the IP.
When i try to connect with adb connect Android.local it's not working(getting unknow host). I tried the ethernet cable from pi3 ethernet port to laptop , i can see the lan ip when i do ipconfig /all but when i try adb connect <-ip-:5555, still connection gets refused. but am able ping to the ip.
I am using Windows 7 OS.
Tried turning off IP v6, Windows Firewall, rebooting host etc, still not able to connect.
My main problem is getting the Aot device recognised on the host and load the app onto it.
I'm aware but haven't tried usb to ttl serial cable option mentioned here
I'm familiar with Android but new to iot/Aot , any help about where i am going wrong would be appreciated.
When i try to connect with adb connect Android.local it's not working(getting unknow host).
I tried the ethernet cable from pi3 ethernet port to laptop
The Raspberry Pi is a computer in its own right.
You need to connect the ethernet cable from the Pi3 to your router aka to the local network (not into your computer directly)
The follow the steps from the docs here and setup wifi to avoid further cable issues.

iPhone Personal Hotspot not discoverable

I'm building an application which allows to connect an other device to my iPhone's hotspot. After enabling the "Personal Hotspot" in the iPhone settings, my other device detects the hotspot...
I use this command to check if the hotspot is on the network:
$> sudo iwlist wlan0 scanning | grep MyDeviceName;
ESSID:"MyDeviceName"
But if I leave this setting view (on my iPhone) and I open any other app that need internet (example: Safari), the hotspot is not any more discoverable ... until I go back on the "Personal Hotspot" setting page.
$> sudo iwlist wlan0 scanning | grep MyDeviceName;
(no result)
I've tested this command on ubuntu 14.10 and Raspbian, but my macbook and iPhone don't see the hotspot the network list.
I is created with iPhone5(iOs8.3) and iPhone6(iOs8.4) on iOS 8.
From Apples official Get help with Personal Hotspot in iOS support page:
Your device will stop broadcasting Wi-Fi if you put it to sleep or if 90 seconds elapse and no connected devices use Wi-Fi. To share your Wi-Fi network again, tap Settings > Personal Hotspot.
But my experience is that the devices stops broadcasting the Wi-Fi directly when you leave the Personal Hotspot settings page.

Connect ios devices to local server via wifi

I have a localhost server on my laptop. Can I connect ios device to this localhost server through wifi?
What settings I must set up on wifi connection?
By localhost server , i assume you are talking about a HTTP server .
If you know the port on which the server is listening to , note it down.
If you dont , generally web servers are attached to port 80.
If both laptop and ios device is connected to the same network.
Then first note down the IPAddress of you laptop.
In windows you can do so by typing : ipconfig in the command prompt
In Unix or Linux based systems : type ifconfig in the terminal.
Lets assume you found out that your ipaddress is 192.168.1.2
Note down this IP Address of your wifi adapter.
Now , just type in IPAddress:Port in the web browser of your ios device to access the server.
eg: Type in 192.168.1.2:80 on the url bar of ios device.

discover iOS device name using mDNS

I notice that some of the better network discovery apps like Fing for iOS and iNet for Mac are able to discover the device name of iOS devices and Mac devices even when they are not advertising Bonjour services such as iTunes Wi-Fi Sync. How is this done? I am aware of how to do a reverse mDNS query https://serverfault.com/questions/143184/how-do-i-get-the-machine-name-from-an-ip-via-multicast-dns. But while a reverse mDNS lookup (at least as accomplished by the dig command dig -x the.ip #224.0.0.251 -p 5353) will work against a Mac that is not otherwise broadcasting any Bonjour services, it doesn't work unless Wi-Fi Sync is running or some other Bonjour service on an iOS device. I am not sure how to get the name otherwise but these apps reliably get it. I used Wireshark while iNet was discovering and I only see ICMP and NetBios queries all which return 0 answers.
Also note that I have the IP address of the device already by doing a broadcast ping and then parsing the ARP table. I want to discover which of the devices discovered in this way are iOS devices by getting their device name and looking for the string "iPhone" or "iPad".
Also note that the iNet app website provides the following about how they do reverse IP lookups. I take this to mean they do a reverse DNS lookup and a reverse mDNS lookup for every IP.
Reverse IP lookups (host­names) are per­formed as unicast and mul­ti­cast queries for every IP found. -http://www.bananaglue.de/inet/index_e.php
Have you tried the dns-sd command line tool?
If you type dns-sd -B _services._dns-sd._udp to get all available services, you'll see there's a _whats-my-name service available.
$ dns-sd -B _services._dns-sd._udp
Browsing for _services._dns-sd._udp
DATE: ---Tue 16 Dec 2014---
14:38:30.746 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
14:38:30.747 Add 3 5 . _tcp.local. _nfs
14:38:30.747 Add 3 5 . _tcp.local. _afpovertcp
14:38:30.747 Add 3 5 . _tcp.local. _smb
14:38:30.747 Add 2 0 . _tcp.local. _whats-my-name
14:38:31.330 Add 3 10 . _tcp.local. _nfs
14:38:31.330 Add 3 10 . _tcp.local. _afpovertcp
14:38:31.330 Add 2 10 . _tcp.local. _smb
after that we can query for this service which outputs the following:
$ dns-sd -B _whats-my-name._tcp
Browsing for _whats-my-name._tcp
DATE: ---Tue 16 Dec 2014---
14:40:20.738 ...STARTING...
Timestamp A/R Flags if Domain Service Type Instance Name
14:40:20.742 Add 2 0 local. _whats-my-name._tcp. Blub MacBook Pro
The Instance Name is the interesting part here. I assume the _whats-my-name service is available on every computer running bonjour. Maybe you can hunt down the sent queries and reconstruct it with basic bash tools if you can't access dns-sd in every case. More over you should not use dns-sd in your script. Instead you should use a specific implementation of the protocol for your programming language.
Note: Be aware that the name of the device may not be reliable to detect which device you are communicating with
Hope that helps.

Resources