Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Support for UDP multicast/boardcast?


  • Please log in to reply
15 replies to this topic

#1 andersborg

andersborg

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 14 February 2011 - 10:53 AM

I read a note from October 2010 about not being able to implement Netbios without patching the lwip code (or something; I didn't read that carefully), due to lack of support for UDP broadcast. Does anyone know if this works now? At least my application doesn't receive anything. The data sent shows up in Wireshark and the reception lamp blinks on the Netduino, so it looks right that far. Poll doesn't detect any incoming data though. Here's my code for testing UDP: using System.Net; using System.Net.Sockets; using System.Threading; using Microsoft.SPOT; using Microsoft.SPOT.Net.NetworkInformation; public class Program { private const int PORT_IPMIDI = 21928; public static void Main() { // TODO Set a fixed IP address (for now, until DHCP works) NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface networkInterface in networkInterfaces) { //networkInterface.EnableDhcp(); TODO: Doesn't work for some reason networkInterface.EnableStaticIP("192.168.0.177", "255.255.255.0", "192.168.0.1"); Debug.Print("GW: " + networkInterface.GatewayAddress + ", IP: " + networkInterface.IPAddress + ", Mask: " + networkInterface.SubnetMask); } Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); EndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0 /* PORT_IPMIDI */); serverSocket.Bind(remoteEndPoint); while (true) { if (serverSocket.Poll(1000, SelectMode.SelectRead)) { Debug.Print("Unknown data"); byte[] inBuffer = new byte[serverSocket.Available]; int count = serverSocket.ReceiveFrom(inBuffer, ref remoteEndPoint); if (count > 0) { Debug.Print("Some data:" + inBuffer[0]); } } Thread.Sleep(10); } } } Cheers, Anders

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 February 2011 - 12:13 AM

Hi Anders, There's no NETBIOS support yet, but I know that Pascal did the legwork if you want to add it yourself in the meantime. Chris

#3 andersborg

andersborg

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 15 February 2011 - 12:17 AM

It's not Netbios in particular I'm interested in, but rather "raw" UDP. Maybe his changes were generic. I'll take a look.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 February 2011 - 02:49 AM

It's not Netbios in particular I'm interested in, but rather "raw" UDP.

Maybe his changes were generic. I'll take a look.


You're looking for broadcast UDP? You should be able to do most/all UDP via the standard firmware.

I believe that Pascal posted something about enabling broadcast UDP. If that's interesting, we could enable that in v4.1.1 pretty easily.

Chris

#5 BiscuitDough

BiscuitDough

    New Member

  • Members
  • Pip
  • 1 posts

Posted 15 February 2011 - 04:57 PM

You're looking for broadcast UDP? You should be able to do most/all UDP via the standard firmware.

I believe that Pascal posted something about enabling broadcast UDP. If that's interesting, we could enable that in v4.1.1 pretty easily.

Chris


I'll cast a vote for broadcast UDP support. I need it too.

#6 andersborg

andersborg

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 15 February 2011 - 06:36 PM

You're looking for broadcast UDP? You should be able to do most/all UDP via the standard firmware.

I believe that Pascal posted something about enabling broadcast UDP. If that's interesting, we could enable that in v4.1.1 pretty easily.

Chris


It would be great if you did.

I started looking at how to make modifications, but it looks a bit hairy, and I only have the Express version of C#, which might not be sufficient (?).

Cheers,
Anders

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 February 2011 - 11:36 PM

I started looking at how to make modifications, but it looks a bit hairy, and I only have the Express version of C#, which might not be sufficient (?).


Hi Anders,

I'll put this on my personal wish list for v4.1.1 :)

For the C (native) code modifications, you'd actually use the free GCC compiler (or the nice RVDS compiler) to build your Netduino firmware. So Visual C# Express is perfectly suitable for the managed code side of things.

Chris

#8 phantomtypist

phantomtypist

    Advanced Member

  • Members
  • PipPipPip
  • 142 posts
  • LocationNew York, NY

Posted 04 May 2011 - 05:00 AM

Hi Anders,

I'll put this on my personal wish list for v4.1.1 :)

For the C (native) code modifications, you'd actually use the free GCC compiler (or the nice RVDS compiler) to build your Netduino firmware. So Visual C# Express is perfectly suitable for the managed code side of things.

Chris


I would like this on my wish list for v4.1.1 too! Maybe an early Christmas present?

#9 dman776

dman776

    Member

  • Members
  • PipPip
  • 19 posts

Posted 04 May 2011 - 04:28 PM

I'll cast a vote for broadcast UDP support. I need it too.


+1

#10 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 01 June 2011 - 10:10 PM

+1


+1

#11 Miha Markic

Miha Markic

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationNova Gorica, Slovenia

Posted 08 June 2011 - 09:48 AM

+1


Any update on this?

I am looking at broadcasting, like:

UdpClient client = new UdpClient();
client.Connect(new IPAddress(0xffffffff), 0x2fff);
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 0);
client.Send(bytes, 1024);

Does this already work?

Miha Markic, Microsoft MVP C#
Righthand .net consulting and software development
http://blog.rthand.com/


#12 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 08 June 2011 - 01:01 PM

Any update on this?

I am looking at broadcasting, like:

UdpClient client = new UdpClient();
client.Connect(new IPAddress(0xffffffff), 0x2fff);
client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 0);
client.Send(bytes, 1024);

Does this already work?


An UPD client connect sounds a little odd...anyway no official news, you have to rebuild the firmware your own with Pascal mods.

#13 andersborg

andersborg

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 21 July 2011 - 10:00 AM

Is this activated in 4.1.1 beta 1? At least I can't get it to work. I see via Wireshark and the LEDs on the Netduino that data is at least received. Cheers, Anders

#14 Firegun

Firegun

    Member

  • Members
  • PipPip
  • 24 posts

Posted 21 October 2011 - 03:14 PM

You're looking for broadcast UDP? You should be able to do most/all UDP via the standard firmware.

I believe that Pascal posted something about enabling broadcast UDP. If that's interesting, we could enable that in v4.1.1 pretty easily.

Chris


+1, hope to see it on the 4.2, and the 4.2 SDK!

#15 andersborg

andersborg

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 21 October 2011 - 03:42 PM

You're looking for broadcast UDP? You should be able to do most/all UDP via the standard firmware.

I believe that Pascal posted something about enabling broadcast UDP. If that's interesting, we could enable that in v4.1.1 pretty easily.

Chris


+1 or even +2 from me too.

#16 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 21 October 2011 - 05:11 PM

+1 or even +2 from me too.


The UDP Broadcast (send and receive) works in the 4.2 RC3 release that is available now. Pascal06's code for Netbios works as well now. But, I don't think Multicast is supported yet.

-Valkyrie-MT




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.