Troubleshooting Common DRO Connection Problems

Tuesday, July 2, 2013

Lately I’ve been getting a fair number of emails and comments from people having various problems connecting the Android application to the Arduino Digital Readout controller. Almost all of them fell into one of three following “buckets”:

  • The controller does not appear in the “Select a Device” dialog
  • The application is unable to connect to the controller
  • The application appears to connect but connection is lost almost immediately

The good news is that those problems are usually easy to resolve, so in this post I will try to address the most common scenarios. The solutions are designed for Arduino UNO board connected via a Linvor HC-0x transceiver (AKA Bluetooth-to-serial adapter) but should work for other combinations as well.

The Controller Doesn’t Appear in the “Select a Device” Dialog

Symptom

The Bluetooth device doesn’t show up in the “Connect” dialog or the dialog is empty.

Cause

The controller is not paired with the phone/tablet.

Solution

Pair the Bluetooth module to your android Device.

  1. Turn the controller on and make sure that the LED on Linvor module is blinking
  2. Make sure the transceiver is turned on (on Linvor the red LED should be blinking)
  3. Go to Settings -> Bluetooth and click “Scan”
  4. Once your transceiver appears in the “Available Devices” list, click on it
  5. Enter the pairing code. (For Linvor it is either 0000 or 1234.)

If the modem isn’t found there might be a problem with the hardware (i.e. the Linvor module is either defective or is configured for “Master” mode).

Unable to Connect

Symptom

The device appears in the “Select a Device” list but when you try to connect to it the connection fails.

Cause

The most common reason for this problem to occur is a loss in pairing between the phone/tablet and the transceiver.For example the user might pair the module to another phone or a PC, etc. Even though the transceiver still appears in the list of paired devices, it will refuse connections from the current phone or tablet.

Solution

First of all, make sure that the Bluetooth module is powered on (the LED should be flashing). If that is the case and you still can’t connect, try unpairing it and pairing again following the steps in the previous section.

Connection Lost

Symptom

After connecting the DRO to the Arduino board the application briefly displays “Connected” status and within a few seconds switches to “Connection Lost”.

Cause

When a connection is established the application starts waiting for the input from the controller. If it doesn’t get at least one valid input per second, the application assumes the connection to the controller is lost. After 5 seconds it will drop the Bluetooth connection altogether and go into “Disconnected” state.

  • The Arduino is plugged into a computer via USB cable
  • The connection between Arduino and the serial-to-Bluetooth adapter is lost
  • There is a Baud rate mismatch between the Arduino and the transceiver
  • Microcontroller has halted and is not sending any output to the serial adapter
  • Transceiver is not configured properly

Solution

Determining the cause of this problem will require a bit of troubleshooting. Before digging deeper, though, please power-cycle the microcontroller and the Bluetooth transceiver, and completely shutdown and restart the application (by using “Force Stop” or sweeping it away from the list of running applications if your device allows it).

Output similar to this indicates
that the controller
can successfully send the data

I. Ensure that the controller is sending correct output to the serial port.

  1. Disconnect the Bluetooth module from the Arduino
  2. Connect the Arduino to a computer via a USB cable
  3. Open Arduino IDE
  4. In the … select the correct port
  5. Open the “Serial Monitor”

If you see rapidly scrolling “x0;y0;z0;” etc., the Arduino is working.

If there is no output at all, try selecting a different ports (if there are any in the dropdown). If that doesn’t help there is a problem with the controller or the firmware, so please try the following:

  • Download a “clean” sketch from the Downloads section
  • Make sure the correct boards is selected in the … dropdown
  • Re-upload the it to the board
  • If the sketch uploads successfully, open the Serial Monitor and check for the output

If there is still no output your microcontroller might be defective or damaged. If you’re using Arduino UNO, a replacement chip can be purchased from Sparkfun or off eBay. Otherwise the whole board might need to be replaced.

II. Ensure that the serial-to-Bluetooth adapter is working correctly

