A AndroidMadhu Active Member Licensed User Aug 3, 2020 #1 Hello, I want to connect CloudMQTT server using ESP8266. Could you please provide me any tutorials or example please. Thanks
Hello, I want to connect CloudMQTT server using ESP8266. Could you please provide me any tutorials or example please. Thanks
A AndroidMadhu Active Member Licensed User Aug 3, 2020 #2 I am able to connect to WiFi router successfully. But not able to understand the first parameter of the below details B4X: mymqtt.Initialize2 What will be value for Stream and ClientID at Initialize2. Please advice Upvote 0
I am able to connect to WiFi router successfully. But not able to understand the first parameter of the below details B4X: mymqtt.Initialize2 What will be value for Stream and ClientID at Initialize2. Please advice
josejad Expert Licensed User Longtime User Aug 3, 2020 #3 AndroidMadhu said: What will be value for Stream Click to expand... If you see the examples, you have to declare client as WiFiSocken and use client.Stream as first parameter. B4X: Sub Process_Globals Private client As WiFiSocket End Sub AndroidMadhu said: ClientID Click to expand... What is the client id and where do I find it? | CloudMQTT We get a lot of questions about what the client id is and where it can be found. This short article will hopefully help you during your MQTT journey. www.cloudmqtt.com Upvote 0
AndroidMadhu said: What will be value for Stream Click to expand... If you see the examples, you have to declare client as WiFiSocken and use client.Stream as first parameter. B4X: Sub Process_Globals Private client As WiFiSocket End Sub AndroidMadhu said: ClientID Click to expand... What is the client id and where do I find it? | CloudMQTT We get a lot of questions about what the client id is and where it can be found. This short article will hopefully help you during your MQTT journey. www.cloudmqtt.com
janderkan Well-Known Member Licensed User Longtime User Aug 3, 2020 #4 Why dont you use the search function ? https://www.b4x.com/android/forum/threads/mqtt.65669/#content Upvote 0
A AndroidMadhu Active Member Licensed User Aug 6, 2020 #5 Sub Process_Globals Private client As WiFiSocket End Sub Click to expand... Thank you All... I am able to publish the message at CloudMQTT. The only issue is I am able to put any counter value at the Publish function. B4X: mqttclient.Publish("esp","thank you for your m-ESP") How Can I put a counter after ESP string? Upvote 0
Sub Process_Globals Private client As WiFiSocket End Sub Click to expand... Thank you All... I am able to publish the message at CloudMQTT. The only issue is I am able to put any counter value at the Publish function. B4X: mqttclient.Publish("esp","thank you for your m-ESP") How Can I put a counter after ESP string?
josejad Expert Licensed User Longtime User Aug 6, 2020 #6 Try something like: B4X: mqttclient.Publish("esp","thank you for your m-ESP number: " & counterValue) Upvote 0
Try something like: B4X: mqttclient.Publish("esp","thank you for your m-ESP number: " & counterValue)
A AndroidMadhu Active Member Licensed User Aug 6, 2020 #7 It is telling like String Concatenation Operator is not supported Click to expand... Thanks Upvote 0
josejad Expert Licensed User Longtime User Aug 6, 2020 #8 Sorry, I was thinking in B4A. If I'm not wrong, try this: B4X: Private Sub mtimer_Tick counter = counter+1 Dim b() As Byte = "thank you for your m-ESP: " & counter mqttclient.Publish("esp",b) End Sub Please, use [code]...paste your code here...[/code] to show your code Upvote 0
Sorry, I was thinking in B4A. If I'm not wrong, try this: B4X: Private Sub mtimer_Tick counter = counter+1 Dim b() As Byte = "thank you for your m-ESP: " & counter mqttclient.Publish("esp",b) End Sub Please, use [code]...paste your code here...[/code] to show your code
A AndroidMadhu Active Member Licensed User Aug 6, 2020 #9 José J. Aguilar said: Sorry, I was thinking in B4A. If I'm not wrong, try this: B4X: Private Sub mtimer_Tick counter = counter+1 Dim b() As Byte = "thank you for your m-ESP: " & counter mqttclient.Publish("esp",b) End Sub Please, use [code]...paste your code here...[/code] to show your code Click to expand... Super....Its Working..... If I will use GSM SIM 800 instead of WiFi [ESP8266] to connect to CloudMQTT, then should I declare the client same as before ? like below B4X: Private client As WiFiSocket Please advice..... Upvote 0
José J. Aguilar said: Sorry, I was thinking in B4A. If I'm not wrong, try this: B4X: Private Sub mtimer_Tick counter = counter+1 Dim b() As Byte = "thank you for your m-ESP: " & counter mqttclient.Publish("esp",b) End Sub Please, use [code]...paste your code here...[/code] to show your code Click to expand... Super....Its Working..... If I will use GSM SIM 800 instead of WiFi [ESP8266] to connect to CloudMQTT, then should I declare the client same as before ? like below B4X: Private client As WiFiSocket Please advice.....