Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Pro Trinket + BLE Uart
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Pro Trinket + BLE Uart

by paulosophy on Sat Aug 08, 2015 5:39 pm

I've hooked up my BLE Uart module to my Trinket through these pins:

Trinket Pro------------BLE Uart
TX -------------------------- RX1
RX -------------------------- TX0
6 ---------------------------- CTS
3.3v ------------------------- VIN
GND ------------------------ GND


Then I've changed BluefruitConfig.h to look like this:
// SOFTWARE UART SETTINGS
// ----------------------------------------------------------------------------------------------
// The following macros declare the pins that will be used for 'SW' serial.
// You should use this option if you are connecting the UART Friend to an UNO
// ----------------------------------------------------------------------------------------------
#define BLUEFRUIT_SWUART_RXD_PIN 0 // Required for software serial!
#define BLUEFRUIT_SWUART_TXD_PIN 1 // Required for software serial!
#define BLUEFRUIT_UART_CTS_PIN 6 // Required for software serial!
#define BLUEFRUIT_UART_RTS_PIN -1 // Optional, set to -1 if unused

Then, I uncommented the SoftwareSerial part of both bleuart_cmdmod and atcommand

// Create the bluefruit object, either software serial...uncomment these lines
SoftwareSerial bluefruitSS = SoftwareSerial(BLUEFRUIT_SWUART_TXD_PIN, BLUEFRUIT_SWUART_RXD_PIN);
Adafruit_BluefruitLE_UART ble(bluefruitSS, BLUEFRUIT_UART_MODE_PIN,
BLUEFRUIT_UART_CTS_PIN, BLUEFRUIT_UART_RTS_PIN);

I open the app on the phone, Scan for peripherals, and then click on the one labeled "Adafruit Bluefruit LE". I connect in UART mode.

When I load either the atcommand or bleuart_cmdmode example, I see only gibberish on the phone:
http://imgur.com/a/Ja7hK#NFZyhDw

I'm unable to see anything on the Serial Monitor (/dev/cu.Bluetooth-Incoming-Port) on my computer (Macbook Pro), using baud rate 115200.

Does anyone have any troubleshooting ideas? I'm stumped.

Here are some pictures of my wiring:
http://imgur.com/a/Ja7hK#f8lYhuI

paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Re: Pro Trinket + BLE Uart

by adafruit_support_rick on Sun Aug 09, 2015 10:39 am

Don't use those pins for RX and TX. They are used by the Arduino for the Serial Monitor. The same wiring as for the Uno:
Code: Select all | TOGGLE FULL SIZE
MOD to Pin 12
CTS to Pin 11
TXO to Pin 10
RXI to Pin 9
VIN to 5V
RTS to Pin 8
GND to GND

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pro Trinket + BLE Uart

by paulosophy on Sun Aug 09, 2015 7:43 pm

1. I'm using the original pins now, as suggested.
2. The "Software Serial" lines are still uncommented.
3. It still doesn't work.

When I click on the name in the app, the BLE module turns on the blue light to indicated that it's connected, but I never see anything coming up on either the Serial Monitor on my computer, or on the app (I've tried both Android and iPhone). So, it just looks like no data is getting sent.

But, your post also confused me like crazy. I /know/ the Pro Trinket uses pins 0 and 1 for Software Serial, that's exactly why I thought I had to use them to connect to the BLE module.

My understanding was that, since the Pro Trinket doesn't have the ability to do Serial communication, the BT module acts like a serial port and sends serial messages to the computer. When I hook up my HC-05 module to the Pro Trinket, I plug it into RX0 and TX1, pair my computer with that BT device, and everything works as I expect.

Can you help me build a better mental model for what's happening here? If the BT module isn't acting as the serial communication device, what is? How is the Pro Trinket supposed to be sending information to my computer if not through SoftwareSerial on pins 0 and 1? Especially since nothing's connected on pins 0 and 1 on my Trinket.

p.s. I did confirm that my Macbook Pro has BT 4.0, since not all do, by following these instructions: http://www.imore.com/how-tell-if-your-m ... uetooth-40

paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Re: Pro Trinket + BLE Uart

by adafruit_support_rick on Mon Aug 10, 2015 10:40 am

I assumed you were using an FTDI cable for serial communications. This is what is connected to D0 and D1. D0 and D1 are hardware serial on the Pro Trinket.

If you are using USB for programming and don't have an FTDI cable, then there is no communication with serial monitor. The Pro trinket does not implement a serial port over USB.

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pro Trinket + BLE Uart

by paulosophy on Mon Aug 10, 2015 10:55 am

Ah ok, thanks. That makes a lot more sense.

So the bluetooth is only talking with the phone app, and then I need to figure out my own method of doing serial printing to my computer. Is that right? Why can't I use bluetoothSS (bluetooth Software Serial defined at the top of the sketch) to talk to my computer? (I tried it and it didn't work but I don't understand why).

In the past, I've used my HC-05 BT 2.0 module and connected it up as Software Serial on ports 0 and 1. In that case, I have to pair my computer with the BT module. Then, a new port shows up in the dropdown of the IDE, and allows me to open a connection to the BT module. After that, I can successfully send and receive serial data. Why can't I do that with this BT 4.0 module? (Or, if I can, what would I google that would help me figure out how to do that?)

http://www.instructables.com/id/Arduino ... /?ALLSTEPS

paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Re: Pro Trinket + BLE Uart

by adafruit_support_rick on Mon Aug 10, 2015 11:15 am

This is BLE, not classic BT. MacOSX doesn't support BLE the same way it does classic BT. You have to write an MacOSX app if you want to do anything with BLE.

You may want to pick up an FTDI Friend or an FTDI cable:
https://www.adafruit.com/product/70
https://www.adafruit.com/product/284

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pro Trinket + BLE Uart

by paulosophy on Mon Aug 10, 2015 12:53 pm

Ok thanks!

That helps a lot.

paulosophy
 
Posts: 90
Joined: Fri Apr 17, 2015 5:40 pm

Re: Pro Trinket + BLE Uart

by gto406 on Wed Jan 06, 2016 11:50 am

Hello all,

Following this thread off of a search (of the Forums) for 'FTDI Cable BLE UART Friend'...

I already have an Arduino Mega R3 (bare) and an ADAFruit BLE UART Friend module/component. I am not a super great solderer - and my hope is more to develop a set of BLE GAP/GATT entities (profile/services/characteristics, etc.) using a Mac OSX environment (yes, already an Apple-Developer and have Xcode).

Is the FTDI Cable my best bet for 'getting underway'? I am a bit gun-shy about wiring up the BLE UART Friend to my Mega R3. Unless there is a daughter-card (or similar) I can connect the BLE UART Friend directly to? I did not see one - unless the shield is the ticket?

Any help is much appreciated. From looking at the spec-sheet my easiest start may be to get the FTDI Cable connected to the 'provided header' and solder that to the BLE UART Friend.

Hopefully, not off topic from the OP.

Thanks,
Brian.

gto406
 
Posts: 5
Joined: Wed Jan 06, 2016 11:42 am

Re: Pro Trinket + BLE Uart

by adafruit_support_rick on Wed Jan 06, 2016 12:46 pm

You can't connect a BLE UART Friend to a Mega with an FTDI cable.
You can't connect an FTDI cable directly to the BLE anyway - the pinouts don't match.

If you want to experiment, solder header pins to the BLE, and then use jumper wires between the Mega and the BLE.

The BLE comes with header pins, so solder those to the BLE as shown in the tutorial
https://learn.adafruit.com/introducing- ... d/assembly

Then use these between the BLE and the Mega:
https://www.adafruit.com/products/1954

adafruit_support_rick
 
Posts: 35095
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Pro Trinket + BLE Uart

by gto406 on Wed Jan 06, 2016 5:34 pm

Perfect! Thank you - I shall get practicing on my soldering!!

gto406
 
Posts: 5
Joined: Wed Jan 06, 2016 11:42 am

Please be positive and constructive with your questions and comments.