Go Down

Topic: HC-05 returns garbage in AT mode (Read 888 times) previous topic - next topic

cider101


Quote
but because i only need 1 serial port (in the project).

Really? Then, why are you not using the one hardware serial port, then?

You are using TWO serial ports - one hardware and one software.

I know i'm using TWO ports in the example - but just because i want to "debug" the BT-Module (or better say - figure out what/which AT commands i need in my real project) - once the debugging session is done, there is no need for a second serial port.
Again, - whats wrong with my code above ? There must be something - otherwise it would work (which it obviously doesnt)


You probably shouldn't be waiting for all n bytes to arrive IN THE BACKGROUND while you sleep for two seconds.  Swserial needs to go through some serious hacks to pretend to have interrupts.   I'm not sure exactly how that works, but...
hmmm... I can/will try that -  I assumed,  the soft-serial is using pin-interrupts since there is code for that...and the example form instructable doesn't do any sleeps...

2ndalpha

Sorry for digging up a old topic but it was the only one I could relate to.
I had exactly the same issue. I was loosing my mind.
Turned out that using a beta version of Arduino IDE is a big no-no.
Probably there is a bug in software serial library.
I was using 1.5.8 beta. When I downgraded to 1.0.6 it worked just fine.
I hope it helps someone in the future.

Go Up