Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
App keeps dropping bluetooth connection to arduino
I've put together some really simple code on a Teensy 3.2 and connected via an HC-06 to the touchDRO app.  First time it connected and worked OK for a few minutes. Then it kept dropping the BT connection. It would reconnect and then drop again straight away.  I've tried it on two phones, same happens. Tried a different HC-06, same issue. It will connect to a serial port terminal on the phone and hold the connection.

Any ideas what I'm doing wrong?
My code just outputs via Serial1.print withe the ; delimiter  I'm not using CR or new line, should I?
What exactly are you printing? It looks like the app is not getting data in a correct format and drops the connection.
This is the output


or this if it goes negative


I'm forcing Y and Z to 0 as I've only mocked this up with a single scale at the moment.

Could it be that I'm sending updates too quickly? I notice RysiuM's Arduino code contains some sort of trigger (tickTimerFlag), I just send the entire XYZ data string every time I receive a changed value.
I think I may have solved my problem, it looks like the connection drops off if no data is sent for approx 30 seconds. Once it drops it won't reconnect and stay reconnected. I have to shut the app down and restart it. I've now changed the code on my Teensy (fast and cheap micro controller) to send an update every second even if the scale hasn't moved. This seems to have fixed the issue.

Forum Jump:

Users browsing this thread: 1 Guest(s)