H Heinz Active Member Licensed User Longtime User Jan 8, 2011 #1 i have a Bluethooth-relais card. it is visible on my touchlet tablet but the connection fails. the relais card has a baud rate 19200. in Basic4ppc i can connect it with Code: Copy Serial1.New(portnr, 19200, "N", 8, 1) Is ist possible to set baud to 19200 like a com port ?
i have a Bluethooth-relais card. it is visible on my touchlet tablet but the connection fails. the relais card has a baud rate 19200. in Basic4ppc i can connect it with Code: Copy Serial1.New(portnr, 19200, "N", 8, 1) Is ist possible to set baud to 19200 like a com port ?
Erel B4X founder Staff member Licensed User Longtime User Jan 8, 2011 #2 Android API doesn't allow changing the baud rate. I'm not an expert in this field, but maybe this discussion will be useful: Setting RFCOMM/SPP Bluetooth Baud rate - Android Developers | Google Groups
Android API doesn't allow changing the baud rate. I'm not an expert in this field, but maybe this discussion will be useful: Setting RFCOMM/SPP Bluetooth Baud rate - Android Developers | Google Groups
H Heinz Active Member Licensed User Longtime User Jan 8, 2011 #3 i can set manual the baud rate on my relais but what is the baud rate on my BT-Android device (9600) ? i haven't seen any information on my device.
i can set manual the baud rate on my relais but what is the baud rate on my BT-Android device (9600) ? i haven't seen any information on my device.
R RiskFour Member Licensed User Longtime User Jan 8, 2011 #4 Hi Heinz, I'm using the BTM-222 Bluetooth Module and the setting are: Bitrate = 57600 Databits = 8 Parity = no Stopbits = 1 This Works fine for me, but this Setting are normally for the RS232 Connection between the Bluetooth Module an the Microcontroller. The Handshake between the phone and the BT-Module will be done automatically. If you use the Serial-Lib in B4A take a look on this Tutorial: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6908-android-serial-tutorial.html - Pairing your phone with your Relaycard - Open the Tutorial App und select Menue-> Connect - Send a string Hope this helps...
Hi Heinz, I'm using the BTM-222 Bluetooth Module and the setting are: Bitrate = 57600 Databits = 8 Parity = no Stopbits = 1 This Works fine for me, but this Setting are normally for the RS232 Connection between the Bluetooth Module an the Microcontroller. The Handshake between the phone and the BT-Module will be done automatically. If you use the Serial-Lib in B4A take a look on this Tutorial: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6908-android-serial-tutorial.html - Pairing your phone with your Relaycard - Open the Tutorial App und select Menue-> Connect - Send a string Hope this helps...
H Heinz Active Member Licensed User Longtime User Jan 8, 2011 #5 it runs, but if i disconnect after sending a string the relais works.:sign0085: i'll have a look to the source code. thanks.
it runs, but if i disconnect after sending a string the relais works.:sign0085: i'll have a look to the source code. thanks.
R RiskFour Member Licensed User Longtime User Jan 9, 2011 #6 Looks like you have to send <LF> or <CR> at the end of each String... Change the code in the Sub "btnSend_Click" from: TextWriter1.WriteLine(txtSend.Text) to: TextWriter1.WriteLine(txtSend.Text & Chr(13))
Looks like you have to send <LF> or <CR> at the end of each String... Change the code in the Sub "btnSend_Click" from: TextWriter1.WriteLine(txtSend.Text) to: TextWriter1.WriteLine(txtSend.Text & Chr(13))
Erel B4X founder Staff member Licensed User Longtime User Jan 9, 2011 #7 Code: Copy TextWriter1.WriteLine(txtSend.Text & Chr(13)) This will actually write <CR> followed by <LF>. Instead you should use: Code: Copy TextWriter1.Write(txtSend.Text & Chr(10) & Chr(13))
Code: Copy TextWriter1.WriteLine(txtSend.Text & Chr(13)) This will actually write <CR> followed by <LF>. Instead you should use: Code: Copy TextWriter1.Write(txtSend.Text & Chr(10) & Chr(13))
H Heinz Active Member Licensed User Longtime User Jan 9, 2011 #8 thank you, it works now. Code: Copy TextWriter1.Write(sendstring & Chr(13)) do the job.