Welcome! Log In Create A New Profile

Advanced

Bluetooth HC-05 device not ready error

Posted by jbergman 
Bluetooth HC-05 device not ready error
March 19, 2021 09:05PM
Bluetooth device seems not to init correctly on program run, it acts like a timeout issue. The device does eventually connect as its led beacon changes to a slow(connected) flash rate, but ML 2.2.12 returns a device not ready. So to be clear it is a BT device at 38k baud parity and stop are correct. Arduino is setup with the packaged code from this site. Anywhere else to look? Stumped.
Re: Bluetooth HC-05 device not ready error
March 20, 2021 01:13PM
What do you mean by "the device does eventually connect"? Does it take a long time? It should happen in a second. Is your device far away from your computer's Bluetooth radio?

The "device not ready" message is in the script, but you never see it if the correct sketch (03_Setup.ino) is uploaded. Wasn't there any issue when you executed the previous steps? The RX and TX lines of HC-05 should not be on pins 0 & 1 when the sketch is uploaded.

I updated the manual a little about what LED response should be expected when the connection is established. Please follow the instructions one by one. If something does not go well, just delete the HC-05 module in your computer's Bluetooth device list and start from Step 1 again.
https://monkeylogic.nimh.nih.gov/docs_BluetoothRewardTrigger.html

There are many HC-05 and Arduino applications on the web. Try some of them and see if they work with your devices.
Re: Bluetooth HC-05 device not ready error
March 21, 2021 12:42AM
I'll recheck the board connections as they are on a bread board layout and the ttl wires maybe getting loosely connected. The code from setup loads via usb fine with no errors though. The bluetooth is not actually connected till data is sent via ML serial write, then it connects, that is what seems to be the timeout. I have to bring my logic scope home to verify the status of the hc-05. Working at home. Thanks for the input, it seems each of these HC-05 boards is made a bit differently.
Re: Bluetooth HC-05 device not ready error
March 22, 2021 12:17PM
What you described as timeout sounds normal. The LED on the HC-05 will blink shortly once every two seconds, when it is paired with your computer. Once the pairing is made, just forget about the connection. It will be connected automatically when the serial port is open, whether the LED is blinking once every two seconds or five times a second.

NIMH ML opens the serial port when the RUN button is clicked. So, when you see the pause menu, the LED should be blinking shortly twice every 2 seconds.

If you did everything correctly but saw the device-not-ready error, you might choose a wrong serial port. The way to find the serial port assigned to HC-05 is described in the manual. Do not choose the one assigned to Arduino, if you did not unplug Arduino already for deployment.

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.