0

Flora V3 can't connect to Bluefruit LE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Flora V3 can't connect to Bluefruit LE

by Riddler on Fri Feb 15, 2019 5:04 pm

Hello,

I'm trying to connect a Flora V3 to a Blurfruit LE to send data from a sensor to the Bluefruit LE Connect app on android. I can connect the Bluefruit to the phone fine, but I'm having trouble connecting the Flora to the Bluefruit. Every time I try to upload one of the example codes and run it, I invariably receive the "Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?" error. I thought it was a wiring issue at first, but I added alligator clips to try to remove the possibility of that being the issue. Here's a picture of the wiring setup:

IMG_0767.jpg
IMG_0767.jpg (242.44 KiB) Viewed 78 times


And here's the code I've been trying:

Code: Select all | TOGGLE FULL SIZE
#include <Arduino.h>
#include <SPI.h>
#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)
#include <SoftwareSerial.h>
#endif

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM303.h>
#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"
#include "Adafruit_BluefruitLE_UART.h"

#include "BluefruitConfig.h"

Adafruit_LSM303 lsm;

    #define FACTORYRESET_ENABLE         1
    #define MINIMUM_FIRMWARE_VERSION    "0.6.6"
    #define MODE_LED_BEHAVIOUR          "BLEUART"

Adafruit_BluefruitLE_UART ble(BLUEFRUIT_HWSERIAL_NAME, BLUEFRUIT_UART_MODE_PIN);


// A small helper
void error(const __FlashStringHelper*err) {
  Serial.println(err);
  while (1);
}

void setup(void)
{

delay(1000);
 
  #ifndef ESP8266
  while (!Serial);     // will pause Zero, Leonardo, etc until serial console opens
  #endif
  Serial.begin(9600);
 
  // Try to initialise and warn if we couldn't detect the chip
  if (!lsm.begin())
  {
    Serial.println("Oops ... unable to initialize the LSM303. Check your wiring!");
    while (1);
  }
 
  Serial.println("");
 
  Serial.println(F("Adafruit Bluefruit Command <-> Data Mode Example"));
  Serial.println(F("------------------------------------------------"));

  /* Initialise the module */
  Serial.print(F("Initialising the Bluefruit LE module: "));

  if ( !ble.begin(VERBOSE_MODE) )
  {
    error(F("Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?"));
  }
  Serial.println( F("OK!") );

  if ( FACTORYRESET_ENABLE )
  {
    /* Perform a factory reset to make sure everything is in a known state */
    Serial.println(F("Performing a factory reset: "));
    if ( ! ble.factoryReset() ){
      error(F("Couldn't factory reset"));
    }
  }

  /* Disable command echo from Bluefruit */
  ble.echo(false);

  Serial.println("Requesting Bluefruit info:");
  /* Print Bluefruit information */
  ble.info();

  Serial.println(F("Please use Adafruit Bluefruit LE app to connect in UART mode"));
  Serial.println(F("Then Enter characters to send to Bluefruit"));
  Serial.println();

  ble.verbose(false);  // debug info is a little annoying after this point!

  /* Wait for connection */
  while (! ble.isConnected()) {
      delay(500);
  }

  Serial.println(F("******************************"));

  // LED Activity command is only supported from 0.6.6
  if ( ble.isVersionAtLeast(MINIMUM_FIRMWARE_VERSION) )
  {
    // Change Mode LED Activity
    Serial.println(F("Change LED activity to " MODE_LED_BEHAVIOUR));
    ble.sendCommandCheckOK("AT+HWModeLED=" MODE_LED_BEHAVIOUR);
  }

  // Set module to DATA mode
  Serial.println( F("Switching to DATA mode!") );
  ble.setMode(BLUEFRUIT_MODE_DATA);

  Serial.println(F("******************************"));
}


void loop(void)
{
 
  //lsm.read();
 
  /* Display the results (light is measured in lux) */
  //int accel = (((int)lsm.accelData.x+(int)lsm.accelData.y+(int)lsm.accelData.z)/3);
    //ble.println(accel);
 
  //delay(1000);
   
}


And the config file:

Code: Select all | TOGGLE FULL SIZE
// COMMON SETTINGS
// ----------------------------------------------------------------------------------------------
// These settings are used in both SW UART, HW UART and SPI mode
// ----------------------------------------------------------------------------------------------
#define BUFSIZE                        128   // Size of the read buffer for incoming data
#define VERBOSE_MODE                   true  // If set to 'true' enables debug output


// HARDWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the HW serial port you are using. Uncomment
// this line if you are connecting the BLE to Leonardo/Micro or Flora
// ----------------------------------------------------------------------------------------------
//#ifdef Serial1    // this makes it not complain on compilation if there's no Serial1
#define BLUEFRUIT_HWSERIAL_NAME      Serial1
//#endif


// SHARED UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following sets the optional Mode pin, its recommended but not required
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_UART_MODE_PIN        -1    // Set to -1 if unused


Any help would really be appreciated!

Riddler
 
Posts: 5
Joined: Thu Feb 14, 2019 5:45 pm

Re: Flora V3 can't connect to Bluefruit LE

by adafruit_support_carter on Fri Feb 15, 2019 6:56 pm

As another way to check the wiring, do you have a multimeter?

adafruit_support_carter
 
Posts: 10977
Joined: Tue Nov 29, 2016 2:45 pm

Re: Flora V3 can't connect to Bluefruit LE

by Riddler on Sun Feb 17, 2019 2:25 pm

adafruit_support_carter wrote:As another way to check the wiring, do you have a multimeter?


We checked with a multimeter and all connections seem to be active.

Riddler
 
Posts: 5
Joined: Thu Feb 14, 2019 5:45 pm

Re: Flora V3 can't connect to Bluefruit LE

by adafruit_support_carter on Mon Feb 18, 2019 3:06 pm

With everything unpowered, try doing a continuity test between then pads. On either end, touch the multimeter probe to only the copper pad part on the board itself, so it doesn't touch either the wire or the alligator clip. For example, in the image below, test continuity between each colored dot.
test_points.jpg
test_points.jpg (184.93 KiB) Viewed 39 times

adafruit_support_carter
 
Posts: 10977
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.