Hendrik R.
Bad Sassendorf,
Jul 15, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
That make sense. But i have the same error.
I only get one and wrong value in the monitor from the serial communication.
This is my current code
------------------CODE---------------------
i=20
iStatus=ComOpen(6)
if iStatus=-1
error -100, "ComOpen() failed"
endif
redim byteArray[10000]
ComSetup(6, 9600, 8, aComParityEven, aComStopBits1, aComHandshakeHardware)
repeat
ComReceive(6, "\n", 1000, , byteArray[i])
trace byteArray[i]
i=i-1
until i=0
ComClose(6)
---------------CODE---------------------
When I read with powershell, I get the correct result.
I also omitted the \n from the EOS parameter, but that did not lead to success either.
Please look at the image i have attached.
I also see there is a ComChat Example. I have tried this with the graphical interface and the standard setup, unfortunately also unsuccessfully. Same result, only one wrong value
Hendrik
File Attachment:
ATEasy_pic.png
Hendrik R.
Bad Sassendorf,
Jul 15, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
That make sense. But i have the same error.
I only get one and wrong value in the monitor from the serial communication.
This is my current code
------------------CODE---------------------
i=20
iStatus=ComOpen(6)
if iStatus=-1
error -100, "ComOpen() failed"
endif
redim byteArray[10000]
ComSetup(6, 9600, 8, aComParityEven, aComStopBits1, aComHandshakeHardware)
repeat
ComReceive(6, "\n", 1000, , byteArray[i])
trace byteArray[i]
i=i-1
until i=0
ComClose(6)
---------------CODE---------------------
When I read with powershell, I get the correct result.
I also omitted the \n from the EOS parameter, but that did not lead to success either.
Please look at the image i have attached.
I also see there is a ComChat Example. I have tried this with the graphical interface and the standard setup, unfortunately also unsuccessfully. Same result, only one wrong value
Hendrik
File Attachment:
ATEasy_pic.png
Hendrik R.
Bad Sassendorf,
Jul 25, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
Hi Ronnie,
sorry for the late feedback.
I have adjusted the code accordingly, unfortunately without success. Also, I have done the reading via PowerShell, which works as desired (See image1).
My actual goal is to send commands and receive the responses generated by the commands.
Currently I am sending commands using ATEasy (See Image2), but I am getting a timeout and also the LEDs for TX and RX on the FTDI are not lit, which indicate sending and receiving data respectively.
I have sent the same command with the program "RealTerm". There I get the corresponding result (See picture3)
I need this information in ATEasy for further processing.
File Attachment:
picture_1.png
Hendrik R.
Bad Sassendorf,
Jul 25, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
picture_2
File Attachment:
picture_2.png
Hendrik R.
Bad Sassendorf,
Jul 25, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
picture_3
File Attachment:
picture_3.jpg
Hendrik R.
Bad Sassendorf,
Jul 26, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
The changes have partially worked. I now see on the FTDI that the data is being sent. However, when I listen on the channel with a serial sniffer, I see that there is a timeout when sending the commands. To try it out, I set the times for sending and receiving the messages to 10 seconds, unfortunately without success. Due to the timeout, I do not receive any messages. (See picture 4)
Hendrik
File Attachment:
picture_4.png
Hendrik R.
Bad Sassendorf,
Jul 27, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
I have now tried different things. The ComReceive with the aioDefault=0 as well as with the parameter which is to be seen on the picture. But also with all the others that I can select there. I also took the receive out of the loop to see if I receive anything at all. That is not the case. I always get the same result. The string that should be transmitted does not arrive and I do not receive anything, you can see that in the monitor of ATEasy. What you can see in picture 3 is the program "RealTerm" with which I can receive the data over the FTDI from the ESP over a serial monitor and different settings but also send the command like "eeprom". What you can see in picture 3 is the output of the ESP when I send the command "eeprom". And I would like to see this in ATEasy. But since I don't receive anything according to the monitor, it doesn't work yet.
As mentioned before, when I send the command "eeprom" via ATEasy, I get a timeout. Picture 5 shows the communication via ATEasy and the FTDI/ESP. For this I used a program that listens on the port as a silent observer. I have also tried to send the commands without the silent observer, in the assumption, which could disturb the communication, here also, unfortunately without success.
@Paul Thanks for the tip, unfortunately did not work for me :/
Hendrik
File Attachment:
picture5.png
Hendrik R.
Bad Sassendorf,
Jul 27, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
I have now tried different things. The ComReceive with the aioDefault=0 as well as with the parameter which is to be seen on the picture. But also with all the others that I can select there. I also took the receive out of the loop to see if I receive anything at all. That is not the case. I always get the same result. The string that should be transmitted does not arrive and I do not receive anything, you can see that in the monitor of ATEasy. What you can see in picture 3 is the program "RealTerm" with which I can receive the data over the FTDI from the ESP over a serial monitor and different settings but also send the command like "eeprom". What you can see in picture 3 is the output of the ESP when I send the command "eeprom". And I would like to see this in ATEasy. But since I don't receive anything according to the monitor, it doesn't work yet.
As mentioned before, when I send the command "eeprom" via ATEasy, I get a timeout. Picture 5 shows the communication via ATEasy and the FTDI/ESP. For this I used a program that listens on the port as a silent observer. I have also tried to send the commands without the silent observer, in the assumption, which could disturb the communication, here also, unfortunately without success.
@Paul Thanks for the tip, unfortunately did not work for me :/
Hendrik
File Attachment:
picture5.png
Hendrik R.
Bad Sassendorf,
Jul 27, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
I have now tried different things. The ComReceive with the aioDefault=0 as well as with the parameter which is to be seen on the picture. But also with all the others that I can select there. I also took the receive out of the loop to see if I receive anything at all. That is not the case. I always get the same result. The string that should be transmitted does not arrive and I do not receive anything, you can see that in the monitor of ATEasy. What you can see in picture 3 is the program "RealTerm" with which I can receive the data over the FTDI from the ESP over a serial monitor and different settings but also send the command like "eeprom". What you can see in picture 3 is the output of the ESP when I send the command "eeprom". And I would like to see this in ATEasy. But since I don't receive anything according to the monitor, it doesn't work yet.
As mentioned before, when I send the command "eeprom" via ATEasy, I get a timeout. Picture 5 shows the communication via ATEasy and the FTDI/ESP. For this I used a program that listens on the port as a silent observer. I have also tried to send the commands without the silent observer, in the assumption, which could disturb the communication, here also, unfortunately without success.
@Paul Thanks for the tip, unfortunately did not work for me :/
Hendrik
File Attachment:
picture5.png
Hendrik R.
Bad Sassendorf,
Jul 28, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
Hi Paul, Victor
@Paul Please see picture 6. there I played the code to the ESP to make it send the string "Hallo" permanently. I also checked the return values of the COM functions (good tip by the way). I noticed that for ComReceive everything is OK for the first command and for the following ones the value is -1. If I take the \r\n out of ComReceive, the return value is 0, so it is ok.
The problem which still exists with the reception is, at which time the string is read. As you can see in the monitor, I don't get a coherent string yet.
@Victor I have also tried your suggestion and set the values with the panel under ComChat.prj. I get the "Hallo" too, but as in the monitor before, chopped (See picture 8).
@Paul Furthermore I have still the setting of the RealTerm in picture 7 taken.
So in general I can say that I can receive messages, although not yet correctly formatted. But for some reason sending via ATEasy does not work yet. Neither over the ComSend nor over the ComChat panel. If I listen with again on the port a silent observer, I get a timeout when sending also via the ComChat Panel.
File Attachment:
picture6.png
Hendrik R.
Bad Sassendorf,
Jul 28, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
picture 7
File Attachment:
picture7.png
Hendrik R.
Bad Sassendorf,
Jul 28, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
picture 8
File Attachment:
picture8.png
DrATEasy (Ron Y.)
Mission Viejo, CA
Jul 28, 2022
367
Posts
Re: Read serial data from esp32 through FTDI programmer
The aioDisableComReceiveEarlyReturn should only used if there is no terminator, you should remove it.
Can you change the receive to use only the \n instead of \r\n (just to see).
I tried it with virtual ports with ComChat x2 and it works as designed:, see picture9.
File Attachment:
picture9.jpg
Hendrik R.
Bad Sassendorf,
Jul 29, 2022
26
Posts
Re: Read serial data from esp32 through FTDI programmer
IT WORKS! Damn..
If you guys are looking at picture 7. You see, that RTS is Constant LOW. If its Enabled, the Sending Command does not work.
Solution: The FTDI have 6 PINS (Using FT232RL Chip from Waveform btw) And we have: VCC, GND, TXD, RXD, RTS, CTS but for the communication from UART you only need VCC GND TXD and RXD. So, since the PIN of RTS must always be LOW, I just pinched it off. Thats it.
Thanks for all your Help @Ronnie,Paul and Victor
Hendrik
File Attachment:
done.png