Hello FRANCESCO,
one question is, is there the possibility of receiving multicast messages in the Annex or is it easy to implement
monki
multicast messages
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
-
- Posts: 42
- Joined: Mon Feb 27, 2023 12:56 pm
- Location: Berlin
- Has thanked: 6 times
- Been thanked: 6 times
Re: multicast messages
Hi Francesco,
I tried it with
udp.begin 5353
onudp udpreceive
wait
udpreceive:
v$ = udp.read$ data
vlog v$
return
But I don't get any message. With b4X (another basic variant) it works
I tried it with
udp.begin 5353
onudp udpreceive
wait
udpreceive:
v$ = udp.read$ data
vlog v$
return
But I don't get any message. With b4X (another basic variant) it works
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: multicast messages
I just tried with an esp32-s3 with the toolkit and using the address .255 I receive the messages
You do not have the required permissions to view the files attached to this post.
-
- Posts: 42
- Joined: Mon Feb 27, 2023 12:56 pm
- Location: Berlin
- Has thanked: 6 times
- Been thanked: 6 times
Re: multicast messages
hello Francesco,
Thanks for your effort, but I think you confused multicast with broadcast, I have a link here https://book.hacktricks.xyz/network-ser ... t-dns-mdns
found in which the functionality is explained
Thanks for your effort, but I think you confused multicast with broadcast, I have a link here https://book.hacktricks.xyz/network-ser ... t-dns-mdns
found in which the functionality is explained
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: multicast messages
Yes you are right, I confused multicast with broadcast but you confused UDP with DNS
Yes, I implemented it in the version 1.51.1 but I removed it in the following version replacing it with NETBIOS
Yes, I implemented it in the version 1.51.1 but I removed it in the following version replacing it with NETBIOS
You do not have the required permissions to view the files attached to this post.
-
- Posts: 42
- Joined: Mon Feb 27, 2023 12:56 pm
- Location: Berlin
- Has thanked: 6 times
- Been thanked: 6 times
Re: multicast messages
Good morning Francesco
I have several smart home devices (shelly rgbw2), these send their status via Udp to the multicast address 224.01.1.187 port 5683.
As mentioned above, I created an app for this purpose with B4X, which also works well.
b4x is a basic language that then compiles the code into native bytecode. Here is an excerpt of the Java inline code, perhaps it will be more understandable
Sub CreateMulticastSocket(EventName As String, Port As Int, Group As String)
Dim multi As JavaObject
multi.InitializeNewInstance("java.net.MulticastSocket", Array(Port))
Dim inet As JavaObject
multi.RunMethod("joinGroup", Array(inet.InitializeStatic("java.net.InetAddress").RunMethod("getByName", Array(Group))))
Dim jo As JavaObject = Me
jo.RunMethod("SetMulticastSocket", Array(EventName, multi, udp))
End sub
#if java
import java.net.*;
public void SetMulticastSocket(String EventName, MulticastSocket socket, anywheresoftware.b4a.objects.SocketWrapper.UDPSocket udp) {
udp.init(getBA(), EventName, 8192, socket);
}
#end if
I have several smart home devices (shelly rgbw2), these send their status via Udp to the multicast address 224.01.1.187 port 5683.
As mentioned above, I created an app for this purpose with B4X, which also works well.
b4x is a basic language that then compiles the code into native bytecode. Here is an excerpt of the Java inline code, perhaps it will be more understandable
Sub CreateMulticastSocket(EventName As String, Port As Int, Group As String)
Dim multi As JavaObject
multi.InitializeNewInstance("java.net.MulticastSocket", Array(Port))
Dim inet As JavaObject
multi.RunMethod("joinGroup", Array(inet.InitializeStatic("java.net.InetAddress").RunMethod("getByName", Array(Group))))
Dim jo As JavaObject = Me
jo.RunMethod("SetMulticastSocket", Array(EventName, multi, udp))
End sub
#if java
import java.net.*;
public void SetMulticastSocket(String EventName, MulticastSocket socket, anywheresoftware.b4a.objects.SocketWrapper.UDPSocket udp) {
udp.init(getBA(), EventName, 8192, socket);
}
#end if