Please note. this step requires a computer with a Bluetooth adapter. If your machine doesn’t have one you can either get a USB Bluetooth dongle or skip to the next section.

  1. Unplug the Arduino from the computer
  2. Reconnect the Bluetooth transceiver to the Arduino
  3. Power the board back up
    Since the USB connection uses the same UART port in can interfere with the communications. It’s best to not plug the board into a computer and use a USB phone charger, wall wart or a battery instead.
  4. Pair the device to the computer
  5. In the “Serial Port” sub-menu select the appropriate port
  6. Open the Serial Monitor and check the output
  7. Tip: when a serial connection to Linvor BT adapter is open the LED stops blinking and lights up red.

If there is no output or the output contains strange characters, the Baud rate between the Arduino and the BT adapter doesn’t match. The sketch provided on the Downloads page assumes that Linvor’s rate is set to factory default 9600 Baud. There is a chance that your transceiver has been reprogrammed to another rate. In that case you will either reset it back to factory defaults or try changing the Arduino code to match the Linvor.

III. Ensure that the Phone/Tablet can receive the data

If the device doesn't appear in  he dialog,
click "Scan for device"

The final step is to make sure that the tablet can receive the data from the tablet. The easiest way to do so it to install one of the free Bluetooth terminal applications.

  1. Pair the transceiver to the phone/tablet as described in the first section of this post
  2. Go to Google Play Store and search for “Blue Term” and install it
  3. Open BlueTerm
  4. In the menu press “Connect Device”
  5. Select “Linvor” (or whatever your device name is) from the dialog
  6. After a brief delay the application should connect and start showing output similar to the screenshot below.
If everything is working as expected
BlueTerm will show similar output

At this point, if the tablet/phone doesn’t receive the output from the controller there might be a drive issue or the Bluetooth chip in the tablet. If possible, try a different phone or tablet. If you are using a “hacked” tablet or phone using a custom ROM, such as Cyanogenmod etc. try installing a different build. Otherwise you will need to contact the manufacturers technical support or seek help on the support forums, etc.

Although it’s highly unlikely, but if the above steps all check out but the DRO application still keeps loosing the connection please feel free to leave a comment or send me an email.

