-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bluetooth serial port access on raspberry pi 3b #9
Comments
I think that a test is missing if Serial.available (), but it should still work because the read () function is non-blocking and returns -1 if nothing is available. |
Here is my pinfo result Name : RaspberryPi 3B |
Yes, I removed the console=serial0,115200 from my cmdline.txt file but still I was not able to send data to my pi with android. instead of Serial.begin() can i use the rfcomm in the code ? If yes, how ? |
I want to use RPi 3 bluetooth to receive data instead of using a HC-05. And from what I know is, Serial.read() is used to receive data from a serial bluetooth device like HC-05. How can I use my rfcomm port to receive data using Piduino library ? |
Okay, |
I haven't checked minicom, but I connect my android to rfcomm and I executed cat /dev/rfcomm0, I saw characters |
How can I open rfcomm in arduino code instead of Serial.read() ? |
Can you confirm that the characters are coming to /dev/ttyAMA0 ? Serial is by default connected to ttyAMA0 ... |
As long as you do not confirm that the characters are displayed in minicom on the raspberry pi, we can not progress ... |
Should I change any commands in cmdline.txt and config.txt to make minicom work properly ? |
Do I need any serial adapter or can I use my HC-05 module ? |
Could you explain to me clearly what are the raspberry pi UART0_TXD and UART0_RXD pins connected to? |
That's the result of |
Sur le raspberry pi 3, UART0 est utilisé par défaut pour le bluetooth pour le désactiver il faut avoir ça dans /boot/config.txt :
|
No, I want to communicate via raspberry pi bluetooth |
Okay, sorry I'll make it clear. I want to use raspberry pi bluetooth. How can I use serial.read() with on-board raspberry pi bluetooth ? |
Ok, I understand now. Currently pinfo only displays /dev/ttyAMA0 which has nothing to do with your bluetooth link, it is normal that you do not receive anything ! Piduino uses libudev to detect serial ports and will create the necessary SerialX objects. I did not consider this requirement in my development. |
I do not have time right now to develop new features (very specific to Raspberry Pi 3), but I would probably do it. What is certain is that as long as you will not be able to display in minicom the characters received on the bluetooth serial link, you will not be able to make a program waiting for the characters on the serial port ... |
Okay, so then how can I use HC-05 via piduino ? |
I do not know this device, do you have a link? |
here it is. a tutu on it. https://howtomechatronics.com/tutorials/arduino/arduino-and-hc-05-bluetooth-module-tutorial/ |
Ok, seen. |
Okay. Can i call python code in piduino code ? |
No, Arduino is C++ ! that goes against the goal pursued by Piduino. |
the example of your tutorial should work perfectly by adding #include <Piduino.h> and assigning the correct pin to the led. bye. |
Okay. Thank you Professor! |
Hi, I created a sample bluetooth controlled led using piduino library. Below is the code is executed. How can I include rfcomm in the below code ? I am able to run the code, but not able to control the LED using android via bluetooth.
#include <Piduino.h>
int led = 21;
int data = 0;
void setup()
{
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop()
{
data = Serial.read();
if(data == '1')
{
digitalWrite(led, HIGH);
}
if(data == '0')
{
digitalWrite(led, LOW);
}
}
The text was updated successfully, but these errors were encountered: