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

How to connect to a broker on the network #554

Open
GraceStangroome opened this issue Sep 27, 2023 · 4 comments
Open

How to connect to a broker on the network #554

GraceStangroome opened this issue Sep 27, 2023 · 4 comments

Comments

@GraceStangroome
Copy link

Hello, I'm new to programming in Swift and networking, so please be gentle, but I'm really confused about how I actually get the Swift app to connect to a broker. I have the App working okay, and the broker works, and I essentially copied the example in the GitHub, but now what? What functions do I need to call, and how do I call them? My broker is a Raspberry Pi on the same network as the iPad.

I really appreciate any help you can provide.

@leeway1208
Copy link
Collaborator

Hello. You can run the demo first and try to read the code. If you have the problem, you can list here. Thks~

@GraceStangroome
Copy link
Author

GraceStangroome commented Oct 11, 2023

I did that, and I am still struggling. It doesn't seem to be connecting to the broker at all. Any advice?

I think a bad connection isn't working correctly. When I try to use it and the broker is switched off (so cannot be working), the debug output says it connected and subscribed to a topic and published a message. When I look at the logs on the broker when it is switched on, it states a new connection from the iPad IP's, and then says Client disconnected due to protocol error.

@leeway1208
Copy link
Collaborator

It seems like there is a problem with the broker settings?

@GraceStangroome
Copy link
Author

I think that's fine because when I connect to the broker and publish from my Mac's terminal, everything works as expected, so it's definitely due to my Cocoa code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants