Lazarus WIN10 LNET UDP local Lan Broadcast lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- picstart · 2016-09-08 14:08 The facts UDP using LNET visual component local LAN xxx.xxx.xxx.xxx port yyyy network of esp8266 Iot devices one is broadcasting on xxx.xxx.xxx.255 port yyyy Other esp8266 IoT devices can receive the broadcast packets Wireshark on a WIN10 pro can see the broadcast packets the broadcasting device's  sending port is 4097 Windows firewall is set to allow project1.exe to run and the port yyyy is also allowed Issue The code displays Connected to xxx.xxx.xxx.255,yyy in Memo1 but fails to get a call back to procedure TForm1.LUDPComponent1Receive(aSocket: TLSocket); The error call back is also not called. Goal Trying to write the simplest possible code to receive a local lan UDP  broadcast packet Maybe the code below is messed up or maybe it is WIN10 and Lazarus and LNET as the cause. Any ideas? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,  lNetComponents, lNet; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    LUDPComponent1: TLUDPComponent;    Memo1: TMemo;    procedure Button1Click(Sender: TObject);    procedure LUDPComponent1Error(const msg: string; aSocket: TLSocket);    procedure LUDPComponent1Receive(aSocket: TLSocket);  private    { private declarations }  public    { public declarations }  end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.LUDPComponent1Error(const msg: string; aSocket: TLSocket);begin   Memo1.Lines.Add('err'+msg);end; procedure TForm1.Button1Click(Sender: TObject);begin //LUDPComponent1. if LUDPComponent1.Connect('xxx.xxx.xxx.255',yyyy) then  Memo1.lines.Add( 'Connected to xxx.xxx.xxx.255,yyy'); end; procedure TForm1.LUDPComponent1Receive(aSocket: TLSocket);var msg:string;begin   Memo1.Lines.Add('>');  LUDPComponent1.GetMessage(msg,aSocket);  Memo1.lines.Add('recvd='+msg);end; end. ---------------------------------------------------------------------- Thaddy · 2016-09-08 14:52 In general UDP  broadcasts are seldomly allowed on a modern network without extra configuration, but it should still be possible to use it. I'll see if I have a small synapse example available. Windows 10 probably won't work even locally without quite a lot of configuration, though. E.g.: IPv6 doesn't allow it at all, just multi-cast. What are you trying to achieve? ---------------------------------------------------------------------- picstart · 2016-09-08 17:49 First thanks for the reply FYI a tried synapse and it like LNET didn't work and produced no errors ..the receive broadcast packet call back was never called. FYI if I turn off the WIN10 firewall it still will not receive a broadcast UDP packet. What am trying to achieve? It is a small home network using the home router's LAN. The $4 esp8266 Iot devices control relays that replace manual switches. I had it working with MQTT but it needs a central MQTT 100% uptime server. I was using a Raspi since I don't want to risk exposure to a web based MQTT server. The UDP broadcast allows a esp8266 IoT device to announce its presence to the other IoT devices. They then can via UDP talk to each other peer to peer or they can broadcast so all can get the message. I wanted to bring the Win10 lazarus app into the picture so it could send commands to change the existing process. ( Ex turn the yard sprinkler zone 1  on at start time and of at end time) The lazarus code with its graphic GUI allows for ease of change and them sends a UDP packet to the esp8266 in charge of the sprinkler to alter the times etc. The lazarus code needs to receive local lan broadcasts ( multicast can cross networks..I may have to use it but it has a broader reach that I don't need ). It could be just me but it is unpleasant to think Microsoft knows better what is best for me and is blocking broadcast UDP.