How to get the Bluetooth module working (JYMCU...)?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
rankor
Posts: 38
Joined: Sun Nov 30, 2014 12:38 am

How to get the Bluetooth module working (JYMCU...)?

Post by rankor » Sun Nov 30, 2014 1:05 am

Anyone using the JYMCU bluetooth module?
How did you get going?

I can't find any instructions for Micropython for it. I connected it to Y9/19 and VCC and GND.
Can I communicate with it via UART just to see if I get contact so it is correctly mounted?

I have an Android phone and a PC to pair with later. What do I need to do to initialize the device? Should another bluetooth device find it if it is powered so they can pair? Or do I have to do something more first?

User avatar
dhylands
Posts: 3011
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: How to get the Bluetooth module working (JYMCU...)?

Post by dhylands » Sun Nov 30, 2014 5:22 pm

My understanding of how its supposed to work is that once its paired with a host, you should get a serial port showing up on the host, and data written to the serial port on the host shows up on Tx line on the bluetooth module. And any UART data written to the Bluetooth module will show up on the host.

You'll need to connect the TX line on the bluetooth module to an RX line of a UART on the pyboard, and the RX line of the bluetooth module to a TX line of a UART on the pyboard.


User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

Re: How to get the Bluetooth module working (JYMCU...)?

Post by gcarver » Mon Dec 01, 2014 5:23 am

I got this working quite easily. I wrote a small wrapper for it to automate the AT commands for setting some properties such as baud rate and name. It's located here; https://github.com/GuyCarver/MicroPytho ... b/JYMCU.py
End of line...

rankor
Posts: 38
Joined: Sun Nov 30, 2014 12:38 am

Re: How to get the Bluetooth module working (JYMCU...)?

Post by rankor » Tue Dec 02, 2014 11:07 pm

I cannot use those commands. I can only use send and recv.

I try to do:

uart=UART(3,9600) #Y9,Y10 => uart3
uart.send("AT")
no response
uart.send("AT+PIN5678")
no change of pin, can still pair with old.

So I can pair my android with the device and it blinks red but I cannot send commands successfully to it.

User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

Re: How to get the Bluetooth module working (JYMCU...)?

Post by gcarver » Wed Dec 03, 2014 7:15 pm

I found responses to AT command for my module to be fickle. I find the best way to get it to respond to AT commands is to connect my computer to it, then disconnect. The connection LED must be flashing in order to accept AT commands so you must disconnect.
End of line...

rankor
Posts: 38
Joined: Sun Nov 30, 2014 12:38 am

Re: How to get the Bluetooth module working (JYMCU...)?

Post by rankor » Thu Dec 04, 2014 9:15 pm

OK and how did you thn proceed to make the actual Bluetooth communication work?

I have an Android phone and a PC with Ubuntu. I can pair my Android phone to the JYMCU but have not managed to get around how to work with Bluetooth on Ubuntu.


So what is the best approach to get Bluetooth working? After pairing, what is the easiest way to send some data back and forth? I have to create some sort of application level protocol right?
Is there some simple way to just send data?

User avatar
gcarver
Posts: 34
Joined: Sun Oct 26, 2014 4:07 am
Location: New Market, Maryland
Contact:

Re: How to get the Bluetooth module working (JYMCU...)?

Post by gcarver » Fri Dec 05, 2014 7:54 pm

Sorry, I cannot help you. I am on a PC. I use Putty to open a serial connection on the com port windows assigned to the bluetooth connection.
End of line...

Turbinenreiter
Posts: 276
Joined: Sun May 04, 2014 8:54 am

Re: How to get the Bluetooth module working (JYMCU...)?

Post by Turbinenreiter » Fri Dec 05, 2014 8:47 pm

Have you tried clicking my link and reading it?

http://wiki.micropython.org/official-ac ... odule-HC05

rankor
Posts: 38
Joined: Sun Nov 30, 2014 12:38 am

Re: How to get the Bluetooth module working (JYMCU...)?

Post by rankor » Fri Dec 05, 2014 10:04 pm

Yes, I cannot get Bluetooth to work on Ubuntu. I know I have the hardware because I had Windows before and that worked fine.

hcitool scan gives me:
No such device.

Post Reply