Hoping I can get some help here. I noticed that the CocoaMQTT github belonged to emqx.
I’m trying to set up an app so that an apple iPad is a client, and a raspberry pi is a broker. Naturally the iPad app is in Swift and I’m coding in XCode on a Macbook. My Macbook and the raspberry pi both run MQTT. When I’m using mosquitto in command line, it works perfectly, I can send and receive messages on both. So clearly there’s nothing wrong with my broker?
For the iPad app, I am using CocoaMQTT, and the code I’ve got so far is here: GitHub - GraceStangroome/AccessibilityGuideSSGB: The iPad application for an Accessibility Guide for the SS Great Britain, a museum in Bristol. Relies on an MQTT server and RFID reader.
My problem is that, in the CocoaMQTT logs say nothing is wrong and everything is fine (apart from it never recieving messages). The broker logs say
New connection from [raspberry pi IP address] on port 1883 Client <unknown> disconnected due to protocol error
Straight after each other. I’m not sure what to do. Someone from CocoaMQTT suggested something could be wrong with my broker’s config file? In case it is, I’ve included that below. Thanks for any help
# Place your local configuration in /etc/mosquitto/conf.d/ # # A full description of the configuration file is at # /usr/share/doc/mosquitto/examples/mosquitto.conf.example pid_file /var/run/mosquitto/mosquitto.pid persistence true persistence_location /var/lib/mosquitto/ log_dest file /var/log/mosquitto/mosquitto.log log_type all include_dir /etc/mosquitto/conf.d listener 1883 0.0.0.0 # port 1883 protocol mqtt allow_anonymous false password_file /etc/mosquitto/mqtt-pass