Arduino virtual serial port over wireless network

Hello,

I’m trying to communicate between an Arduino and a Computer over wireless network.

For this, I would like to use either wi-fi, bluetooth or an ethernet.

My goal is to connect to an Arduino on my computer over a virtual serial port to receive data from Arduino. I’m going to write a software for computer to read and process received data. What should I do to connect to Arduino with one of these communication methods? Which communication method should I choose for this application? Which one is easier to do?

The code on the Arduino must be a one time thing. For example, when I connect the device to an ethernet port on any network, I should be able to find it and connect to it through a software on my computer that is on the same network without updating code on Arduino.

For example: I’m reading an analog value on Arduino and trying to send it to a computer that is 5-10 meters away. I want to see the data on the computer screen.

The code on the Arduino shouldn’t be specific to a network or a computer. This system should be able to work anywhere (with a wireless network) without changing the code on Arduino.

Choose an esp8266 board like a wemos d1 mini and use a library called "WiFi manager".

@emaxxx, I'm sorry but I can't make sense of your description of what you want to do - it lacks detail

Based on your Title and this "My goal is to connect to an Arduino on my computer over a virtual serial port" my suggestion is to use Bluetooth which is, basically, serial-by-wireless.

If you really do need to use WiFi (or if you prefer it) the advice in Reply #1 is good.

There are also ESP32 boards and the ESP32 includes Bluetooth as well as Wifi. Or you could connect a Bluetooth module to a regular Arduino such as an Uno or Mega.

...R

Thank you for your answers.

It would be fine if I could connect via bluetooth in the first place. I have the HC-05.

I want to connect the Arduino to the computer wirelessly and send a message to the serial port via arduino.

I prepared a simple code and put it on Arduino.

Connection between computer and bluetooth is not permanent.

Bluetooth disconnects 3 seconds after connecting.

I just tried to energize the bluetooth and the result did not change.

The computer cannot stay connected to bluetooth continuously.

I have adjusted the HC-05. I changed its name, baud rate, password. But I could not solve my problem.

What should I do?

emaxxx:
The computer cannot stay connected to bluetooth continuously

That sounds like a computer problem rather than an Arduino problem.

What computer operating system are you using and what PC program are you using to communicate with the Arduino?

Also, please post your simple Arduino code

...R

#include <SPI.h>
#include <MFRC522.h>
MFRC522 rfid(10, 9);
 
void setup()
{
  Serial.begin(9600);
  Serial3.begin(9600); //Bluetooth
  SPI.begin();
  rfid.PCD_Init();
}
 
void loop()
{
  if ( rfid.PICC_IsNewCardPresent())
  {
    if ( rfid.PICC_ReadCardSerial())
    {
      Serial3.print("ID: ");
      Serial3.print(rfid.uid.uidByte[0]);
      Serial3.print(",");
      Serial3.print(rfid.uid.uidByte[1]);
      Serial3.print(",");
      Serial3.print(rfid.uid.uidByte[2]);
      Serial3.print(",");
      Serial3.println(rfid.uid.uidByte[3]);
    }
    rfid.PICC_HaltA();
  }
}

Problem solved thank you.

emaxxx:
Problem solved thank you.

It would be useful to other readers if you explain how you solved the problem.

...R

If I didn't do any action after the connection with bluetooth, it would break.
I am trying to connect via bluetooth by giving 5V only to the HC-05 as a first attempt.

emaxxx:
If I didn't do any action after the connection with bluetooth, it would break.
I am trying to connect via bluetooth by giving 5V only to the HC-05 as a first attempt.

I understood from Reply #5 that you have solved the problem.

If you need more help please respond to Reply #4.

...R