1

Topic: Registering HM-10 on iOS app

Hi

I am using "RemoteXY for iOS" for a simple project to communicate with a relay via HM-10 bluetooth module (DX-BT05).

When I tried to add a new device via the app I can see my module is there but when I hit to connect it the app is trying to "Register" the module but return an error as "Device not reply".

Can someone help me to sort this issue please?

My bluetooth module appear under the connected devices in the iPhone iOS 12.0

Many thanks

2

Re: Registering HM-10 on iOS app

Trilobite wrote:

Hi

I am using "RemoteXY for iOS" for a simple project to communicate with a relay via HM-10 bluetooth module (DX-BT05).

When I tried to add a new device via the app I can see my module is there but when I hit to connect it the app is trying to "Register" the module but return an error as "Device not reply".

Can someone help me to sort this issue please?

My bluetooth module appear under the connected devices in the iPhone iOS 12.0

Many thanks

You have to have a running sketch on your micro....

"Registering" is when the app is trying to receive the configuration data from your controller sketch.

Have you got all the required stuff in it  .....

The Configuration Block - copy/paste this from the editor "Get Source Code"
A RemoteXY_Init() statement in void setup()
A RemoteXY_Handler() statement in void loop()

Have you got the Serial port setup correctly in your sketch, and have you "started" it ?

What comms are you using to talk to the HM-10, Hard Serial, or SoftSerial ?

Post your code (all of it, inside

 

tags), ans "Share" your RemoteXY project.

2B, or not 2B, that is the pencil ...

3

Re: Registering HM-10 on iOS app

Daba wrote:
Trilobite wrote:

Hi

I am using "RemoteXY for iOS" for a simple project to communicate with a relay via HM-10 bluetooth module (DX-BT05).

When I tried to add a new device via the app I can see my module is there but when I hit to connect it the app is trying to "Register" the module but return an error as "Device not reply".

Can someone help me to sort this issue please?

My bluetooth module appear under the connected devices in the iPhone iOS 12.0

Many thanks

You have to have a running sketch on your micro....

"Registering" is when the app is trying to receive the configuration data from your controller sketch.

Have you got all the required stuff in it  .....

The Configuration Block - copy/paste this from the editor "Get Source Code"
A RemoteXY_Init() statement in void setup()
A RemoteXY_Handler() statement in void loop()

Have you got the Serial port setup correctly in your sketch, and have you "started" it ?

What comms are you using to talk to the HM-10, Hard Serial, or SoftSerial ?

Post your code (all of it, inside

 

tags), ans "Share" your RemoteXY project.


Thank you for the reply. Please bear with me if I sounds like I dont know what I am talking about. This is my very first project.

I managed to upload the sketch to the Nano. So, I think that answers your query whether I have a running sketch on my micro.

I completed the circuit with all the other pieces and I can see the BLE module's LED stop blinking and stay solid when it connect with my iPhone (as a bluetooth device).

Please see below for the Configuration block (I think that's what it is)

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

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer


}

I am not sure whether the Serial port setup correctly or started it properly. So, I'll copy the full sketch below.

/*
   -- New project --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.3.3 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.1.1 or later version;
     - for iOS 1.2.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          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,13,0,8,13,0,
  1,0,42,26,12,12,2,31,88,0 };
  
// this structure defines all the variables of your control interface 
struct {

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

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

} RemoteXY;
#pragma pack(pop)

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

#define PIN_BUTTON_1 13


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

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer


}

I am using a SoftSerial.

I am using macOS High Sierra to upload my Sketch and I successfully installed the drivers for the nano board and managed to upload the sketch at the end.

4

Re: Registering HM-10 on iOS app

You haven't created a SoftwareSerial "instance" for your interface...

Before your void setup(); you need ...

SoftwareSerial MySerial(REMOTEXY_SERIAL_RX, REMOTEXY_SERIAL_TX);   //init the serial protocol, define the RX and TX pins

That creates the instance "MySerial" (can be any name), using pins defined in the RemoteXY configurate....

You also need to start the softserial comms and specify the Baud rate...  inside void setup(); you need ...

MySerial.begin(REMOTEXY_SERIAL_SPEED);

Try that and see if that helps....

2B, or not 2B, that is the pencil ...

5

Re: Registering HM-10 on iOS app

Hi Daba

Thank you for the very quick response.

I made the changes to my sketch and uploaded it to the Nano board but no luck. Still having the same error when trying to register with RemoteXY app.

Could you please look at the sketch below and let me know if there's anything else I could do?

/*
   -- New project --
   
   This source code of graphical user interface 
   has been generated automatically by RemoteXY editor.
   To compile this code using RemoteXY library 2.3.3 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.1.1 or later version;
     - for iOS 1.2.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          //
//////////////////////////////////////////////

// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__SOFTSERIAL
#include <SoftwareSerial.h>

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_SERIAL_RX 2
#define REMOTEXY_SERIAL_TX 3
#define REMOTEXY_SERIAL_SPEED 9600


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,1,0,0,0,13,0,8,13,0,
  1,0,42,26,12,12,2,31,88,0 };
  
// this structure defines all the variables of your control interface 
struct {

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

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

} RemoteXY;
#pragma pack(pop)

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

#define PIN_BUTTON_1 13

SoftwareSerial MySerial(REMOTEXY_SERIAL_RX, REMOTEXY_SERIAL_TX);   //init the serial protocol, define the RX and TX pins

void setup() 
{
  MySerial.begin(REMOTEXY_SERIAL_SPEED);
  RemoteXY_Init (); 
  
  pinMode (PIN_BUTTON_1, OUTPUT);
  
  // TODO you setup code
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_BUTTON_1, (RemoteXY.button_1==0)?LOW:HIGH);
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer


}

6 (edited by Daba 2018-10-11 09:56:03)

Re: Registering HM-10 on iOS app

That code works just fine, unaltered ..... https://www.dropbox.com/s/sahdbkj2gyin7 … 7.mov?dl=0

How are you connecting the HM-10 to the arduino pins 2 & 3 ?

The HM-10 uses 3.3V level signals, the Arduino uses 5V.  You can safely connect the HM-10 Tx pin directly to the Nano's Rx pin 2, but the Nano's Tx pin 3 should go via a logic level converter (or a voltage divider : Nano_TX : 1K : HM-10_RX : 2K : GND) to the HM-10 Rx pin


Check your HM-10 configuration using this sketch....

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3);  // Rx, Tx

void setup() {
  Serial.begin(9600);  
  BTSerial.begin(9600);
  while(!Serial);
  Serial.println("AT Commands: okay ");
}

void loop() {
  // read from the HM-10 and print to Serial
  if(BTSerial.available())
    Serial.write(BTSerial.read());

  //read from serial and write to the HM-10
  if(Serial.available())
    BTSerial.write(Serial.read());
}

Using the serial monitor screen, set to "Both NL & CR", and "9600 baud"

You should see "AT Commands: okay"

If you don't, try different baud rates on the serial monitor until you do.  It might be that the HM-10 has been configured at a different baud rate.

If you find a baud rate that works, you can either modify the "Interface" section of your RemoteXY app to match, or reset it to 9600 with the AT command "AT+BAUD4", It should respond with "+BAUD=9600", then "OK" on next line.

2B, or not 2B, that is the pencil ...

7 (edited by teleworm 2018-11-10 06:33:43)

Re: Registering HM-10 on iOS app

Thanks for the information. Recently I update my IOS operating system on my Macbook and I have faced an issue on my iTunes account that is iTunes error 1671 and I am looking for the support if anyone has any idea then please suggest me.