0
\$\begingroup\$

I am having some trouble trying to understand how I can use Ethernet to transmit some data to a computer. To be clear this would be a direct connection (an Ethernet cable will run from my development board to a usb-c connection on my laptop via an Ethernet to usb-c adapter). I have seen many tutorials talking about getting an Arduino to communicate to a PC over ethernet via a server, but I don't think this is what I would be looking for since this is a direct connection to my laptop.

Currently I have some code that transmitting "Hello" from my development board, but I'm not sure where it is going (or if it is even sending at all). Is there anyway I could ping the device from my laptop? Really could use any advice/help on how to make this communication work.

I apologize if this question is vague or lacking information, I am just getting into Ethernet so there is a lot I don't quite know yet. I can provide clarification as needed.

The Development board I am using is a M2S150 FPGA Dev board that has a ARM Cortex M3 On-board

\$\endgroup\$
4
  • \$\begingroup\$ Start simple. Drop the USB-C adapter, and connect your development board directly to your laptop with an Ethernet port. What if your laptop doesn't have an Ethernet port? Then get one that does. Then familiarize yourself with Ethernet server/client roles, Wireshark, and python. Profit. \$\endgroup\$ – Chris Knudsen Nov 13 '20 at 21:27
  • \$\begingroup\$ Do you have ethernet driver code compiled into firmware on your development board? Do you have a TCPIP stack in your firmware? Ethernet is not like a UART where you just push bytes in one end and they appear at the other end... \$\endgroup\$ – brhans Nov 13 '20 at 22:56
  • \$\begingroup\$ One of your PHYs needs to be able to do auto-crossover if you are plugging in directly between two devices. Otherwise you need a crossover cable. Yes similar to how UARTs do. If you have a network switch, this will solve that for you and get LINK going for you too. So many pieces, so little time... \$\endgroup\$ – Aaron Nov 14 '20 at 0:05
  • \$\begingroup\$ My device does have ethernet driver code compiled into firmware, however, I don't have a TCPIP stack in my firmware. I guess my question would be do I still need a TCP/IP stack setup even if this a direct connection from the device to my laptop? I believe I was making an assumption that Ethernet would behave similar to UART \$\endgroup\$ – EpicFoodCartDestroyer Nov 16 '20 at 19:51
1
\$\begingroup\$

Is there anyway I could ping the device from my laptop?

Ping (via IPv4) requires ARP and that you have either manually set up IP addresses or use DHCP. There is "arping", but I don't remember OTOH if there is a windows port for this tool.

Both IPv4 and IPv6 are significanly complex protocols, a bit too much for a post here. Use of exisiting libraries strongly recommended.

Wireshark exists as a networking sniffer tool.

\$\endgroup\$
3
  • \$\begingroup\$ I know that ARP allows you to statically assign an IP address. Since I know the MAC addresses of my device. Would I be able to ping the device if I assign the same network address that my laptop is on? \$\endgroup\$ – EpicFoodCartDestroyer Nov 13 '20 at 21:37
  • \$\begingroup\$ ping is two protocols the arp has to happen to resolve the ip address, yes you can just make one up on the same subnet if there is no conflict (just like you are making up the mac address). Then once that is resolved then the icmp message comes through to do the ping itself you have to handle both types properly. I wouldnt go past udp, and wouldnt mess with ipv6, if you are asking these questions you are not going to get tcp/ip to work unless the libraries you have are already written and tested... \$\endgroup\$ – old_timer Nov 13 '20 at 23:57
  • \$\begingroup\$ I see, as a follow-up, and I'll preface this by saying I'm still trying to fully grasp the true difference between IP and MAC addresses, If I don't plan on connecting my device to a network (as I only will have it connected to my laptop) why does it matter that I even give it an IP address? Should I not be able to communicate to my device with just a MAC address (in the sense that this would be a 2 device LAN)? From what I understand in my case there would be no router in this case to "deference" the IP address \$\endgroup\$ – EpicFoodCartDestroyer Nov 16 '20 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.