CocoaMQTT
CocoaMQTT copied to clipboard
How to connect to a broker on the network
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.
Hello. You can run the demo first and try to read the code. If you have the problem, you can list here. Thks~
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
It seems like there is a problem with the broker settings?
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