Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3791

UDP Multicast on a Rasberry Pi 4

$
0
0

I am looking for some input regarding a UDP socket that listens for a Multicast from a device. I wrote a XOJO web application, its running on a Pi 4 Arm 64. Debain 12 is the OS.

I wrote the App using Version 2024 Release 2.

It works great on my laptop when debugging, However, when I built the application and installed on the Pi (I used Tim Parnell’s, Lifeboat, Great product!!). Everything else works, except this function.

Open Event for the Page:

dim sock as new UDPSocket

sock = UDP

sock.port = TextField2.text.ToInteger

sock.Connect

if sock.JoinMulticastGroup(TextField1.text) then
Rectangle2.Style.BackgroundColor = color.green
else
Rectangle2.Style.BackgroundColor = color.red
end if

DataAvailable Event:

dim d as Datagram

d = UDP.Read
//Listbox2.AddRow(d.data)
dim e as integer
e = UDP.LastErrorCode
//listbox2.AddRow(str(e))

dim z as string
z = d.data

Dim a(-1) as string

a = z.SplitB(“>”)

dim s1,s2,s3,s4,s5,s6,s7,s8 as string
s1 = a(0)
s2 = a(1)
s3 = a(2)
s4 = a(3)
s5 = a(4)
s6 = a(5)
s7 = a(6)
//s8 = a(7)

dim f1,f2,f3,f4,f5,f6,f7,f8 as string

f1 = s1.mid(18,12)
f2 = s2.mid(12)
f3 = s3.mid(8)
f4 = s4.mid(12)
f5 = s5.mid(12)
f6 = s6.mid(14)
f7 = s7.mid(20)
//f8 = s8.mid(13)

dim rowc as integer
rowc = ListBox1.RowCount

dim addr as integer
addr = rowc + 1

//ListBox1.CellTextAt(addr,0) = f1
//ListBox1.CellTextAt(addr,1) = f2
//ListBox1.CellTextAt(addr,2) = f3
//ListBox1.CellTextAt(addr,3) = f4
//ListBox1.CellTextAt(addr,4) = f7
//ListBox1.CellTextAt(addr,5) = f6

if rowc > 0 then

dim i as integer

for i = 0 to addr

dim ct as string
ct = ListBox1.CellTextAt(i,0)
if f1 =  ct then
  
  
else
  
  ListBox1.AddRow(f1,f2,f3,"GC-" + f4,f7)
  
end if

next
else

ListBox1.AddRow(f1,f2,f3,“GC-” + f4,f7)

end if

Anyone see something that would cause it to not work on a Pi?

Thanks,

Kevin

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3791

Trending Articles