I been able to successfully connect to clouldMQTT but I have not been able to connect successfully to adafruit.io.
With B4J I can connect but I am not been able to publish or subscribe. Adafruit has a nice platform for debugging and testing topics and payloads.
Thank you,Lee
I have also been able to connect using Arduino IDE, but not using B4R.
I really want to just use B4X products
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
mqtt.Initialize("mqtt", "tcp://io.adafruit.com:1883", "b4a")
Dim mo As MqttConnectOptions
mo.Initialize("user", "ccccccccccccccc840e")
mqtt.Connect
End If
End Sub
Sub MQTT_Connected (Success As Boolean)
Log(Success)
End Sub
Thank you for the helped. Adafruit.io is pretty awesome, and so is B4X.
It was a bit tricky to publish/subscribe. The below code was very helpful to my success.
Thank you for the snip-it also.
Shalom, Lee
B4X:
Dim s As String = "abcde"
Dim bytes() As Byte = s.GetBytes("UTF8")
'and back
s = BytesToString(bytes, 0, bytes.Length, "UTF8")
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.