Solo-DIY-RF-Laptimer icon indicating copy to clipboard operation
Solo-DIY-RF-Laptimer copied to clipboard

Android apps

Open 2black0 opened this issue 8 years ago • 26 comments

Hi, I get issue with android apps, please check attach file

It not show what channel used, rssi is not show

2black0 avatar Feb 05 '17 18:02 2black0

image

data flow change rapidly from R>> to S<<, and bytes received is about 0 or 2

2black0 avatar Feb 05 '17 18:02 2black0

FYI : I use pro mini + HC05 (Baud 115200) + RX5808(V1.0) original source code (no editing)

2black0 avatar Feb 05 '17 18:02 2black0

and try press - / + in channel and get this

image

2black0 avatar Feb 05 '17 18:02 2black0

It all looks like a baud rate issue. Screenshot shows that Android app reads some trash instead of meaningful HEX values from BT. Please verify that you use:

  • 5V 16MHz Arduino
  • 115200 baud at BT module (e.g. try to connect to it from PC via USB-UART adapter at the specified baudrate)

voroshkov avatar Feb 05 '17 19:02 voroshkov

For hc05 baudrate I can confirm 115200 (will post screenshot later)

For arduino need to be check again, okay I will report here asap after make check

2black0 avatar Feb 06 '17 03:02 2black0

I change promini with UNO (5v + 16Mhz), and this is screenshot of baudrate changed of hc05

image

2black0 avatar Feb 06 '17 04:02 2black0

the problem still same, android apps still not show value like before

2black0 avatar Feb 06 '17 05:02 2black0

The terminal screenshot shows that you successfully communicate with your BT module at 9600 baud (see lower right corner of the terminal window). I'm not sure why it shows 115200 as a response.

voroshkov avatar Feb 06 '17 07:02 voroshkov

sorry for not info the process, I use softserial (uno) to connected with HC05,cause I dont have FTDI, but it works, If I send AT it will respond OK, so I think AT Command work normally so PC - uno 9600, and uno - hc05 38400 (default), and success change into 115200,

2black0 avatar Feb 06 '17 07:02 2black0

I see. OK. What is the code you use on Arduino to communicate with HC05?

voroshkov avatar Feb 06 '17 07:02 voroshkov

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {

Serial.begin(9600);

pinMode(9,OUTPUT); digitalWrite(9,HIGH);

Serial.println("Enter AT commands:");

mySerial.begin(38400);

}

void loop()

{

if (mySerial.available())

Serial.write(mySerial.read());

if (Serial.available())

mySerial.write(Serial.read());

}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I am following this tutorial : http://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/step4/Setting-up-connection/

2black0 avatar Feb 06 '17 07:02 2black0

OK. mySerial.begin(38400); means that BT module is connected to Arduino at 38400.

voroshkov avatar Feb 06 '17 07:02 voroshkov

Did you enter AT+BAUD8 command in terminal?

voroshkov avatar Feb 06 '17 07:02 voroshkov

Sorry, I've never worked with HC-05 before. It looks like in config mode it's always 38400. Take a look at this vid: https://www.youtube.com/watch?v=zoJUAjW3vQ0 It looks they enter a bit different command to set baud rate: AT+UART=115200,1,0

voroshkov avatar Feb 06 '17 08:02 voroshkov

Okay thanks, will try with AT+UART=115200,1,0 Will report here asap

2black0 avatar Feb 06 '17 08:02 2black0

Well, it looks this won't work. These params control the parity and stop bits. Two zeros correspond to default Arduino UART settings. One more thing you might need is a voltage divider at RX pin of your BT module(to have 3.3V signals instead of 5V), but this seems odd, since you can successfully communicate with HC05 during setup without a voltage divider.

voroshkov avatar Feb 06 '17 08:02 voroshkov

Wait I will make simple test of BT HC05 and Arduino (BT Terminal), if this is a problem maybe I need to fix it first, but If no problem I think the side of Android APPs maybe have some bug,

Oh, my test device is Xiaomi RedMi Note 4 (MIUI 8),

2black0 avatar Feb 06 '17 08:02 2black0

I use HC-05 without issues, set to 115200 and all works great

nikybiasion avatar Feb 06 '17 09:02 nikybiasion

@nikybiasion AT+UART=115200,1,0 right?

2black0 avatar Feb 06 '17 09:02 2black0

i've set only AT+UART=115200, try to reset the module with AT+ORGL, set name, password and speed

nikybiasion avatar Feb 06 '17 10:02 nikybiasion

@2black0 have you managed to solve the issue?

voroshkov avatar Feb 09 '17 09:02 voroshkov

@voroshkov still cant solved, I am still trying with other bluetooth, maybe this one is not normal

2black0 avatar Feb 09 '17 09:02 2black0

You can try a simple test:

  1. connect your HC05 to arduino:
  • GND - GND
  • 5V - VCC
  • RX - TX
  • TX - RX
  1. Upload sketch:
int cnt = 0;
void setup() {
   Serial.begin(115200);
}
void loop() {
   cnt++;
   Serial.print("Counter:"); 
   Serial.println(cnt);
   delay(1000);
}
  1. Download https://play.google.com/store/apps/details?id=Qwerty.BluetoothTerminal to your phone
  2. Power all up and connect from phone App to BT

If after connection you see messages "Counter: X" appearing in android app, then it's all set up correctly and there's possibly an issue with Solo Laptimer App or with hardware connections in your laptimer device.

Otherwise, try changing the baud rate in the Serial.begin(115200); line of the sketch. So you'll find out what baud rate your HC module really uses.

voroshkov avatar Feb 09 '17 10:02 voroshkov

@voroshkov will try this night, will reported it back

2black0 avatar Feb 09 '17 10:02 2black0

Any update on this one ?

FredFrancisIT avatar Mar 10 '17 20:03 FredFrancisIT

from my youtube chanel (Spanish, sorry)

Adaptador TTL solo cuatro cables necesarios; RX, TX, +5V y GND (TX-RX cruzados) Hay que conseguir entrar en el modo AT2 (pulsar el boton al conectar al TTL y soltar) parpadeo de led 1/seg Ventana de comandos a 38400 baudios (Ambos NL & CR) Introducimos: AT+UART=115200,1,0 AT+NAME=NOMBRE el pin será 1234 Con esa configuración funcionan perfectamente Partir siempre de la configuración original

leveltgn avatar Aug 25 '17 23:08 leveltgn