yamen129
Posts: 4
Joined: Wed Oct 16, 2019 10:57 am

send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Wed Oct 16, 2019 11:01 am

Hello guys how are you doing ?

so I'm currently working on a project from long time ago that was devastating and depressing for me , i will tell you the idea and what progress I made through the past 6 weeks and see if you can lead or help me ,,


so the idea is I'm currently connecting esp32 Arduino board with six senses , 5 of them are flex sensors and one of them is the mpu6050 sensor which reads the angle of x y and z
I was able to connect those sensors to esp32 and read all the values on the serial monitor as you can see below the code and the serial monitor ,


https://ibb.co/92qBsh0

now my next step that I didn't know how to do is :

I want to send those data, the serial monitor data continuously every 6 second to raspberry pi via the Bluetooth of the esp32 to the Bluetooth of the raspberry pi in order to program those data , i want to program those data to an LCD and a speaker ,

For example if I received the following values from the esp32 I want the Res pi to put a certain word to the LCD screen and and then convert it to speech through the speaker , I already connected the LCD to the raspberry pi. , but now how I can send the serial monitor data continuously to the pi so I can program it


User avatar
DougieLawson
Posts: 36306
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Sun Oct 20, 2019 6:41 am

Send the data by MQTT. Use the WiFi on the ESP32. Run Mosquito, RabbitMQ or HiveMQ on your Raspberry as the MQTT broker.

Anything that needs to consume the data subscribes to the MQTT topic.

https://www.hivemq.com/mqtt/
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Sun Oct 20, 2019 1:17 pm

If you are still interested in Bluetooth, does the ESP32 do classic Bluetooth, BLE, or both?

markkuk
Posts: 130
Joined: Thu Mar 22, 2018 1:02 pm
Location: Finland

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Wed Oct 23, 2019 5:23 am

Both classic and BLE (v4.2) with a Bluedroid-based software stack:
http://espressif.com/sites/default/file ... ure_en.pdf
https://docs.espressif.com/projects/esp ... index.html
If the ESP32 is programmed using the Arduino IDE/runtime instead of "plain" ESP-IDF then the BluetoothSerial library can be used. Here's a tutorial: https://randomnerdtutorials.com/esp32-b ... duino-ide/

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Thu Oct 24, 2019 12:33 am

Well then, I would use classic Bluetooth with the SPP. Lots of information on this forum.

yamen129
Posts: 4
Joined: Wed Oct 16, 2019 10:57 am

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Thu Oct 24, 2019 3:19 pm

DougieLawson wrote:
Sun Oct 20, 2019 6:41 am
Send the data by MQTT. Use the WiFi on the ESP32. Run Mosquito, RabbitMQ or HiveMQ on your Raspberry as the MQTT broker.

Anything that needs to consume the data subscribes to the MQTT topic.

https://www.hivemq.com/mqtt/
I Will give the ble 3 more day of searching and trying then i will do this method

yamen129
Posts: 4
Joined: Wed Oct 16, 2019 10:57 am

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Thu Oct 24, 2019 3:22 pm

guys i was able to connect the esp32 to the pi and i can see the data if i use in the terminal and wrote cat /dev/rfcomm0 , do u have any idea how can i use the data now to start writing a program ex. if you received this value from the Bluetooth terminal i want you to print in the LCD this word and to the speaker this word

the data im sending is words from the ardunio every 6 seconds


like i want the pi if he revised hello from the esp32 to to print hello in the lcs screen and hello to the speaker

any one can help me import those data to the program ? cuz im lost ive never use the programs in The pi

markkuk
Posts: 130
Joined: Thu Mar 22, 2018 1:02 pm
Location: Finland

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Thu Oct 24, 2019 7:06 pm

Open /dev/rfcomm in your program then read from it, the same way you would use a file.

User avatar
Douglas6
Posts: 4778
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: send serial monitor data from ESP32 board to Raspberry PI 3 B+ via Bluetooth?

Thu Oct 24, 2019 8:34 pm

Using a serial communications library (such a PySerial for Python) will give you some added benefits.

Return to “Automation, sensing and robotics”