Transmit data through wireless

Hi everyone,

I have an ESP32 Feather, and I want to transmit two sensor data (consider two potentiometers signal) through wireless to a laptop or android phone. It is great if I can have their change plotted as well.

I could manage to have the data and their plot in Coolterm when I have the board connected to the laptop through USB. But no success with a wireless system so far.

I tried Blynk, Arduino IoT, Adafruit IoT, etc, but I need the data transmitted at a high rate (20 ms), and all these IoT services need a premium account to allow such a rate.

I tried BLE and could get data in Coolterm or Putty, or Serial Bluetooth Terminal (an app on Android), but the data is shown in nonsense characters, and no value is shown.

I also tried CircuitPython, but it seemed very difficult when I don't know Python itself.

It has been about two weeks that I am struggling with different platforms to do this project.

I would be very grateful if you could help me with some clues.

BR,
Masoud

Since that is an Adafruit product, you should start with their excellent tutorials.

Study them very carefully. They usually work as expected, if you follow the instructions. If you have problems, the Adafruit forum is the first place to ask about Adafruit products.

I understand your point. I studied all the related ones and all concluded to their IoT platform.
And the board is just an ESP32 like all the other ESP32s available. So, I think there might be a person helping me here. I also wrote my question there.

Thank you

Your ESP32 should have "classic" Bluetooth. If that is the case, you can use Cetin's Bluetooth Graphics Terminal on your phone.

If you are getting nonsense characters, it may be a baud rate problem in ESP32.

1 Like

Thank you, Nick. Your suggestion was helpful. I could do that. But do you have any simple idea about using Wifi too?

Thank you again

have a look at ESP32 Server-Sent Events (SSE)

No. I think Arduino-Bluetooth-Android-Cetin is a marriage made in heaven.
One of its greatest assets is the minimum use of Arduino resources. I guess that is not so relevant with ESP32.
I'm not aware of any WiFi terminal that is equivalent, but you may be able to do the same thing by datastreaming into Excel on a PC.

Hi Horace,

I followed the instruction on "randomnerdtutorials" and I decided to publish my data in a chart using MQTT and Node-red. I could install Mosquitto and node-red and connect them together so that I can publish and subscribe currently. However, when I try to connect my ESP32 to the MQTT through a code in Arduino IDE, it is not possible.

Any clue on this?

Thank you

BR,
Masoud

this is rather vauge!
cannot find suitable code/libraries?
program does not work?
???

Everything works fine except connecting to the Mosquitto. I receive this error repeatedly:
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds

I searched it on the net, and there have been many people having this problem. I read about 20 threads and did what people said as the solution in all of them. No success yet.

don't have much experience but a MQTT could do the job.
today actualy i was looking at cayenne.
it seems easy to use

cayenne is very easy to use - have a look at example using Lora and an example using an ESP8266 using MQTT
never used Mosquitto so cannot compare

Hi Byronas,

Thank you. But no sketch in Cayenne recognizes ESP32 Feather.

create your own device, e.g. connecting a ESP32 NodeMCU to cayenne
on the cayenne desktop under Add new click Device/Widget
cayenne_add_new

click Bring your own thing

the Create new project page is displayed showing MQTT username, password and clientID

note the Waiting for board to connect message

  1. using Arduino IDE Library Manager (click Sketch>Include Library>Manage Libraries) instal the CayenneMQTTESP32 librrary
  2. open project Examples>Cayenne-MQTT-ESP>ESP32
  3. edit the WiFi ssid and wifipassword
  4. copy the MQTT information from the cayenne create new project page to
// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "8e92cd80-8267-11eb-8779-7d56e82df461";
char password[] = "7df991c57a5cdd0c696d55186bb2a5607756ace0";
char clientID[] = "ec369700-63e3-11ed-b193-d9789b2af62b";

build and run the project - the serial monitor should display

[633] Connecting to XXXXXXX
[3134] Connected to WiFi
[3134] IP: 192.168.1.211
[3134] Connecting to mqtt.mydevices.com:1883
[4510] Connected

the ESP32 board is connected and data displayed on the cayenne desktop, e.g.
cayenne_new_project

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.