broadcast enable

General discussion on mikroPascal for AVR.
Post Reply
Author
Message
ljmarkus
Posts: 14
Joined: 17 Dec 2007 17:35
Location: Germany

broadcast enable

#1 Post by ljmarkus » 28 Dec 2007 20:56

Hello,

how can i enable the broadcast revice by the enc28j60 ?

Spi_Ethernet_Init(PORTB, 0, PORTB, 1, myMacAddr, myIpAddr, Spi_Ethernet_FULLDUPLEX) ;

and then ?

why: i must recive UDP Data from BC.

in the function Spi_Ethernet_UserUDP(var remoteHost : array[4] of byte;
remotePort, destPort, reqLength : word) : word;

i can not see data to revice per BC, but i can see recive Data for my ip.


Thanks, Markus
My Setup: All AVR's, SelfBoard, pascal V4.02

ljmarkus
Posts: 14
Joined: 17 Dec 2007 17:35
Location: Germany

#2 Post by ljmarkus » 02 Jan 2008 15:04

Hello.

None of an idea?

Lg, markus
My Setup: All AVR's, SelfBoard, pascal V4.02

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Re: broadcast enable

#3 Post by srdjan » 24 Jan 2008 13:35

Hi,
You'll have to be a little bit clearer on this.
ljmarkus wrote:Hello,

how can i enable the broadcast revice by the enc28j60 ?
- What do you mean by broadcast revice?
ljmarkus wrote: why: i must recive UDP Data from BC.

in the function Spi_Ethernet_UserUDP(var remoteHost : array[4] of byte;
remotePort, destPort, reqLength : word) : word;

i can not see data to revice per BC, but i can see recive Data for my ip.
- What do you mean by BC? UDP packets go through IP protocl, so I do not understand your question.

ljmarkus
Posts: 14
Joined: 17 Dec 2007 17:35
Location: Germany

#4 Post by ljmarkus » 25 Jan 2008 09:02

Hello,

Code: Select all

  myIpAddr[0] := 2;        // 2.27.27.50
  myIpAddr[1] := 27;
  myIpAddr[2] := 27;
  myIpAddr[3] := 50;

  Spi_Ethernet_Init(PORTB, 0, PORTB, 1, myMacAddr, myIpAddr, Spi_Ethernet_FULLDUPLEX) ;


 while true do                 // do forever
    begin
      Spi_Ethernet_doPacket() ;     // process incoming Ethernet packets
      {*
       * add your stuff here if needed
       * ENC28J60_doPacket() must be called as often as possible
       * otherwise packets could be lost
       *}
    end;

The Ip for my ENC is 2.27.27.50 and i must revice a poll packet at 2.255.255.255.

lg, markus
My Setup: All AVR's, SelfBoard, pascal V4.02

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#5 Post by srdjan » 25 Jan 2008 11:43

Well,
Enc and your PC have to me on the same subnet in order to communicate. Check you subnet mask settings and assign to ENC appropriate IP address corresponding the mask settings.
i.e.
if your PC address is 2.27.27.1 and your subnet mask is 255.255.255.0, an IP address from the 2.27.27.x pool of addresses must be assigned to enc.

ljmarkus
Posts: 14
Joined: 17 Dec 2007 17:35
Location: Germany

#6 Post by ljmarkus » 25 Jan 2008 11:51

Hello,

my Network is:
(ArtNet spec.) Subnet must be 255.0.0.0


PC1 : IP 2.27.27.10 - Subnet 255.0.0.0
Console : IP 2.27.27.12 - Subnet 255.0.0.0

Ethernet Interface with ENC : IP 2.27.27.50

PC1 and Console make a Request poll to 2.255.255.255 and the Interface must answer to the sender eg. Console.

lg, markus
My Setup: All AVR's, SelfBoard, pascal V4.02

User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

#7 Post by srdjan » 25 Jan 2008 12:58

ljmarkus wrote:Hello,

my Network is:
(ArtNet spec.) Subnet must be 255.0.0.0


PC1 : IP 2.27.27.10 - Subnet 255.0.0.0
Console : IP 2.27.27.12 - Subnet 255.0.0.0

Ethernet Interface with ENC : IP 2.27.27.50

PC1 and Console make a Request poll to 2.255.255.255 and the Interface must answer to the sender eg. Console.

lg, markus
Ok, I see what you want to do here. However, current library does not support broadcast requests. You'll could change your PC application to send poll requests to enc address.
Also, I'm just wondering: Usually, broadcasts are done with 255.255.255.255 IP address, so even with the broadcast support, the library would not answer to 2.255.255.255.

ljmarkus
Posts: 14
Joined: 17 Dec 2007 17:35
Location: Germany

#8 Post by ljmarkus » 25 Jan 2008 13:30

Hello,

hmm, :cry:

poll request is only possible to 2.255.255.255.

lg, markus
My Setup: All AVR's, SelfBoard, pascal V4.02

micke.prag
Posts: 1
Joined: 09 Jul 2008 12:23

#9 Post by micke.prag » 11 Jul 2008 16:45

I am also interested in broadcast recieve and send!

Post Reply

Return to “mikroPascal for AVR General”