Note that there are some explanatory texts on larger screens.

plurals
  1. PORead from UDP multicast raspberry pi
    primarykey
    data
    text
    <p>I've already started a question here (<a href="https://stackoverflow.com/questions/15671961/getting-local-udp-server-information-into-c"><strong>link</strong></a>) about this project I'm doing, and I keep having lots of problems with this. </p> <p>In my earlier question I wanted to read from a same machine udp multicast and I find out how to do it, but not with ipmidi.(If you didn't read the previous question linked above, ipmidi is a tool for mac/win which allows me to send midi events through an UDP multicast).</p> <p>I've been working around with wireshark and managed to see that ipmidi is sending datagrams to the ip 225.0.0.37, port 21928, wich tells me that is, in fact, a multicast. Then I used <a href="http://ntrg.cs.tcd.ie/undergrad/4ba2/multicast/antony/example.html" rel="nofollow noreferrer"><strong>this</strong></a> code (the listener) to try to echo the datagrams sent by ipmidi with no success (I changed the multicast ip and the port). After this I decided to try to run this code from the raspberry pi, since I only wanted it to run in my mac for testing purposes, I went to the real thing. </p> <p>In my raspi I compiled the code again and gcc claimed that <code>setsockopt()</code> had an invalid argument. <code>perror()</code> was useful enough to tell me that the problem was here:</p> <pre><code>setsockopt(fd,IPPROTO_IP,IP_ADD_MEMBERSHIP,&amp;mreq,sizeof(mreq)) </code></pre> <p>So I removed the part where it asks for a multicast address to the kernel and made it a simple listening socket at port 21928, but it still won't work. I have my mac sending midi through ethernet to the raspi. </p> <p>Now, the actual questions:</p> <ol> <li><p>I'm now doubting my multicast, so called, knowledge: if my mac is multicasting ipmidi's datagrams, it means the datagrams are being sended through all the possible places in my mac, right? I mean, the ip 225.0.0.37 means multicast through wifi and ethernet or I have to route it to the network interface of my choice?</p></li> <li><p>Since my raspi is, allegedly, receiving the datagrams through the ethernet, making my program listen at the ipmidi's datagram destination port would be enough or do I have to tell it explicitly 'where' those datagrams came from?</p></li> <li><p>Is there an easier way to make a multicast receiving app, like an api for C/C++? I'm currently using C style sockets, as you could see in the code I linked, but this is not the main purpose for the program I'm doing and I find myself spending lots of time just learning about networking instead of focusing on the real thing. </p></li> </ol> <p>Sorry for the long question, lots of doubts and I wanted to be in context. </p> <p>Thanks for the help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload