B4R Question mqtt.Publish(topic, s.GetBytes) freezes MKR1010 with ETH shield controller.

Åke Artklo Bravida

Member
Licensed User
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?

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]
 

Åke Artklo Bravida

Member
Licensed User
Ok to bad.

Is it possible to use wifi on the controller. Uses WiFiNINA.
I need microcontroller with 12 bit Analog input and ethernet connection.
Is YUN an alternative with use off ethernet?
 

Åke Artklo Bravida

Member
Licensed User
ESP32 seems to be used a lot here I never used it, But I can test it. So if I use MKR1010 with ESP32 is thar what you mean?
Is there any other controller with 12 bit Ananlog input that works with B4R and ethernet or wifi ?
 
Top