Hello I want to make a program for the computer and the raspberry, this program must ensure that the raspberry and the computer can communicate via serial. I have already found a code that does this, but the raspberry cannot receive the data while the computer can do this if you send data from the raspberry. So my question is with which code can I let the raspberry receive the data?

Image of trying to send data to raspberry on windows When I send the data I get an error message that the command does not exist

This is the receive code:

private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
        dataIN = serialPort1.ReadExisting();
        this.Invoke(new EventHandler(ShowData));

I have two programs that are exactly the same, only one is on the raspberry and the other a windows computer. So my question is how I can send a message from my computer to my raspberry, the message must end up in the red circle. Only there is nothing there, because when I send the message I get an error message that the command does not exist.

So for clarity the first image is the computer and the second image is the raspberry.

Image of program on raspberry

So my question is how can I receive the message on my raspberry without getting an error message on my computer that the command does not exist.

Thanks in advance!

  • I understand that part, but how can I receive the data without being a command? – floriskn Jan 24 at 15:17
  • I am running this program on my computer and raspberry: dropbox.com/s/x6jajsbdpkmqyx0/… – floriskn Jan 24 at 21:39
  • By the way, with this program I can send text from the raspberry to my computer. – floriskn Jan 24 at 21:40