MQTT Integration for "au1" not publishing messages

Hi,

I’m trying to get the MQTT integration working on the “au1” region.

I was initially attempting to subscribe with paho-mqtt in Python, but have moved on to just trying mosquitto_sub for troubleshooting.

If I run the following:
mosquitto_sub -d -h au1.cloud.thethings.network -p 8883 -u 'gps-tracker@ttn' -P 'secret-key' -t 'v3/gps-tracker/devices/mygps/up' -v

It sits there with the output:
Client mosq-AK5uKe2jbJLKst57e9 sending CONNECT
Client mosq-AK5uKe2jbJLKst57e9 sending CONNECT
Client mosq-AK5uKe2jbJLKst57e9 sending CONNECT
Client mosq-AK5uKe2jbJLKst57e9 sending CONNECT

No messages are received and I am yet to receive any other responses.

I’ve tried a new API key and tried wildcards in the subscription path like ’ v3/gps
-tracker/devices/+/up’.

Paho MQTT seemed to actually subscribe, giving me:
log: Received SUBACK
log: Sending PINGREQ
log: Received PINGRESP
log: Sending PINGREQ
log: Received PINGRESP

But I could never received any messages.

Here’s the relevant section of my Python script:

def on_connect(client, userdata, flags, rc):
    print(f'Connected with result code {rc}')
    client.subscribe(f'v3/{app_id}/devices/{dev}/up')

def on_subscribed(client, userdata, mid, granted_qos):
    print("Subscribed mid: " + str(mid) + ", qos: " + str(granted_qos))

def on_message(client, userdata, msg):
    #message = json.loads(msg.payload.decode("utf-8"))
    #values = message['payload_fields']
    print("TEST")

def on_log(client, userdata, level, buf):
    print("log: ",buf)

def client_init():
    client = mqtt.Client()
    client.on_connect = on_connect
    client.on_subscribed = on_subscribed
    client.on_message = on_message
    client.on_log = on_log
    client.tls_set()
    client.username_pw_set(f'{app_id}@ttn', password=ttn["password"])
    client.connect(ttn["server"], ttn["port"], 60)
    client.loop_forever()


if __name__ == "__main__":

     # Connect to TTN
    client_init()

     # Loop over everything
    print("Starting main loop..")
    #client.loop_forever()

You might want to try subscribing to all aka #

This is the code used on the Summer Academy:

that you could try - didn’t hear of any issues from the AU1 region users.

Thanks @descartes for the tip.

That also gives me nothing, so that rules out my topics.

I guess I’ll try a whole new application and see how I go, but something is definitely up.

Okay, I managed to get this working.

Seems it was the topic all along (I’m not sure what else I fixed… long day).

In the end, I had to subscribe to ‘v3/gps-tracker@ttn/devices/mygps/up’, noting the ‘@ttn’ as in the username.

Doh! Part of me feeling guilty I didn’t spot you hadn’t got the @ttn in the topic on your command line - but we got there in the end.