Read Ethernet Raw Mode Data

IanKibblewhite
Posts: 11
Joined: Mon Feb 08, 2021 4:56 am

Read Ethernet Raw Mode Data

Postby IanKibblewhite » Sat Nov 06, 2021 9:19 pm

I need to read raw mode data through an Ethernet connection. It says in the ESP-IDF programming Guide that the lwIP Raw API is designed for single threaded devices and is not supported in ESP-IDF. Is it possible to read raw mode data with the ESP32? If so, what's the best way to do this. I'm using an ESP32-Ethernet-Kit V1.2. When I connect with a PC using Putty and enter the IP address, port and select Raw mode I get the ASCII data. I need to do the same with the ESP32. I'd appreciate some direction on this.

Thank you.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Read Ethernet Raw Mode Data

Postby ESP_Sprite » Mon Nov 08, 2021 4:35 am

Can you define 'raw mode data'? Raw mode in Ethernet, LWIP and Putty are three entirely different beasts. It may be even more useful if you can explain a bit more about what you're trying to do: what generates the 'raw data', how is it structured, what do you need to do with it on the ESP32 side?

IanKibblewhite
Posts: 11
Joined: Mon Feb 08, 2021 4:56 am

Re: Read Ethernet Raw Mode Data

Postby IanKibblewhite » Mon Nov 08, 2021 3:02 pm

Thanks for your response.

As part of a large ESP32 project we need to receive data from an Ethernet connection on a legacy motor controller. We don't know much about the implementation in the controller itself except that the user instructions for manually collecting the data are: In PUTTY under connection type: "choose "RAW". Place the IP address in the "Host Name (or IP address)" section. Under "Port" input "4848". It works, and in Putty we get the the following ASCII data when the motor is running:

DATA: 009234 00170 00003
DATA: 009260 00170 00001
DATA: 009286 00171 00005
DATA: 009312 00171 00000
DATA: 009338 00172 00000
DATA: 009364 00172 00000
DATA: 009390 00173 00000

We need to capture this data (the 3 numbers every 50ms, plus some additional analog and digital data from the equipment). We're using an ESP32-Ethernet-Kit V1.2 to capture the data send it to our primary ESP32 controller via Wifi. This appeared to be a relatively simple part of the project but we have no experience with Ethernet "raw" mode data.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Read Ethernet Raw Mode Data

Postby WiFive » Mon Nov 08, 2021 5:18 pm

Raw mode in putty just reads bytes so the same would be true of a plain socket, nothing special. The only reason raw is a special mode in putty is because it is a terminal program.

IanKibblewhite
Posts: 11
Joined: Mon Feb 08, 2021 4:56 am

Re: Read Ethernet Raw Mode Data

Postby IanKibblewhite » Tue Nov 09, 2021 4:39 pm

Thanks. So does this look like a simple server? Do I just need a basic client ap that, after initializing the Ethernet (as in a basic example app), creates a socket (SOCK_STREAM?), connect(), and read with recvfrom(). It appears as if the data comes in when the motor is running so I don't need to send anything to initiate it?

IanKibblewhite
Posts: 11
Joined: Mon Feb 08, 2021 4:56 am

Re: Read Ethernet Raw Mode Data

Postby IanKibblewhite » Thu Nov 11, 2021 3:10 am

Implemented successfully as above without issues. Thanks for your help.

Who is online

Users browsing this forum: Vishna and 167 guests