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.
Read Ethernet Raw Mode Data
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: Read Ethernet Raw Mode Data
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?
-
- Posts: 11
- Joined: Mon Feb 08, 2021 4:56 am
Re: Read Ethernet Raw Mode Data
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.
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.
Re: Read Ethernet Raw Mode Data
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.
-
- Posts: 11
- Joined: Mon Feb 08, 2021 4:56 am
Re: Read Ethernet Raw Mode Data
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?
-
- Posts: 11
- Joined: Mon Feb 08, 2021 4:56 am
Re: Read Ethernet Raw Mode Data
Implemented successfully as above without issues. Thanks for your help.
Who is online
Users browsing this forum: No registered users and 315 guests