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

Discussion in 'B4R Questions' started by Åke Artklo Bravida, Oct 19, 2019.

  1. Åke Artklo Bravida

    Å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?

    Code:
    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, 01)
                
    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]
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Probably a compatibility issue of the underlying Ethernet library.
     
  3. Åke Artklo Bravida

    Å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?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    What about ESP32 connected with Wifi?
     
  5. Åke Artklo Bravida

    Å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 ?
     
  6. Åke Artklo Bravida

    Åke Artklo Bravida Member Licensed User

    Ok I found this Initial support for ESP32 seems to be a powerfull controller. But I try with Arduino IDE first.

    Thanks
     
Loading...
  1. 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.
    Dismiss Notice