PDA

View Full Version : Ethernet Ethercog issue



BTX
07-12-2009, 03:51 AM
Hi all !!
I'm trying an UDP reciever with the etherog and UDP socket provided in an OE UDP audio demo.
I've modified some code to get only the UDP reciever (not for audio).

My issue is that in ethercog I can't get broadcast working...and I don't know why.

I'm sending UDP packets from PC using some IP succesuflly ie: to 192.168.1.32, but when I try to send a brodcast packet it never is recieved at the propeller ethernet board.
I used in the ethercog code also a MAC like the least significant bit of the fisrt byte of MAC is active, I've activated the broadcast in the PC sender, I sent to 192.168.1.255 from PC but my board does not respons to it.

What should I consider to get broadcast working on ethercog ??

Have a nice weekend !!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.

BTX
07-14-2009, 03:55 AM
OK. I've solved the problem.

To recieve Broadcast packets using the ethercog driver you should add this code:



call #spi_read32
cmp spi_reg, local_IP wz
if_nz cmp spi_reg, Broad_IP wz (This line was added to this portion of the original code in the rx_ipv4 routine)
if_nz jmp #rx_frame_finish




Also you should define the Broad_IP variable after the Local_IP variable after that, like:


Broad_IP long $C0A801FF




It's working fine recieving UDP packets as unicast and broadcast. http://forums.parallax.com/images/smilies/cool.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.

lonesock
07-14-2009, 04:05 AM
Great job! I'm still planning on playing with this EtherCog code. (btw, did you use the release zip? Or are you using the latest SVN code? IIRC, there was one update to the SVN repo that was not included in the zip.)

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.

BTX
07-14-2009, 05:06 AM
Hi Jonathan.
Thx so much !! My best skill is not the progamming.....happy to hear if it is usefull.
I'm using the release zip.
Specifically the udp audio demo from Micah Dowty, downloaded from OE.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.