33 comments :

  1. Thank you, this helped find the problem. Once the baud rate was changed to 115200 the Blue Smurf Silver started sending.

    Frank

    ReplyDelete
  2. I have completed the TouchDRO and programmed and tested it. It sends x0;y0;z0; to the Blueterm. As I understand it, this shows the build is good, the program is good, and it transmits correctly.
    When I plug in an Igaging scale, it does nothing, no readout is provided and the output still runs zeros. Plugged into the IGaging head, the scale works.
    It does not seem to be sending data to the Touchdro

    ReplyDelete
    Replies
    1. Make sure you have the right firmware loaded (universal firmware doesn't provide the clock for iGaging scales). If that is right, check the data and clock lines. If they are inverted, nothing will read.

      Delete
    2. Gerry - Did you ever figure out the cause of your problem? I have a similar issue.

      Dan

      Delete
  3. I have completed the Arduino Uno version. Works on USB, I get data in the Arduino serial monitor. The Bluetooth module connects briefly but then it drops the connection. I loaded Blue Term and I get no data the that screen although it holds the connection until I quit it. I have both Tx and Rx connected the to Arduino pins of the same labels. Does this mean my tablet in unable to receive data or the bluetooth module is not sending data?

    I don't have blue tooth on a regular computer; only the tablet, so I was confused by what you meant by these instructions:
    Pair the device to the computer
    In the “Serial Port” sub-menu select the appropriate port

    Should my tablet have something of this nature? Or are you referring to a regular PC type computer?



    ReplyDelete
    Replies
    1. Paul,
      You need to connect Rx to Tx and vice verse.
      Regards
      Yuriy

      Delete
    2. Well, that seems totally counter intuitive; but it worked! Thanks. It all seems to be functioning as it is supposed to. I now need to get the slides on the mill and then learn to use it. Never used a DRO of any kind before.

      Thanks again!

      Delete
  4. Ok, I think I have done all that I can to troubleshoot the connection problem. I have a Samsung Tab 2 running 4.0.4 with Kernel 3.0.8. Blue Term shows that I am getting the data from the Arduino. When I try to log on, enter the password, the Touch DRO app times out, no connection is made, and the "unfortunately DRO has stopped" message is seen. I have reset the tablet to no avail. Can you provide any help? The system worked fine with your original version. Thanks, Harry

    ReplyDelete
    Replies
    1. Harry,
      email me at ycroosh at gmail dot com. This shouldn't be happening, so there might be some stuck setting somewhere, etc.
      Regards
      Yuriy

      Delete
  5. Running MSP430G2335, Ver 1.5. I have the D- connected to P1.7, D+ to P2.4 & P2.5, Voltage to VCC & GND to GND. P1.2 (UART) to Rxd & Ground to GND on FTDI. Loaded DigitalReadoutBasic_v1.3.txt via CLI programmer. it runs on terminal program, but only puts out x0,y0,z0,w0 over and over. Moving the iGauging scale head doesn't change anything. When connected to tablet by USB, it also get no change, just 00.0000. Any Ideas?

    ReplyDelete
    Replies
    1. Les,
      Basically you have good connection between the controller and the tablet but something isn't working between the scales and the controller. try one scale at a time, swap the D+/D- connections and see if that does anything.
      Thank you
      Yuriy

      Delete
  6. Yuri,
    I tried 1 scale, no change. I swapped D-/D+ on the Y input. D- to p2.4, D+ to P1.7.
    Now I get:
    x0;y-1;z0;w0;t0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y0;z0;w0;x0;y0;z0;w0;x0;y0;z0;w0;x0;y0;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;z0;w0;x0;y-1;
    Notice there is a y-1 sometimes, and the first set has a t0?
    Other that that, there is no change.
    The scales work with the displays they came with, these are the iGauging basic scales.
    I have re-flashed the MSP430, no help.
    I am running on a 5v wall pack, also tried a USB battery pack, no change.
    Any other suggestions?
    Thanks again for the help,
    Les

    ReplyDelete
    Replies
    1. Yuri,
      I did some checking.
      My iGauging scale head outputs a Clock signal 7.6Khz, 3v P2P that is 30uS high and 100uS low when powered by its internal battery.
      My MSP430G2553 flashed to Basic v1.3 is putting out a 5Khz 2v P2P signal that is 100uS high and 100uS low. (the signal start at 3v P2P sometimes, but settles at 2v P2P)
      Does this make any sense?
      Thanks, Les

      Delete
  7. I built the arduino version. My Z and Y axis work perfectly but my X axis has jitter. The value changes by .040 every second or half second, then goes back to the original value. It happens the same no matter which scale is plugged into that jack, and regardless of the number of scales plugged into the arduino. Changing the orientation, coiling, straightening of the scale leads doesn't change the effect at all. I've tried running off of a wall charger as well as a usb battery pack (Xiaomi Power Bank).

    Any suggestions?

    ReplyDelete
    Replies
    1. Oh I should also mention that I've got all of my clock lines on the usb breakout boards daisy chained from one to the other. Could this cause it?

      Delete
  8. I'm able to get the x0;y0;z0;w0.. scrolling in blueterm but can't seem to get the real data off of my acu-rite/anilam ar-5 scales. I have confirmed that the pins are correct with the manual and also checked the pins in an old single channel DRO (and both scales work with this DRO). Still no luck. Any suggestions on where to check next? I flashed the quadrature file to the TI board.

    ReplyDelete
    Replies
    1. Do you have 5V connected to the scales? This looks like a connection issue somewhere between the scales and the controller.

      Delete
    2. Yes. I tested and It has 5volts at the scales.

      Delete
    3. Any resolution to this? I am looking to build a DRO setup using an older set of Anilam AR-5 scales.

      Delete
  9. I have a interesting issue. I am using Touch Dro on my Smithy 3in1 machine and I have setup xyz for the mill on preference bank A and xz for the lathe on preference bank B. When I switch from the mill(A) to lathe(B) this is where the issue begins. X and Y need to be physically swapped in order for the axes to be correct and the diameter \ radius button to work correctly on the correct axis. I tried renaming the axis X to Z and Y to X but when creating patterns when I swap back to mill everything is backwards so the only thing I can do, I guess, is swap the X and Y on the module unless I have missed something. Any ideas? I really don't want to have to swap the cable every time I swap to the lathe. The mini B connectors aren't all that great to begin with and content plugging and unplugging will eventually wear out the terminals.

    ReplyDelete
    Replies
    1. Brent,
      Unfortunately there isn's an elegant solution to this. I might add a setting for input axis label at some point (per settings bank), but not sure when.

      Thank you
      Yuriy

      Delete
    2. Problem solved...I installed a dpdt switch on the X and Y data wires so that they flip flop which terminal the data gets sent to. Works perfectly.

      Delete
  10. Yuri, I am using Android 4.4.2 and it does not want to connect to the hc-05 or hc-06.
    I had to download a hacked blueterm app that uses the "reflection method". With the hacked app, I can see the bluetooth data, but still can't connect with the DRO.
    http://redacacia.me/2012/07/18/blueterm-app-for-most-android-devices/
    http://redacacia.me/2012/07/17/overcoming-android-bluetooth-blues-with-reflection-method/

    Bill

    ReplyDelete
    Replies
    1. Hi,
      the same here using the version from Play Store. I realized this was the version 2.0.0.
      Here in the download section, you can find the 2.0.1. Using this 2.0.1 I do not have the connect problem any more.

      Regards
      Ales

      Delete
  11. Hi Yuriy and all, I just assembled the basic version of the MSP430 controller (flashed w/ v1.31) to use with some iGaging "AbsoluteDRO" scales. No trouble with flashing, with pairing the bluetooth module or connecting it the app, but the readouts just flash back forth between three or four different numbers (big numbers, and all multiples of the first number). Moving the scales has no effect.

    Any idea what is happening here? I did read the other threads re: the iGaging/Chinese reliability issues but these seems to be something other than a capacitance or electrical/magnetic interference problem. Any thoughts on what is going on? Has anyone else had this issue, and if so, how did you rectify it? Any input is greatly appreciated. Thanks!

    ReplyDelete
    Replies
    1. You used wrong version of the firmware. If you haven't, take a look at the last two blog posts.
      Yuriy

      Delete
  12. It's also worth mentioning that I also tried firmware v1.2 in all combinations of connected, disconnected, rebooted, etc. with same result, however, the lights on the LaunchPad are different with 1.2 -- it gives a solid red with a slow blink on green as you describe in your instructions when no scale is attached; when the scale is attached the red only lights every 8-12 seconds. With firmware v1.31, no green light, and the red blinks very rapidly all the time, regardless of whether the scale is attached or not.

    ReplyDelete
    Replies
    1. You need mixed scale firmware for Absolute scales (if they are Absolute DRO+, non-Plus isn't supported yet).

      Delete
  13. Thanks Yuriy. I hadn't read those posts. Bummer, the ones I have are the older version, no "+". I did try the mixed-scale firmware also, but got nothing at all from the scales. Are you planning to add support for these to the project at some point? I have one that I could loan you for a little while if that would help. Let me know. Thanks!

    ReplyDelete
    Replies
    1. Ian,
      I have borrowed a scale from a fellow forum member, but so far no luck. There is another guy doing a lot of work decoding the protocol, but it's not looking too good. Apparently iGaging used some really weird protocol that is different from anything else I've see, and they either don't know what it is or aren't willing to help.
      I will keep you posted if/when we figure it out.

      Delete
    2. Thanks again Yuriy. It have four of the AbsoluteDRO scales that I bought together from Grizzly several months ago. Three are installed on my mill, the fourth is a 6" that I bought for the quill but used something else instead. This was the one I was using to test my controller. I had assumed they were all the same, but upon closer inspection the three longer scales installed on the mill ARE the "Plus" version. So I modified the controller this evening per your instructions and voila, it works perfectly. Can't wait to give it whirl tomorrow. Thank you for sharing all your knowledge and hard work on this.

      Delete
    3. Cool. Glad that it worked out at the end. Let me know how it goes.

      Delete
  14. I have built an Arduino version. I have modified a sketch from https://sites.google.com/site/marthalprojects/home/arduino/arduino-reads-digital-caliper to read the cheap Chinese scales from Harbor freight. I can see the data from the caliper any time on my pc using TeraTerm.
    my problem is the Android drops connection to the Bluetooth module if I leave the main screen to set the firs axis CPI. This does something to disable the Android Bluetooth.
    I can use a Android app to 'repair' the BT reboot and connect to the HC-06. I have left it connected for a couple hours at a time. Android App Blue Term displays the data flow from the HC-06 fine. As soon as I try to set the axis CPI, the BT connection drops again and the cycle starts again.

    ReplyDelete