<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hi Max,<br></div><div><br data-mce-bogus="1"></div><div>I'm afraid I don't have a direct answer for your problem, but here's some things that might help you track it down.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>First, after running your Erlang listener run the following command:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>$ netstat -g<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>This will show you all of the multicast groups that you are subscribing to and on which interface. Make sure that you see the group you care about in that list.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>If it is in that list, then start a tcpdump session on that interface as root and take a look at what goes on the wire i.e:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div># tcpdump -i <interface name> port <multicast dest port><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div># tcpdump -i eth0 port 10000<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>This lot will tell you if your Pi is looking for multicast and whether or not they're hitting the Pi itself. In other words this should help you isolate the problem.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>In addition you can try:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div># tcpdump -i eth0 igmp<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Which should (I'm going from memory) isolate all igmp traffic. You should see packets sent when you join and leave a group. So if you start this command first, then start your Erlang app, you should see an IGMP join going out.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Hope some of this helps!<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Kind Regards,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Peter Membrey<br data-mce-bogus="1"></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>From: </b>"Rad Gruchalski" <radek@gruchalski.com><br><b>To: </b>"Max Lapshin" <max.lapshin@gmail.com><br><b>Cc: </b>"erlang questions" <erlang-questions@erlang.org><br><b>Sent: </b>Saturday, 16 May, 2015 21:30:13<br><b>Subject: </b>Re: [erlang-questions] UDP multicast on Raspberry Pi<br></div><br><div data-marker="__QUOTED_TEXT__"><div>
                    Unfortunately, I get exactly the same result.
                </div><br><div>No data received on RPi when using multicast group.</div><div>It’s very strange as data published over multicast from RPi arrives at the destination. Only RPi isn’t getting any data.</div><div>Just to make sure I was not having any general UDP issues - this is is the no multicast server running on RPi:</div><br><div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-module(udp_nomulticast).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-behaviour(gen_server).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-export([start_link/0, stop/0]).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">start_link() -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">stop() -> gen_server:cast(?MODULE, stop).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">init([]) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  Port = 6666,</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  IfaceIp = {0,0,0,0},</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  {ok, OverlaySocket} = gen_udp:open(Port, [ binary,</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">                                             {ip, IfaceIp} ] ),</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  { ok, OverlaySocket }.</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">handle_info({udp, _ClientSocket, _ClientIp, _ClientPort, Msg}, State) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  error_logger:info_msg("Received multicast data: ~p", [ Msg ]),</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  {noreply, State}.</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">handle_call( _, _From, State) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  { reply, ok, State }.</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">code_change(_OldVsn, State, _Extra) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  {ok, State}.</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">terminate(_, _) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  ok.</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">handle_cast(stop, LoopData) -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  {noreply, LoopData}.</span></div></div><br><div>And the client sending to it from the dev box (RPi IP on the local network is 10.128.30.23):</div><br><div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-module(nmcc).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">-export([run/0]).</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">run() -></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  Port = 6666,</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  IfaceIp = {0,0,0,0},</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  RPiIp = {10,128,30,23},</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  {ok, OverlaySocket} = gen_udp:open(Port, [ binary,</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">                                             {ip, IfaceIp} ] ),</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  gen_udp:send( OverlaySocket, RPiIp, Port, <<"some random datas">> ),</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">  gen_udp:close( OverlaySocket ).</span></div></div><br><div>This is arriving just fine:</div><br><div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">pi@raspberrypi ~ $ erl</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">Erlang/OTP 17 [erts-6.4] [source] [smp:4:4] [async-threads:10] [kernel-poll:false]</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco"><br></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">Eshell V6.4  (abort with ^G)</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">1> c("udp_nomulticast").</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">{ok,udp_nomulticast}</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">2> udp_nomulticast:start_link().</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">{ok,<0.40.0>}</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">3></span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">=INFO REPORT==== 16-May-2015::15:05:35 ===</span></div><div><span style="font-family: Monaco;" data-mce-style="font-family: Monaco;" face="Monaco">Received multicast data: <<"some random datas”>></span></div></div><br><div>I’m often jumping too fast to conclusions but I genuinely believe this could be some Erlang related problem but I am not sure how to diagnose it.</div><br><div>I tried multiple combinations, binding the server to {0,0,0,0} or multicast IP, different multicast groups. Result is always the same, traffic not arriving at RPi when using multicast UDP. What’s the best way to elevate? File a bug?</div><div>
                
                
                


<p style="font-family: Helvetica; font-size: 10pt; margin-bottom: 0cm;">
                
                
                


</p><p style="font-family: Helvetica; font-size: 10pt; margin-bottom: 0cm;">
                
                
                


</p><p style="margin-bottom: 0cm;">
                
                
                


</p><p style="margin-bottom: 0cm"><span style="color: #000000;" data-mce-style="color: #000000;" color="#000000"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 9pt;" data-mce-style="font-size: 9pt;">Kind
regards,
<br>Radek
Gruchalski<br>
</span></span></span><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 9pt;" data-mce-style="font-size: 9pt;"><a href="mailto:radek@gruchalski.com" target="_blank">radek@gruchalski.com</a><a href="mailto:radek@gruchalski.com" target="_blank">
</a></span></span><span style="color: #0084d1;" data-mce-style="color: #0084d1;" color="#0084d1"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 9pt;" data-mce-style="font-size: 9pt;"><br></span></span></span><a href="http://de.linkedin.com/in/radgruchalski/" target="_blank"><span style="color: #0084d1;" data-mce-style="color: #0084d1;" color="#0084d1"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 9pt;" data-mce-style="font-size: 9pt;">de.linkedin.com/in/radgruchalski/</span></span></span></a><span style="color: #000000;" data-mce-style="color: #000000;" color="#000000"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 9pt;" data-mce-style="font-size: 9pt;"><br><br></span></span></span><span style="color: #878787;" data-mce-style="color: #878787;" color="#878787"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;"><b>Confidentiality:<br></b></span></span></span><span style="color: #878787;" data-mce-style="color: #878787;" color="#878787"><span style="font-family: Helvetica,sans-serif;" data-mce-style="font-family: Helvetica,sans-serif;" face="Helvetica, sans-serif"><span style="font-size: 8pt;" data-mce-style="font-size: 8pt;">This
communication is intended for the above-named person and may be
confidential and/or legally privileged.<br>If it has come to you in
error you must take no action based on it, nor must you copy or show
it to anyone; please delete/destroy and inform the sender
immediately.</span></span></span></p></div>
                 
                <p style="color: #A0A0A8;">On Saturday, 16 May 2015 at 08:25, Max Lapshin wrote:</p>
                <blockquote style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div dir="ltr"><div>Replace  <span style="font-family:Monaco;font-size:12.8000001907349px">{ip, MulticastIp},  with </span><span style="font-family:Monaco;font-size:12.8000001907349px">{ip, IfaceIp},</span></div></div>
</div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>
<br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-questions<br></div></div></body></html>