B4J Question Amazon Echo Discovery


Well-Known Member
Licensed User
Longtime User

I have an Amazon Echo Dot and trying to create a mini bridge using B4J.

Based on my research I should be able to listen on UDP port 1900 and when the Amazon Echo does a network discovery it should send a UDP message to the UDP port 1900.

I have used the following code, and when I run it, it seem to log 'Hello from RaspBerry' so I know the UDP message should come through.

Below is the code I am using:

'Non-UI application (console / server application)
#Region Project Attributes
    #MergeLibraries: True
#End Region

Sub Process_Globals
    Dim UDPSocket1 As UDPSocket
End Sub

Sub AppStart (Args() As String)
    UDPSocket1.Initialize("UDP", 1900, 8000)
    Dim Packet As UDPPacket
    Dim data() As Byte
    data = "Hello from RaspBerry".GetBytes("UTF8")
    Packet.Initialize(data, "", 1900)
End Sub

Sub UDP_PacketArrived (Packet As UDPPacket)
    Dim msg As String
    msg = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
    Log("Message received: " & msg)
End Sub

I found the following:

Based on my code above, should this work based on the above link ?

I have tired but it doesn't seem to send any messages to my B4J during the discovery.

I am guessing after I get the UDP message I need to send the message back to UDP IP ?
Last edited: