1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

JDY-10 Bluetooth BLE Uart Transceiver Module

Discussion in 'Microcontrollers' started by ACharnley, Oct 13, 2017.

  1. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    I couldn't find anything on Google so to save others the time required to find out anything decent about this small module I'm creating this thread which will be indexed by Google.

    STATUS: THIS MODULE IS WORKING (with issues)

    The JDY-10 uses the TLSR8266 chip which has an impressive specification and low power requirements. It's currently the cheapest BLE module on Aliexpress. As with all these various modules, key lies in the quality of the firmware.

    Eventually I found a Chinese datasheet which I've attached. Google will do a pretty good translate of it. You can use the URL to find a store which reveals the company name and then google that for the company URL. The price/unit is $0.99 direct.

    The chip runs at a default baud of 115,200. There is an AT+BAUD command to change it. I wish they'd used 9,600 as 115.2k isn't available with PIC MCU RC oscillator's running at 8MHz.

    You can change the BLE exposed name but the last character is always missed off, so add a random character.

    On boot it prints "Star...".

    To force command mode (in case of active connection) the pin B0 (according to the datasheet) must be grounded.

    There is a sleep mode (two states) but they doesn't work. It appears to be part implemented in that the commands work (and pin to "wake" it up) however in "sleep" mode the Bluetooth is still active and accepting a connection. UART still works and the LED outputs continue output. Since the device consumes ~10mA I worked around this by driving the device directly from a MCU pin.

    I had the key parts related to pin B0 translated and I've included them below.

    µÍµçÆœ AT ģʜ,ĬÈÏžßµçÆœ
    AT mode of Low level is default high level

    ŽËÒýœÅÔÚÒÑÁ¬œÓÇé¿öϲ»ÐèÒª·¢ AT ÖžÁîµÄ»°, ¿ÉÒÔ²»
    ÓùÜ,Ðü¿ÕŸÍÐÐ
    The pins can be ignored and suspended if there is no required to send the AT command under the connected condition.

    µ±ÒªÇóÔÚÁ¬œÓµÄ׎̬·¢ AT ÖžÁîʱ,ŸÍœ« B0 ÒýœÅ±£³Ö
    µÍµçÆœ,ŸÍœøÈë AT ģʜ,Óû§ŽËʱŸÍ¿ÉÒÔ·¢ËÍ AT Öž
    Áî,Òª·¢ÍžŽ«ÊýŸÝʱŸÍœ« B0 ±£³ÖžßµçÆœ,ŸÍÁ¢ŒŽœøÈë
    ÍžŽ«Ä£Êœ
    When it require sending the AT command in the state of the connection,
    then just keep low level for the B0 pin, it enters the AT mode,and the users can send AT command at this time.
    When it require to send passthrough data,then keep the B0 maintain a high level,
    then it will immediately into passthrough mode.


    ÊÇ·ñÔÚÎŽÁ¬œÓµÄÇé¿öÏ·¢ AT ÖžÁîÐèÒªœ« B0 ±£³ÖµÍµç
    Ɯ ?
    Does it need to keep the BO low level if we want to send the AT command at the state of unconnected?


    Žð:²»ÐèÒª,Ä£¿éÔÚÎŽÁ¬œÓµÄ׎̬ÏŸÍÊÇ AT ģʜ,ÓÃ
    »§²»ÐèÔÚÒÑÁ¬œÓÇé¿öÏ·¢ËÍ AT ÖžÁî ,B0 ÒýœÅ¿ÉÒÔÐü
    ¿Õ

    Answer: no, the module is AT mode in an unconnected state.
    B0 pins can be suspended if the user does not need to send the AT instruction under the connected condition.

    ATÖžÁî¿ØÖÆÒýœÅ
    Á¬œÓ׎̬Ï£ºµÍµçÆœATģʜ
    ÍžŽ«Ê±£ºÐèÒªÀžß
    ŽËÒýœÅÈçÓò»ÉÏ£¬¿ÉÐü¿Õ

    AT command control the pins
    Under connected condition:low level AT mode
    Passthough condition:need draw high
    The pins can be suspended if it do not be used.
     

    Attached Files:

    Last edited: Jun 30, 2018
    • Thanks Thanks x 1
  2. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    Hi, thanks for the info. I bought a module like this. It reports its Bluetooth name as JDY-10-V2.4 on my Android device. I tried to pair with it but it will not pair. I read that giving it an AT command of AT+TYPE3, or something like that it was, and rebooting it will make it able to pair with Android. I am having trouble getting a terminal session running with it. Can you confirm the procedure to get a terminal session running with it ? I have a USB to Serial adapter connected to the RX and TX pins of the module. I tried the screen terminal under linux, and the Arduino serial terminals to communicate with it but get no response. Could you confirm the baud rate line endings, caps no caps etc... and anything I might be missing ?
     
  3. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    I made mine work and I wish I'd wrote it down as I'll have to repeat it at some stage. The pdf I attached previously was wrong so I've attached the correct one.

    Make sure the red +V from your serial adapter is not connected, usually they are 5v and will fry the chip.

    As I recall (and don't quote me) the B0 pin must be pulled low (or high?) to enter AT mode otherwise none of the commands will work. AT+TYPE is only for the JDY-08 which supports master. The JDY-10 is slave only.

    First you have to understand how BLE works, it doesn't pair automatically like normal bluetooth but is done by an App. This is because BLE doesn't have any protocols so is OS useless.

    Instead there are ID's and best practices of which corresponds to services;

    https://www.bluetooth.com/specifications/gatt/services

    A service has characteristics and these can be shared between services.

    https://www.bluetooth.com/specifications/gatt/characteristics

    Try using Linux and hcitool/gattool to connect that way. There is a characteristic which references the data connection and it's half duplex which is where the fun of writing your own protocol begins. This is where my knowledge is fuzzy but I recall using gattool to read the ID. There's some sort of read/push feature which automatically prints incoming data to the terminal, this is what you want.

    https://www.jaredwolff.com/blog/get-started-with-bluetooth-low-energy/

    I also used cutecom for the modem terminal. Use 115200 and find your adapter under /dev/ttyUSBx. You need to configure it to send CR+LF characters upon <enter>. This is much better than JDY-08's stupid delay=send. Sometimes with the USB adapters can't tell which is RX or TX. RX has to go to TX on the BLE module.

    Using these two I managed to get data going between the two. I think it can only send one character/byte at a time but I honestly can't remember and might be making that up. At the point at which I knew I could get data going between them I committed to using it in my PCB. That's how much hassle I had with other units and how desperate I'd become.

    BTW look at the B0 pin. By default the unit is in transparent mode (or not?) and it works to disable all the AT commands. The only one I needed was AT+NAME and I got it working. Note it has a stupid bug, the last character is omitted so to change the name to "Dog" you need to do AT+NAME=Dogx (maybe the = is not required I can't remember). I've connected this pin to my MCU so I'm pretty sure it's critical.

    I'll be knee deep in JDY-10 in a few weeks time as my prototypes are back from the fab then and the programming fun begins.
     

    Attached Files:

    Last edited: Dec 11, 2017
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    Thanks for your helpful response.

    Looks like my initial setup was actually correct. Problem was this module does not respond to AT with OK. It just does not respond... It will respond with OK to other things like setting the name which is done with AT+NAME YourName. Or give version info AT+VER etc. This is the first time I work with any modem or any at command mode device which does not respond to AT or AT+ with OK so I thought my setup was wrong. FIY I can confirm that this module will accept ( in the unconnected state ) AT commands regardless of the state of B0. Looks like, according to the datasheet, the state of B0 is only relevant when in the connected state. Low to accept AT commands. Which would explain why you have it brought in your design...

    BTW My module did not cut off the last letter of the name when setting it. It just works as expected. V2.4.
     
  6. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    Probably there's two V2.4 versions, it's Chinese after all. :)

    Most AT commands don't work, it's much simpler than JDY-08 due to lack of master mode. It sounds like once you make it connect you should be able to get some data flow going.
     
  7. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    This is baffling me. I use the Arduino IDE serial monitor to send this module AT commands without a problem. When trying to use cutecom it does not seem to work. I have the cutecom settings on the correct device name ( it will connect ). Baud is correct at 115200. 8N1 Parity none. Handshake off. I think I tried it on "on" also without success. I set it to CR, LF line end. Char delay 1ms. It should work no ? Can you confirm the cutecom settings ?
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    Char delay 0ms. Everything else is correct. I have Hex Output box ticked but shouldn't matter.

    If that doesn't work try swapping the RX/TX wire. Also ensure the 5v red from your reader is not connected, the 5v will crash it.
     
  10. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    Ok now it works at 0ms delay. Ty. I noticed an "interesting" thing about my module. I did an AT+DEFAULT, the command to reset the whole thing. And now the name became
    JDY-10-V2.1 which previously was JDY-10-V2.4 . AT+VER reports +JDY-10-V2.4 . So now I have a hybrid. ( Kidding ) Its so all Chinese.
     
  11. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    I managed to get full two way serial communications going with this device in transparent mode. Communications between an Android app and my linux laptop. Great so I can use it. However, can you perhaps shed some light on something ? I would like to be able to set any of the GPIO pins from my Android app. I read in the datasheet:
    "pin 2 E5 IO5 Output IO pin can be controlled by APP level. "

    I just want to turn on and off an LED.
    There is no indication in the datasheet as to how to do this. The datasheet talks about an Android test app called JDY-LED but this program is nowhere to be found.

    I guess first thing would be to put it in the LED mode the datasheet is talking about: "AT+CLSS A0: transparent mode
    B1: LED light mode"

    Then I'm not sure. I guess one should then write data to a characteristic after connecting to a service. But what data ? The actual real HM1x modules have AT instructions to control PIO pins. This module has no such AT instructions mentioned in the datasheet. Besides, this module will not accept AT instructions directly from the Bluetooth interface radio input it wants the AT commands always via the onboard rx and tx pins. So an AT command is not going to be what I want. I'd love to be able to use just this tiny thing to control things with a minimum of hardware.
     
  12. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    JDY-10-V2.4手册/JDY-BLE-SDK-V1.4/其它源码/IO_CTRL/ ?

    I'm not using any IO's and haven't played with setting them sorry.
     
  13. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    Was that a link or part of a link or something you left ? I did a search for those terms, Google yields nothing appropriate. Baidu.com gave me a trace to JDY-BLE-SDK-V1.3 which I finally downloaded. But is there a V1.4 ? Where ?
     
  14. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    It's a folder I have. PM me your email and I'll send it across.
     
  15. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    Hi, I opened up a conversation with you, did you get it ?
     
  16. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    Let me know if it helped. I tied one of the led outputs (STAT / ADV_LED) into my MCU and need to release one for another task. Have you played with them? Basically I'll need to know if a device is connected.

    I need to automate a check of the device name, change if necessary and the connected client can't interrupt during this time. Probably B0 disables transparent mode but I could be wrong.
     
  17. eternity

    eternity New Member

    Joined:
    Dec 11, 2017
    Messages:
    8
    Likes:
    0
    I have not played with the GPIO pins yet. I have only used this device in transparent mode which is the default. B0 can disable/enable AT command mode for when the device's radio is connected. I am not aware of any other function or effect. The device will always accept AT commands on its RX and TX regardless of the state of B0 if the radio is not connected. But if it is connected then B0 must be used to enable or disable AT command mode. Not sure how you would go about checking if a device is connected. One way that comes to mind is to do a comms test.
     
  18. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    That's how I understand it. A comms test assumes the connected device understands the command/protocol. I'm thinking one of the LED outputs tied into the MCU will do it.

    Not sure which one though!
     
  19. toni.zul

    toni.zul Member

    Joined:
    Jan 20, 2018
    Messages:
    47
    Likes:
    0
    try using hc-05 moule
     
  20. ACharnley

    ACharnley Member

    Joined:
    Oct 25, 2015
    Messages:
    303
    Likes:
    1
    That's not BLE Toni.

    I'm using the JDY-10 in my application now and it's working ok. I've updated the top post to include some pointers to issues (sleep especially).
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice