SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By bennyboyhead
#191817
Hi, Everyone!

I'm having trouble sending sketches through HC-05 bluetooth adapters. One of them is connected to a Sparkfun Thing Dev ESP8266 Wifi board, and the other is connected to an Arduino Pro Mini. I could really use some help determining what's wrong with my setup or if I have defective adapters.

First off, both the Pro Mini and Thing Dev take sketches just fine over a USB to Serial FTDI adapter. It's only when I try to go wireless that I have trouble.

Starting with the Pro Mini connection, I've narrowed the problem on this one to a STATE/RST/GRN pin issue. I can get the sketch to load if I manually press the reset button on the Pro Mini as soon as the sketch starts to upload over bluetooth, so I know the TX and RX are working. But the HC-05 doesn't seem to pulse anything to trigger the reset automatically. It's set for AT+Polar=1,0. Changing that to =1,1 doesn't make a difference. I tried a 10uF capacitor wired in series between STATE and RST/GRN, but that also changed nothing. Any other ideas?
Connections are:
TX to RX
Rx to TX
STATE to GRN
VCC to 5+ from power supply
GND to GND

I doubt this helps, but the vague error I get is:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00


Now, the Sparkfun Thing Dev (ESP 8266 Wifi board) connected to another HC-05 returns a different error:

esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from /dev/tty.usbserial to /dev/cu.TCloudThing-DevB
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
opening port /dev/cu.TCloudThing-DevB at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed


And as soon as the upload fails, the HC-05 resets the Thing Dev. I'm not sure if it's supposed to reset at that point or earlier? I found that it doesn't reset at all if I disconnect the STATE pin, so at least I know it's doing something here. Also, manually pushing a reset button doesn't allow the signal to go through like it does with the Pro Mni above. This leads me to believe that the problem lies with the comm lines RX and TX between the Thing Dev and the HC-05. I have this HC-05 set to at+uart=115200,0,0. 115200, I believe is the standard baud rate for the Thing Dev. And at+polar=1,0
Connections are:
RX to TX
TX to RX
STATE to RST
GND to GND
VCC to VIN

Any ideas on what to try next would be much appreciated.
By bennyboyhead
#191847
Well, after far too many hours of struggle, I figured out what was wrong with the Pro Mini connection. It was actually due to two issues.
1. The HC-05 adapter I was using with the Arduino had a defective STATE pin.
2. I skipped the GRN pin on the end of the Pro Mini, and instead connected the STATE pin of a working HC-05 to the RST pin with a capacitor. The capacitor is definitely necessary, though I'm not sure if the 10uF capacity is significant. That's just the size I had sitting around. The GRN pin would only reset if I manually pulled it high and then low in alternating fashion--very strange. Perhaps that's due to some kind of auto-reset circuit.
Anyway, now I can reliably upload sketches over bluetooth to my Pro Mini. Yay.

I gave up on adding a bluetooth serial connection to the Sparkfun Thing Dev. Further reading led me to conclude that the reset function on that board works differently than the Pro Mini?...possibly requiring some connection to PIO0, but Sparkfun has no helpful documentation on it. I'll table it until somebody here with more experience chimes in.