I try to publish data with mqtt.Publish("Termoelement", s.GetBytes) I use this code on Arduino ethernet and it's running as it should.
But I try to use exactly the same code with MKR1010 and MKR ETH shield but MKR1010 stops program on line "mqtt.Publish("Termoelement", s.GetBytes)"
If I send one byte it's ok no problem. But when I try to send more than one byte the controller freezes.
How can I solve this issue?
But I try to use exactly the same code with MKR1010 and MKR ETH shield but MKR1010 stops program on line "mqtt.Publish("Termoelement", s.GetBytes)"
If I send one byte it's ok no problem. But when I try to send more than one byte the controller freezes.
How can I solve this issue?
B4X:
If avIndex = 2 Then
If ethClient.Connected Then
Dim tempData As Float = 0
For i = 0 To 2
tempData = tempData + averageData(i)
Next
tempAverage = tempData / 3
Log("SendTopic tempAvergae: ", tempAverage)
Dim s As String = NumberFormat(tempAverage, 0, 1)
Log("Average = ", s)
mqtt.Publish("Termoelement", s.GetBytes)
Log("Average Temperature published: ", s.GetBytes)
avIndex = 0
Else
Log("Error: Ethernet not connected")
End If
End If
avIndex = avIndex + 1
/[CODE]