Blynk libraries for BLE

Hi,

I’m working on a project where I want to display information from my Arduino Uno (connected to my car) and send data through a BLE module (Adafruit nRF8001 BLE Breakout Module). With this, I downloaded the libraries provided on Blynk’s website and was unable to get simple examples to compile. I have some good experience with how to add libraries to the Arduino IDE, but I can’t seem to figure this out. Any help or suggestions? Can someone provide the…

BlynkSimpleSerialBLE.h
BLEPeripheral.h
BLESerial.h
hal_platform.h

libraries separate from the downloadable file provided on Blynk’s website? Thanks.

Here’s what I’ve downloaded…

  1. Check if you have duplicates of these libraries in other folders (IDE could pick wrong copy)
  2. Read carefully the introduction comment in example sketches - it explains what else is needed.
1 Like

Still no luck. I began by reading the instructions at the top of the sketch. I’ve compiled the Adafruit Bluefruit LE example and manually added each library that populates in the error messenger of the Arduino IDE. I also attempted to use the library manger to install the libraries. I even deleted everything and restarted just in case there was a bug…Wish there was a downloadable file of only Adafruit Bluefruit LE libraries, so the basic example programs were more user friendly.

1 Like
sketch/BLESerial.h:7:7: warning: type 'struct BLESerial' violates one definition rule  
 class BLESerial : public BLEPeripheral, public Stream
       ^
sketch/BLESerial.h:7:7: note: a type with the same name but different layout is defined in another translation unit
 class BLESerial : public BLEPeripheral, public Stream
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: warning: type 'struct BLEPeripheral' violates one definition rule  
 class BLEPeripheral : public BLEDeviceEventListener,
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: a type with the same name but different layout is defined in another translation unit
 class BLEPeripheral : public BLEDeviceEventListener,
       ^
sketch/BLESerial.h:7:7: warning: type 'struct BLESerial' violates one definition rule  
 class BLESerial : public BLEPeripheral, public Stream
       ^
sketch/BLESerial.h:7:7: note: a type with the same name but different layout is defined in another translation unit
 class BLESerial : public BLEPeripheral, public Stream
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: warning: type 'struct BLEPeripheral' violates one definition rule  
 class BLEPeripheral : public BLEDeviceEventListener,
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: a type with the same name but different layout is defined in another translation unit
 class BLEPeripheral : public BLEDeviceEventListener,
       ^
sketch/BLESerial.h:7:7: warning: type 'struct BLESerial' violates one definition rule  
 class BLESerial : public BLEPeripheral, public Stream
       ^
sketch/BLESerial.h:7:7: note: a type with the same name but different layout is defined in another translation unit
 class BLESerial : public BLEPeripheral, public Stream
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: warning: type 'struct BLEPeripheral' violates one definition rule  
 class BLEPeripheral : public BLEDeviceEventListener,
       ^
/Users/Dylan_Benedict/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: a type with the same name but different layout is defined in another translation unit
 class BLEPeripheral : public BLEDeviceEventListener,
       ^

Sketch uses 21,854 bytes (67%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,757 bytes (85%) of dynamic memory, leaving 291 bytes for local variables. Maximum is 2,048 bytes.
Low memory available, stability problems may occur.

***Removing #include SPI.h cured the issue displayed above. Why is this? What can be changed to allow #include SPI.h to be added to my BLE Sketch? Lastly, why so much storage used!?! (Sketch uses 21,854 bytes (67%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,757 bytes (85%) of dynamic memory, leaving 291 bytes for local variables. Maximum is 2,048 bytes.)

> /**************************************************************
>  * Blynk is a platform with iOS and Android apps to control
>  * Arduino, Raspberry Pi and the likes over the Internet.
>  * You can easily build graphic interfaces for all your
>  * projects by simply dragging and dropping widgets.
>  *
>  *   Downloads, docs, tutorials: http://www.blynk.cc
>  *   Blynk community:            http://community.blynk.cc
>  *   Social networks:            http://www.fb.com/blynkapp
>  *                               http://twitter.com/blynk_app
>  *
>  * Blynk library is licensed under MIT license
>  * This example code is in public domain.
>  *
>  **************************************************************
>  *
>  * This example shows how to use Adafruit Bluefruit LE nRF8001 breakout
>  * to connect your project to Blynk.
>  *
>  * Note: This requires BLEPeripheral library
>  *   from http://librarymanager
>  *   or https://github.com/sandeepmistry/arduino-BLEPeripheral
>  *
>  * NOTE: BLE support is in beta!
>  *
>  **************************************************************/

> //#define BLYNK_DEBUG
> #define BLYNK_PRINT Serial

> #define BLYNK_USE_DIRECT_CONNECT

> #include <BlynkSimpleSerialBLE.h>
> // #include <SPI.h>
> #include <BLEPeripheral.h>
> #include "BLESerial.h"

> // You should get Auth Token in the Blynk App.
> // Go to the Project Settings (nut icon).
> char auth[] = "YourAuthToken";

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

> // Create ble serial instance, see pinouts above
> BLESerial SerialBLE(BLE_REQ, BLE_RDY, BLE_RST);

> void setup() {
>   Serial.begin(9600);

>   SerialBLE.setLocalName("Blynk");
>   SerialBLE.setDeviceName("Blynk");
>   SerialBLE.setAppearance(0x0080);
>   SerialBLE.begin();

>   Blynk.begin(auth, SerialBLE);

>   Serial.println("Waiting for connections...");
> }

> void loop() {
>   SerialBLE.poll();

>   if (SerialBLE) {    // If BLE is connected...
>     Blynk.run();
>   }
> }