1

Topic: Problem connecting via bluetooth to DFRobot Romeo BLE board

I am using the Romeo BLE 1.0 board that has a CC2540 bluetooth chip (similar to the one used by the HM-10 module) and an ATmega328P microcontroller with Arduino UNO bootloader.

https://www.dfrobot.com/product-1176.html

On the RemoteXY page I configure my project as an Arduino UNO with HM-10 module (since the CC2540 module does not exist) and I create an example of on and off for LED 13. I use the hardware serial port. Later I load said program on the board.

When trying to perform the search from the RemoteXY mobile app (iOS), the bluetooth device "Bluno" is not displayed, which corresponds to said board, which is why I cannot test said example on the board.

It should be noted that from the Bluetooth configuration of my iPhone and from other apps such as Bluetooth terminals I can view and connect perfectly to the Bluno device.

I hope you can help me, thanks.

2

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

The HM-10 firmware is configured so that the module does not require configuration and simply transmits data like a regular serial port.
Most likely, in the Romeo BLE 1.0 board, the CC2540 chip has a different firmware and requires some kind of preliminary configuration in order to transmit data as a serial port.
Can you share an example of sketch that works for you without RemoteXY?

3

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

I've used a basic example of turning LED 13 on and off.

/*
   -- New project --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 3.1.10 or later version 
   download by link http://remotexy.com/en/library/
   To connect using RemoteXY mobile app by link http://remotexy.com/en/download/                   
     - for ANDROID 4.13.1 or later version;
     - for iOS 1.10.1 or later version;
    
   This source code is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.    
*/

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////

// you can enable debug logging to Serial at 115200
//#define REMOTEXY__DEBUGLOG    

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__HARDSERIAL

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 9600



// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 36 bytes
  { 255,1,0,0,0,29,0,17,0,0,0,31,1,106,200,1,1,1,0,2,
  31,47,44,22,0,2,26,31,31,79,78,0,79,70,70,0 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t switch_01; // =1 if switch ON and =0 if OFF

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)
 
/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_SWITCH_01 13


void setup() 
{
  RemoteXY_Init (); 
  
  pinMode (PIN_SWITCH_01, OUTPUT);
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_SWITCH_01, (RemoteXY.switch_01==0)?LOW:HIGH);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 


}

As I said, the code compiles and loads well, but when I try to connect from the RemoteXY app the device does not appear to be able to connect.

4

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

Sorry. I probably didn't explain it correctly.
Please share the example code for the Romeo BLE board that uses bluetooth. So that I can understand how bluetooth rises specifically for this board. And I'll try to give you the RemoteXY code.

5

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

Thank you very much for the clarification.

I am sending you a basic example of serial communication that works perfectly with the Romeo board, as you can see it is the typical example of bidirectional serial communication.

void setup() {
  Serial.begin(115200);  //initial the Serial
}

void loop() {
  if (Serial.available())  {
    Serial.write(Serial.read());//send what has been received
    Serial.println();   //print line feed character
  }
}

I also sent you the wiki page of the board that talks about BLE communication, that example is there.

https://wiki.dfrobot.com/Bluno_SKU_DFR0 … ng_via_BLE

I also attach a program that I wrote to be able to connect said board (mounted on a MiniQ robot) to be controlled from Blynk Legacy (which no longer exists).

// PROGRAMA PARA USO CON ROBOT MINIQ ROMEO
#include <BlynkSimpleSerialBLE.h>

char auth[] = "<codigo autentificacion>";

int E1 = 5;     // Control Velocidad Motor 1
int E2 = 6;     // Control Velocidad Motor 2
int M1 = 4;     // Control Direccion Motor 1
int M2 = 7;     // Control Direccion Motor 2

int v = 100;
int vg = 50;

void setup() { 
  int i;
  for (i = 4; i <= 7; i++)
    pinMode(i, OUTPUT);  
  Serial.begin(115200);
  Blynk.begin(Serial, auth);
}

void loop() {
  Blynk.run();
}

// Utilizado desde blynk para recibir la velocidad desde un Slider
BLYNK_WRITE(V0) {
  v = param.asInt(); 
}

// Utilizado desde blynk para recibir posiciones desde un joystick
BLYNK_WRITE(V1) {
  int x = param[0].asInt();
  int y = param[1].asInt();

  if (x == 128 && y == 128)
    Detener();
    
  if (y > 148 && x > 108 && x < 148)
    Avanzar(v, v);
    
  else if (y < 108 && x > 108 && x < 148)
    Retroceder(v, v);

  if (x < 108 && y < 150)
    Izquierda(vg, vg);

  if (x > 148 && y < 150)
    Derecha(vg, vg);
}

// Utilizado desde blynk para recibir la velocidad de giro desde un Slider
BLYNK_WRITE(V2) {
  vg = param.asInt(); 
}

void Detener() {
  digitalWrite(E1, LOW);   
  digitalWrite(E2, LOW);      
}

void Avanzar(char a, char b) {
  analogWrite (E1, a);
  digitalWrite(M1, HIGH);    
  analogWrite (E2, b);    
  digitalWrite(M2, HIGH);
}

void Retroceder(char a, char b) {
  analogWrite (E1, a);
  digitalWrite(M1, LOW);   
  analogWrite (E2, b);    
  digitalWrite(M2, LOW);
}

void Izquierda(char a, char b) {
  analogWrite (E1, a);
  digitalWrite(M1, LOW);    
  analogWrite (E2, b);    
  digitalWrite(M2, HIGH);
}

void Derecha(char a,char b) {
  analogWrite (E1, a);
  digitalWrite(M1, HIGH);    
  analogWrite (E2, b);    
  digitalWrite(M2, LOW);
}

I hope you can help me, thank you very much.

Excuse my English, I am using a translator, my language is Spanish.

6

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

Fine. I see that the command Serial.begin(115200); called in the setup() function initializes the Bluetooth connection. But the same command can initialize communication with a PC in order to receive information in the terminal log. What is the difference?
Try the following code. This code initializes the Serial in the setup() function.

#include <RemoteXY.h>


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,1,0,27,0,10,13,2,
  1,0,9,9,46,46,6,7,50,50,
  2,31,88,0,65,4,62,16,31,31,
  14,62,35,35 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t button_1; // =1 if button pressed, else =0 

    // output variables
  uint8_t led_1_r; // =0..255 LED Red brightness 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)



/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////


CRemoteXY *remotexy;

void setup() 
{

  Serial.begin(115200);
  remotexy = new CRemoteXY (
    RemoteXY_CONF_PROGMEM, 
    &RemoteXY, 
    &Serial
  ); 
  
  
  // TODO you setup code
  
}

void loop()        
{ 
  remotexy->handler ();
  
  if (RemoteXY.button_1)  RemoteXY.led_1_r = 255;
  else RemoteXY.led_1_r = 0;
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay() 


}

7

Re: Problem connecting via bluetooth to DFRobot Romeo BLE board

I tried the code that you sent me and I have the same problem that I had initially, that the bluetooth device does not appear so I can connect through the RemoteXY app. Attached image.


https://i.ibb.co/N6T1XkB/Foto.png


This link explains how Bluetooth communication works with Romeo plates. It might be of some use.

https://wiki.dfrobot.com/Bluno_SKU_DFR0 … ng_via_BLE