Ethernet data acquisition on Windows

Thread Starter

Vilius_Zalenas

Joined Jul 24, 2022
156
Hi,

I am a starting hardware engineer. Recently I got a task at work to do an R&D project, involving ADC data acquisition with Teensy 4.1 and sending the data to the PC via Ethernet protocol. I had an idea how to do this project or at least where to start, except the Ethernet part (I have never written a PC application involving Ethernet), but they told me that there is no other person for this project but me. So my goal is just to extract the information from Ethernet data stream and write it to some text file (presumably Notepad.) No fancy application or GUI is required, just data collection. Since this is my first time working with such thing, I dont have a clue on where do I even start... Can you give any useful tutorials, links, videos or any other observations about the Ethernet data extraction on the PC side? I tried googling and did a little research on my own, but it looks really difficult and scary, I need at least a soft start...
 

Ya’akov

Joined Jan 27, 2019
8,515
There is a bit of a complication involving your specification.

You say you need to use “Ethernet” but because you are a neophyte, I don’t know if you mean you have to use the raw Ethernet protocol or you can use something on top of it. I understand you to mean you will be connecting the Teensy using a UTP cable to the Ethernet module, but do you really mean that you have to use Ethernet at the protocol level?

If not, and I would suggest that unless there us some special ultra-low latency requirement or something like that, you should consider using IP and TCP, or possibly UDP if latency is an issue and TCP’s overhead is a problem. (It doesn’t seem likely, but it could be).

If you use TCP/IP then you will need to run an IP stack on the Teensy (no problem) and use socket programming on the PC. It really doesn’t matter what language you use. If you are familiar with C/C++ that would be fine, if it’s something else it’s all good because sockets are everywhere.

With sockets you just establish a connection between the Teensy and computer (for TCP) or listen on a port for packets for UDP. It should take you very long to work out how to do it. The rest is just going to be a file handle and some housekeeping.
 

MrChips

Joined Oct 2, 2009
29,848
TS might be confusing "ethernet" with "internet".
There are many solutions available to connect a sensor to a host PC via WiFi.
There are wireless solutions such as nRF24L01+, Bluetooth, Zigbee, LoRa, etc.
 

Thread Starter

Vilius_Zalenas

Joined Jul 24, 2022
156
There is a bit of a complication involving your specification.

You say you need to use “Ethernet” but because you are a neophyte, I don’t know if you mean you have to use the raw Ethernet protocol or you can use something on top of it. I understand you to mean you will be connecting the Teensy using a UTP cable to the Ethernet module, but do you really mean that you have to use Ethernet at the protocol level?

If not, and I would suggest that unless there us some special ultra-low latency requirement or something like that, you should consider using IP and TCP, or possibly UDP if latency is an issue and TCP’s overhead is a problem. (It doesn’t seem likely, but it could be).

If you use TCP/IP then you will need to run an IP stack on the Teensy (no problem) and use socket programming on the PC. It really doesn’t matter what language you use. If you are familiar with C/C++ that would be fine, if it’s something else it’s all good because sockets are everywhere.

With sockets you just establish a connection between the Teensy and computer (for TCP) or listen on a port for packets for UDP. It should take you very long to work out how to do it. The rest is just going to be a file handle and some housekeeping.
Thank you so much, now I at least know the direction for this project... This will take me some time, so I guess there is nothing more to say, but an honest thanks.
 
Top