04-05-2023 03:07 AM
Hi,
Hi,
I'm doing a personal project acquiring output voltage from a solar panel. I have read from other sources regarding the esp8266 TCP/IP with labview to solve my problem but was still unsuccessful. I need to monitor the dc motor voltage using the Esp8266 WiFi module. For the programming side, I am using LabVIEW 2013 and Arduino IDE ver 2.0.4. To test if my esp8266 works, I tested some programs download from the internet for the esp8266 (write and read text) and obtained the IP address, which is successful. Next, I verify with an input voltage from the same esp (3.3V pin) and connect to the A0 pin and monitor via the serial monitor. I received a value of 1024 which is correct for a 10-bit ADC. The problem arises when I used LabVIEW. I applied a dc voltage of 1V from a power supply (-ve terminal power supply connected to ESP Gnd) and I set the IP address with the address I obtained earlier with the server port set at 8000. I run the VI and receive an error message (error 56). The error starts from the TCP Read node. I changed the input of A0 by connecting the A0 pin to the ESP 3.3V pin. Somehow the VI shows no error and a value of 1024 was displayed on the front panel. If someone knows what is happening here please share. Tq
Solved! Go to Solution.
04-05-2023 10:33 AM
Are you sure, NMCU2 is still reading and responding on TCP? You could monitor with WireShark.
04-05-2023 05:43 PM
Error 56 means a timeout. You have it set to read 4 characters. If you get "1024" and that's 4 characters, then no timeout. But if you have it unconnected and should get something shorter (like just 1 character for "0") then it gets one character, tries to wait for 3 more, then errors out.
Have a look at the help for TCP read, specifically the "Mode" input:
I'm guessing you might want "Immediate" instead. You could try that.
04-06-2023 05:33 AM
Hi Kyle,
Thank you for the reply. At the TCP Read node, I select the mode to "immediate" and bytes to read = 4 and it works.
Thanks again. God bless you!