Click here to Skip to main content
15,881,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My problem is to receive serial data from arduino and receive it on .net which is coming from tcp/ip connection. The ip address is entered manually and after the ip address is entered the connection is established between that port and destination that is user side and arduino start sending data

What I have tried:

Module Module1
Sub Main()
Dim userRespond
Dim fetchedData
Dim writeString
Console.WriteLine("Type R to Read Serial Port.")
userRespond = Console.ReadLine
If userRespond = "R" Or userRespond = "r" Then
Dim port As New System.IO.Ports.SerialPort
port.PortName = "COM4"
port.Open()
port.BaudRate = 9600
fetchedData = port.ReadByte
Console.WriteLine(fetchedData)
Console.ReadLine()
Else
Console.WriteLine("Not a Recognized Command.")
End If
End Sub
End Module
Posted
Comments
Dave Kreskowiak 23-Nov-17 16:27pm    
OK, if you're receiving data over TCP/IP, the SerialPort class is going to be completely useless.

You'll have to implement a TCP/IP client to get the data.
Mike Hankey 27-Nov-17 20:53pm    
The code you've provided is for a serial connection, not TCP/ID.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900