0

sending data to adafruit App
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: sending data to adafruit App

by naley on Mon Jun 26, 2017 4:01 pm

Thank you so much. That worked beautifully.

Is there any option to ploT Double Y graph on the plotter? ( Having 2 Y axis and one X axis)

naley
 
Posts: 63
Joined: Fri Apr 28, 2017 4:26 pm

Re: sending data to adafruit App

by adafruit_support_rick on Mon Jun 26, 2017 6:08 pm

no. sorry

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

Re: sending data to adafruit App

by naley on Tue Jun 27, 2017 2:56 pm

Okay! Thanks for all the help!

naley
 
Posts: 63
Joined: Fri Apr 28, 2017 4:26 pm

Re: sending data to adafruit App

by naley on Sat Aug 12, 2017 9:10 pm

Hello,

The bluetooth writes data to the app very slowly when compared to the speed with which I get the data on the serial monitor.
Also, while it is writing data to the app, when I open the serial monitor, the serial monitor shows "Initialising the Bluefruit LE module: Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring? "and the data speed in the app increases and suddenly the data stops and shows ATZ ATZ ATZ. Please correct me where am going wrong.
Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <Arduino.h>
#include <Wire.h>

#include <SoftwareSerial.h>
#include"Adafruit_BLE.h"
#include"Adafruit_BluefruitLE_SPI.h"
#include"Adafruit_BluefruitLE_UART.h"
#include"BluefruitConfig.h"

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);
void setup()
{
   
 
 
  Wire.begin(); // wake up I2C bus
  delay (500);
  Serial.begin(9600);
  Serial.println ("Sketch has started");
  /* Initialise the module */
  Serial.print(F("Initialising the Bluefruit LE module: "));

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

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

 while (! ble.isConnected()) {
      delay(500);
  }
    // Set module to DATA mode
  Serial.println( F("Switching to DATA mode!") );
  ble.setMode(BLUEFRUIT_MODE_DATA);

}
void loop()
{
 ble.print(time);
      ble.print(',');
      ble.print(getPressure());
      ble.print(',');
      ble.print(solenoidvalue);
      ble.println();

}
 

naley
 
Posts: 63
Joined: Fri Apr 28, 2017 4:26 pm

Re: sending data to adafruit App

by adafruit_support_rick on Sun Aug 13, 2017 12:51 pm

What sort of Arduino are you using? Probably, opening Serial Monitor causes the sketch to reset. But you're still connected, so you see the reset commands coming out on the app.
What wiring are you using? Can you post a picture of your wiring?

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

Re: sending data to adafruit App

by naley on Mon Aug 14, 2017 5:14 pm

Hello,

Am using arduino Promini (3.3V,8Mhz). I have the arduino connected to the Uart like this:

Arduino ------ > BLE UART

12 ----> MOD
11 ----> CTS
10 ----> TXO
9 ---> RXI
VCC ----> VIN
GND ----> GND
8 ----> RTS

naley
 
Posts: 63
Joined: Fri Apr 28, 2017 4:26 pm

Re: sending data to adafruit App

by adafruit_support_rick on Wed Aug 16, 2017 4:43 pm

Opening the serial monitor will reset the processor and restart the sketch. But the Bluefruit ought to handle that properly when the ble.begin function is called. Not sure why you're seeing that problem.

As for the data rate issue, I think the problem is the way that you're sending your data to the BLE. You are doing six separate writes to the module.
Code: Select all | TOGGLE FULL SIZE
 ble.print(time);
      ble.print(',');
      ble.print(getPressure());
      ble.print(',');
      ble.print(solenoidvalue);
      ble.println();


What I think may be happening is that it is sending 6 separate BLE packets, which will be slow. Try using a String object or the snprintf function to construct your data string before you pass it to the module.

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

Please be positive and constructive with your questions and comments.