• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Best way to communicate between ESP32 and PC?

Q&A Forum › Category: ESP32 › Best way to communicate between ESP32 and PC?
0 Vote Up Vote Down
Dusty asked 6 years ago

Hi.

A project I’m working on needs low-ping, high-bandwidth, high-reliability communication to and from the computer. I’ve been using Serial.print() over USB, but I’ve had problems with garbage in the feed (mostly a non-issue, since I run a regex pattern match on the computer) and devices intermittently disconnecting (a bigger problem).

I’m controlling robotics, so I’d like it to be as real-time as possible, and I’m communicating with multiple ESP32’s from the PC, so whatever method I use would have to support that.  I have a Raspberry Pi I could use, in case it would be best to use its GPIO pins, though I’d rather avoid that.

Thank you!

Question Tags: communication, serial
4 Answers
0 Vote Up Vote Down
DK answered 6 years ago

Hi

low-ping, high-bandwidth  use a separate router for robotics, rather than your  home wifi router

I use use wifi and Bluetooth to talk to esp32 from a PC
Bluetooth: https://rntlab.com/question/esp32-bluetooth-c/

Wifi:

  • https://randomnerdtutorials.com/esp32-web-server-arduino-ide/
  • https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/

I can use theses methods for Home Automation and controlling a wifi car around the home

I think wifi or LoRa (7 miles about) is the best way to control your robots using a mutithread http server/client

you can use http://www.wampserver.com/en/download-wampserver-64bits/ 

and send your commands by WebClient for both internet and LAN

Hope it Helps

derek

0 Vote Up Vote Down
Dusty answered 6 years ago

Hi Derek.  Thank you!  I’ll give it a try.

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi Dusty.
I apologize for taking so long to get back to you, but somehow I’ve missed your question.
If you want to use a wired connection, Serial communication is the best option.  However, as you said, sometimes it will output some garbage. 
You’ll probably need to create some if statements to remove garbage data.
For a reliable and simultaneous connection, MQTT is probably the best option (but it is low-bandwidth). However, it is very reliable and it works with simultaneous connections from multiple devices.
You can also follow Derek’s suggestions and then tell us if they work.
Regards,
Sara
 

0 Vote Up Vote Down
Dusty answered 6 years ago

Hi Sara,
Thank you for the suggestion!  I’m just now getting back to working on this project.  I hope that MQTT will work for it – it’s really nice to work with, and your tutorials on it made it very easy to get started.  I’m really grateful for your work.
I’ll try and remember to update once I get something working.
Kind regards,
Dusty

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.