R rafie dandamun Member Sep 4, 2017 #1 I have a python script in raspberry that output a temperature(TMP007) and it has a MQTT to send to Android App but I dont know to do it. Can anyone help me with my problem? Is my python code compatible with my android app? Attachments TMP007pythoncode.txt 3.8 KB · Views: 231 AndroidAPP.zip 7.8 KB · Views: 208
I have a python script in raspberry that output a temperature(TMP007) and it has a MQTT to send to Android App but I dont know to do it. Can anyone help me with my problem? Is my python code compatible with my android app?
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #2 The MQTT event is: B4X: MessageArrived (Topic As String, Payload() As Byte) You cannot change the payload type. You can use ByteConverter to convert bytes to other types. Upvote 0
The MQTT event is: B4X: MessageArrived (Topic As String, Payload() As Byte) You cannot change the payload type. You can use ByteConverter to convert bytes to other types.
R rafie dandamun Member Sep 5, 2017 #3 Erel said: You cannot change the payload type. You can use ByteConverter to convert bytes to other types. Click to expand... thanks for replying. can you give me a sample for using the byteconverter? I want to get it as a integer Upvote 0
Erel said: You cannot change the payload type. You can use ByteConverter to convert bytes to other types. Click to expand... thanks for replying. can you give me a sample for using the byteconverter? I want to get it as a integer
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2017 #4 There are many examples using ByteConverter: https://www.b4x.com/android/forum/pages/results/?query=ByteConverter Upvote 0
There are many examples using ByteConverter: https://www.b4x.com/android/forum/pages/results/?query=ByteConverter
R rafie dandamun Member Sep 6, 2017 #5 Erel said: Payload() Click to expand... is this payload() an array of bytes? Upvote 0
R rafie dandamun Member Sep 6, 2017 #7 Erel said: Yes. Click to expand... Thanks. Now I know what data type MQTT sends or receives. Upvote 0