Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qmdnsengine doesn't work anymore with iOS 16 or Ventura #1011

Closed
cagnulein opened this issue Oct 28, 2022 · 24 comments
Closed

qmdnsengine doesn't work anymore with iOS 16 or Ventura #1011

cagnulein opened this issue Oct 28, 2022 · 24 comments
Assignees
Labels
Milestone

Comments

@cagnulein
Copy link
Owner

the same QZ version on iOS 15 works fine

@p3g4asus I will investigate this myself, if you have time, could you also confirm me this? I can't see anymore the advertising frames from QZ. It still works flawlessy with the same QZ from today on my wife iphone with iOS 15.7

@cagnulein cagnulein added this to the 2.11 milestone Oct 28, 2022
@cagnulein cagnulein self-assigned this Oct 28, 2022
@p3g4asus
Copy link
Contributor

I will investigate on this this weekend. I will have to update my hardware.

@cagnulein
Copy link
Owner Author

cagnulein commented Oct 28, 2022 via email

@cagnulein
Copy link
Owner Author

cagnulein commented Oct 28, 2022

writeDatagram returns -1 Network unreachable
i'm investigating....

@cagnulein
Copy link
Owner Author

ok got the problem, apple is enforcing the multicast entitlement, i changed from the broadcast ip to the localip of zwift and it's working now...i have to find a clean solution anyway

@cagnulein
Copy link
Owner Author

cagnulein commented Oct 28, 2022

unfortunately, i have to port the code on swift and use the nwlistener, there is no easy way. I will post also in the qmdns repository. I will start this, this evening. I hope it would be easy

@cagnulein
Copy link
Owner Author

@cagnulein
Copy link
Owner Author

I found a dirty trick. Instead of using the mdsn broadcast address, i'm using the local broadcast. For example if my local ip is 192.168.0.1 i'm using 192.168.0.255

it works on rgt and zwift both

@p3g4asus
Copy link
Contributor

Nice idea. I had it too but would like to test myself before sharing. Remember to take into account network mask for calculating broadcast address.

@cagnulein
Copy link
Owner Author

yes it's what i'm doing right now ;) thanks for the reminder ;)

@p3g4asus
Copy link
Contributor

I mean broadcast is 192.168.0.255 if network mask is/24 (255.255.255.0). But different network mask implies different broadcast address.

@cagnulein
Copy link
Owner Author

yes i got it :) i'm searching on stackoverflow a ready to implement code :D

@p3g4asus
Copy link
Contributor

p3g4asus commented Oct 28, 2022

Broadcast=(myip & mask)| ((1<<(32-mask))-1)

@cagnulein
Copy link
Owner Author

thanks as always ;)

@cagnulein
Copy link
Owner Author

maybe also better https://stackoverflow.com/a/777631/831272 ? :D

@p3g4asus
Copy link
Contributor

Oh yes definitely 😁

cagnulein added a commit to cagnulein/qmdnsengine that referenced this issue Oct 28, 2022
qmdnsengine doesn't work anymore with iOS 16 or Ventura #1011
cagnulein/qdomyos-zwift#1011
@cagnulein cagnulein reopened this Oct 29, 2022
@cagnulein
Copy link
Owner Author

unfortunately it's not so reliable. I asked to apple the entitlement to send unicast frames. I'm saying good luck to myself

@cagnulein
Copy link
Owner Author

Eureka! Maybe...My problem was about that I was unable to change the hostname on the adv frame, but using this library it seems that I can https://github.com/neverware-mirrors/avahi/blob/d1e71b320d96d0f213ecb0885c8313039a09f693/avahi-compat-libdns_sd/null-test.c and I don't need the entitlements. Let's see if I can use it

@cagnulein
Copy link
Owner Author

unfortunately this code

DNSRecordRef recordRef;
              const char *hostname = serverName.toUtf8().constData();
              DNSServiceErrorType error;
              DNSServiceRef dnsRef;
              
              struct in_addr *addr = atoaddr("192.168.0.46");
              
              error = DNSServiceCreateConnection(&dnsRef);
              if (error){
                  qDebug() << "error";
              }
              qDebug() << hostname;
              error =  DNSServiceRegisterRecord(dnsRef,
                                &recordRef,
                                kDNSServiceFlagsUnique | kDNSServiceFlagsShareConnection, //kDNSServiceFlagsShared | kDNSServiceFlagsAllowRemoteQuery,
                                0,
                                hostname,
                                kDNSServiceType_A,
                                kDNSServiceClass_IN,
                                                sizeof(struct in_addr),
                                                addr,
                                240,
                                TXTRegisterCallback,
                                NULL);

seems to be ineffective on iOS

@cagnulein
Copy link
Owner Author

partially fixed, at least with Zwift (doesn't work with Wahoo RGT yet).
The main issue is the fact that with 192.168.0.255, the qmdns library can't register the new hostname Wahoo KICKR 0000.
So my workaround is, set the hostname as the current device name, in order to make Zwift discoverable.
In this way Zwift can connect to QZ on Wahoo as before.
The only downside is that QZ must be running after zwift, because, for now, QZ just streams the ADV frame over Bonjour (192.168.0.255) only one time. I think it's fixable, but for now it's just a little issue.

I will test this on a real session later this week.

@cagnulein
Copy link
Owner Author

also this one could be useful in case https://github.com/cagnulein/publish-mdns-hostname/blob/master/README.md

drmason789 pushed a commit to drmason789/qdomyos-zwift that referenced this issue Nov 8, 2022
drmason789 pushed a commit to drmason789/qdomyos-zwift that referenced this issue Nov 8, 2022
@cagnulein
Copy link
Owner Author

@p3g4asus

Hello,

Your request to use Multicast Networking was approved. You can now add the Multicast Networking entitlement with your Provisioning Profile.

Instructions for using the entitlement are available and, for more information on using multicast, please read How to use multicast networking in your app. If you have questions or issues, please use the “Network” tag on the Apple Developer Forums.

Best regards,
Apple Networking

@cagnulein
Copy link
Owner Author

Ok I guess also Zwift needs the entitlement. The Zwift version on iOS doesn't work anymore even with the entitlement, instead the MacOS one works beatifully, so I guess the issue now it's zwift. I will investigate this in the Zwift forum

@cagnulein cagnulein modified the milestones: 2.11, 2.12 Nov 19, 2022
@cagnulein
Copy link
Owner Author

i'm closing this one, since now it's only a zwift issue

@cagnulein cagnulein modified the milestones: 2.12, 2.11 Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants