MQTT > MQTT

Trouble sending/receiving data to CloudMQTT

(1/2) > >>

babramovitch:
I'm having problems sending/reading data to/from cloudMQTT.

I watched the below video but the gateway UI is different now, so I'm not sure if I'm doing something wrong with all the latest changes, or doing something else that's wrong. 

https://www.youtube.com/watch?v=WfkQmg5P-3k

Specifically the YouTube video doesn't have client id, or WiFi settings but from what I can gather the client id is anything I want thats unique? I've tried with/without WiFi settings as well with no luck. If I'm already connected to the WiFi, are the settings required? I'm assuming that's if I want MQTT to transmit over a different network?

In the Android app, I can connect, and I subscribe but receive nothing. I've tried subscribing to mcThings/#, as well as mcThings, mcThings/, mcThings/*, #, *

I've attached all my settings.

I tried the MotionSensor app and the MQTT portion wasn't working, so to simplify things I'm trying the below right now.

Class Blinky
    Shared Event GreenLed() RaiseEvent Every 2000 milliSeconds       
        Dim payload As ListOfByte = New ListOfByte
        Dim payString As String = ""
       
        payString = "test payload"
       
        LedGreen = Not LedGreen         
       
        payload.Add(payString)
        Lplan.Publish("mcThings/Testing", payload)       
    End Event 
End Class

mc-T2:
Hi Babramovitch,

Yes, that video was put together using an older version of mcStudio (when the gateway configuration did not include all the features as it does today).

Client ID - You have the same client ID in your gateway settings as you do in your app settings - this could be the problem. They need to be unique (not the same) otherwise they can't 'talk' to eachother. Try changing the client ID either in the gateway config or on the app to something different and try it out.

As for WIFI, You can connect the gateway using WPS or, you can enter the SSID and Password into the gateway configuration (you need to connect the gateway to either WPS or ethernet first to be able enter those details). If you are already connected to WIFI (most likely through WPS), then you don't need to enter the SSID and password info - the gateway will remember the WPS details and continue to connect to that network until you change it

Everything else appears to be good - let us know if changing the client ID allows this to work for you
Thanks!

babramovitch:
Ah, I thought it meant unique as in not being used by someone else, but used by you everywhere. 

I've changed the client id to be different on the Android device (added a few digits to the end), restarted the app and reconnected in addition to restarting the gateway/module program,  but I'm still not receiving anything after 10 minutes.

mc-T2:
Can you try leaving the client ID blank within the gateway configuration and also, subscribe to the exact topic (mcThings/Testing) in the application and see if that works.

As you can see from the video, this does work!  :) just need to figure out where this is going wrong for you

babramovitch:
Still no luck =(

I removed the client id from the gateway configuration, and added a sub to mcThings/Testing in the Android app. 

I also tried rebooting the CloudMQTT server, this is the startup details that appear under the server log


--- Quote ---1507051319: mosquitto version 1.4.10 terminating
1507051319: mosquitto version 1.4.10 (build date Thu, 25 Aug 2016 15:32:03 +0100) starting
1507051319: Config loaded from /var/lib/mosquitto/10933/mosquitto.conf.
1507051319: Opening ipv4 listen socket on port 20933.
1507051319: Opening websockets listen socket on port 30933.
1507051319: Opening ipv4 listen socket on port 10933.
1507051406: New connection from my.phones.ip.address on port 10933.
--- End quote ---

I can see my phone connecting in the server logs, but I don't my computer (mcGateway) connect. 

Navigation

[0] Message Index

[#] Next page

Go to full version