Trying to connect a particle photon via a JDY 08 BLE bluetooth module to my Blynk

Hello everyone. I am having a similar problem and im hoping some one might shed some light on the matter.
I am trying to connect a particle photon via a JDY 08 BLE bluetooth module to my Blynk application. The BLE widget on Blynk is recognizing my BLE module but is stuck on 'Connecting…" i have verified that all permissions for Blynk have been granted, my Blynk app is setup for the BLE communication option and my mobile device (tested on a Samsung Note 4 and Tab A 2017) is able to communicate with the module using other applications so i know my mobile device is compatible with BLE. This BLE module does not appear on the list of BLE devices but this module is a clone of the HM10 BLE module and since that is one of the modules compatible with Blynk, it stands to reason that that should not be an issue. Please advise.

It is possible to make it working, but currently we do not provide any examples out of the box.
You’ll have to dig into how this is working on regular Arduino, and then adjust the relevant files in the Particle Blynk library.

In order to test if your hardware is connected the right way, you can use following HM-10 test program. It will check the connections, check the baudrate, show all kinds of information about the BLE module and set the notification OFF. Do not use the original code by JP Liew because this sets the notification ON.

I guess that, for running it on Particle Photon, you’ll have to define the connection like this:

#define SERIAL_BLE Serial1

and uncomment the SoftwareSerial stuff.

Once you are sure about the hardware connections, run following AT commands (by changing the code of the test program above, I am not sure about the question mark):

AT+SVRUUID?
AT+CHRUUID?

In order to be compatible with HM10 (so that the Blynk BLE widget can see it), the service UUID should be FFE0, the characteristic UUID should be FFE1. These are the default values for JDY-08.

1 Like

Thank you for your reply.
The module does not respond to those commands in fact it does not respond to many commands except changing the name of the module (AT+NAME) and requesting the software version. I was using an arduino (since the photon does not have a serial monitor) and the following sketch*, which i suspect maybe an issue but i do not think it is the problem completely, to test the BLE module. I was planning to flash hm-10 firmware and than see how the module performs using the following link

https://forum.arduino.cc/index.php?topic=393655.0

But i will first try the sketch you referred to above and test the module this way. Thank you for your assistance. Will let you know what i find.

SKETCH*:
#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // CONNECT BT RX PIN TO ARDUINO 11 PIN | CONNECT BT TX PIN TO ARDUINO 10 PIN

void setup()
{
Serial.begin(9600);
Serial.println(“Enter AT commands:”);
BTSerial.begin(115200); // JDY08 default speed in AT command mode
}

void loop()
{

// Keep reading from JDY 08 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());

// Keep reading from Arduino Serial Monitor and send to JDY 08
if (Serial.available())
BTSerial.write(Serial.read());
}

@federicobusero
I have connected the BLE card according to the requirement above pin 10 to Tx and pin 11 to Rx and the result showing on the signal monitor is attached.
For some reason the BLE is not being picked up. I am not sure what the problem is. My only other option is to flash the hm-10 firmware onto the device. Is there anything else that can be done

Hi,

As I don’t have such a module, it is difficult to help you. You can google around and find

  • all AT commands should not end with ‘new line’.
  • maybe the standard “AT” command is not implemented. So maybe you need the command AT+GETSTAT instead of AT in BLEIsReady
  • Remark that the default baud rate of the module is 115200. So you can set it hardcoded instead of

baudrate = BLEAutoBaud();

  • Have a look at following list of AT commands
    https://github.com/kichMan/JDY-08

  • it seems you need to ground some pin for AT commands or so

  • Have a look at http://westsideelectronics.com/arduino-android-data-streaming-jdy-08/

  • Remark that 115200 is too high for Blynk. It needs to be reduced to 38400 or 19200, you have to use AT+BOUD… (remark the spelling mistake)

  • Once you have some communication, you can see what’s happening when you start up Blynk. I am wondering what they mean with “serial data send need “/r/n”” If this means that you cannot send pure bytes streams, then Blynk will not be possible using this firmware.

1 Like

@federicobusero @vshymanskyy
Thank you gentleman for your assistance.
I managed to get the module to connect to Blynk thank you. However an issue im facing now is that when i flash new software to my photon or remove and restore power to the photon, the BLE module disconnects from the Blynk app momentarily (as it should) but does not automatically reconnect successfully. It displays what appears to be the mac address of the module (see attached) until i manually disconnect and reconnect the module in the Blynk app to restore its connection. When i used a HC-05, using Bluetooth classic, i did not have this issue. I am not sure if its a problem related to my ble module or is an issue on Blynk’s side.

@vshymanskyy @federicobusero

I am having a difficult time finding a solution to address the issue i mentioned above. I purchased a JDY 09 for comparison and the issue still persists. Is this than an issue with Blynk BLE communication ?

This is indeed something that happens when developping using a BLE module, also other BLE modules. The problem is that the module doesn’t close the connection, so the app doesn’t know that the connection has gone. I assume you are working on Android (on iOS there seems to be a bug in the app). On my Android phone, the connection also closes when I switch off and on the screen. Or by closing the app and opening it again. This way you don’t need to connect/disconnect each time in the app.
This issue is of course only a problem during development, a user will not flash new firmware. In a user setup, the connection can drop and pop up again, but then the app will reconnect automatically after some seconds (10?).

If you are looking for another solution, you can try a hardware switch (to power off the BLE module during firmware upload). Another possibility is a software solution where you reset the BLE module at startup. I saw the command AT+RST but you might need an extra software controlled digital output for switching between AT-command mode and data exchange mode.

You say that you finally got it working. It would be interesting to share you findings with the Blynk community

  • Does the module respond on a standard “AT” with “Ok” ?
  • Did you have to ground/pull up some pin? Do you need hardware changes to switch between AT-command mode and data exchange mode?
  • Do you have to send AT+HOSTEN0 in your setup of Blynk?
  • Did you use 3.3V or 5V power to your module?
  • Which data pins did you use? Do you use SoftwareSerial or Serial1. Remark that on Particle Photon, I guess you have Serial1, which is really better then using SoftwareSerial to avoid bytes being lost
  • Did you need to change the baud rate?

@federicobusero

Thank you Federicobusero.
To answer some of your questions.

Does the module respond on a standard “AT” with “Ok” ?

It does not. It does reply to some questions such as AT+NAME

Did you have to ground/pull up some pin? Do you need hardware changes to switch between AT-command mode and data exchange mode?

No i do not have a ground/pull up to any pins. No hardware changes

Do you have to send AT+HOSTEN0 in your setup of Blynk?

No

Did you use 3.3V or 5V power to your module?

I used 3.3V since this was the rated voltage of the module.

Which data pins did you use? Do you use SoftwareSerial or Serial1. Remark that on Particle Photon, I guess you have Serial1, which is really better then using SoftwareSerial to avoid bytes being lost
I used Serial1

Did you need to change the baud rate?

Yes i had to change it to be able to view the data on the serial monitor. On default this module communicates with a baud rate of 115200