Adafruit Feather MO and Bluefruit Friend SPI Breakout... No Luck

I have a Adafruit Feather MO LoRa with the Adafruit Bluefruit Friend SPI breakout. The feather MO series uses the ATSAMD21G18 ARM Cortex M0 processor. I’m successful in connecting to and using to Adafruit’s bluetooth to mobile ios sketches.

The blink example browser has an Adafruit MO and MO Pro option and Adafruit Bluefruit LE. Great! Then there is a section in the code where I think the SPI pins are to be defined - CS, IRQ, RST but it looks like the following:

// define pins (varies per shield/board)
#define BLE_REQ   10
#define BLE_RDY   2
#define BLE_RST   9

What does this translate to?.In other sketches for this board type the options are presented as:

//pins for feather BLE, see adafruit web for details
#define BLUEFRUIT_SPI_CS               10
#define BLUEFRUIT_SPI_IRQ              9
#define BLUEFRUIT_SPI_RST              6 

and then it won’t compile because includes are missing in this case it is.

#include "BLESerial.h"

I know how to install libraries. What gives? I’ve read something about if there are more than two then bad things happen - but not sure exactly what that means. Also I had to download BLEPeripheral.h from github because the compiler was crashing on this first and I couldn’t find it in the libraries you distributed.

The above option doesn’t compile.

Then I find this suggestion where minimal code is posted:

This code compiles and can be published to the board. (I entered the authentication code and set the pins) but the serial monitor is blank and when I try to connect the Blynk project to the hardware I get a Can’t connect error in the iphone app.

In the above sketch I also try setting pin 8 to high (needed because it’s a feather LoRa) and also try seeing if there is a serial issue by inserting

#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL)
  // Required for Serial on Zero based boards
  #define Serial SERIAL_PORT_USBVIRTUAL
#endif

All of these compile and publish. After reset the serial is blank and the iphone will not connect. I can see the Bluefruit Friend SPI breakout is trying (blue light comes on).

I’ve also had some questions about what device to select. I’ve tried both Zero and Generic

@Gaff Hello! I reference one of your posts in this question - and reference some of your code. Can you help?

Hmm, can you be more specific on which BLE board you’re using? Is it this guy:

Did you get the adafruit examples to work? This one is close to what you need: https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/tree/master/examples/bleuart_datamode

In which case you’ll need something like:

#include "Adafruit_BLE.h"
#include "Adafruit_BluefruitLE_SPI.h"

#define BLUEFRUIT_SPI_CS               8
#define BLUEFRUIT_SPI_IRQ              7
#define BLUEFRUIT_SPI_RST              4    // Optional but recommended, set to -1 if unused

Adafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);
//etc

If you try it with the sketch I posted it /might/ work.

Debugging this is a case of switching on debug in the blynk library (can’t remember exactly how but it’s simple enough) and check the serial monitor to see if you’re connecting. Make sure you get the adafruit examples working so you know there are no hardware issues etc.

Wow! thanks for the response.

Yes that’s it - that’s the BLE board I’ve been working with off of the feather MO loRa.

Sorry for not being more specific - I’m coming to the conclusion I’m going to need to shift from an adafruit feather MO LoRa with the UART Friend breakout to a feather MO BLE with a featherwing LoRa. I need to consolidate all of these wires.

I have been able to get the adafruit examples working in the current setup. I’m going to spend some time over the next couple of days looking at your comments and see if I can’t get this working.

What board did you select in blynk when setting up your project? Did you choose adafruit nano or generic?

Think I just went with a generic board. I tend to use virtual pins for my projects anyway so the actual board doesn’t matter much to me.