Hi, first off, thanks for this wonderful software. I'm using it on several astrophotography setups and it works VERY well.
In my latest build, I'm trying to implement bluetooth and am having some connection issues. I'm using an HC-05 module and an appropriate firmware with bluetooth support.
When the myFocuserPro2 software connects, it initially works, then at a seemingly random place times out waiting a response from the arduino. However it never gets to the point of being able to control a motor. It's always in the initial setup that it times out.
I've set the seiral timeout to maximum at 30 seconds and the connection timeout to 10 seconds.
It times out at a different command every time it's run, sometimes it makes it pretty far, some times it times out as early as the second read.
When it times out, I can watch the red light on the bluetooth module go from solid red (connected) to blinking red (not connected).
Now here is the odd part. If I connect to the same serial port via putty, I can happily send commands to the focuser at will, forever, and it always responds. :02#, :08#, :00#, etc... always works, and always comes back with a response immediately.
Following is a typical run in the log file showing the disconnection.
I tried a different power source thinking that was the problem. No luck, same issue. I can swap over to the COM port for the Arduino Nano that this is running on, and everything works well.
Hi James
We do not recommend running serial port at 115200. Bluetooth is fine at 9600. The software serial library that implements the interface with the BT adapter wont handle that reliably at all. The limitation is in the library.
I need to know
what arduino firmware file?
Did you make any changes to file?
This is so I can check file to see if there is any issue with code. It is not obvious from the logfile.
Cheers
Robert
The logfile shows
Try to write command: :08#
This is call to get MaxSteps
Answer it got was 0
This is an invalid value for maxsteps
Are you sure you set this correctly in the controller?
So I suggest test this manually without app.
I would suggest start arduino IDE and connect to controller using serial monitor window
send
:0732182#
to the controller
next send
:08#
to the controller - it should respond with M32182#
But I recommend you use 9600 and I suspect it will burst into life.
I am also hoping you did not change the pin numbers for the BT connection - only certain pins can be used. This is just as crucial.
Last edit: brownrb 2017-11-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Robert,
Thank you! That did it. 115200 was the default for my HC-06 bluetooth module, that's why I changed the baud rate. I had to use AT commands to set the HC-06 back down to 9600, but when I did that everything started working perfectly.
Thanks again!
-Jim
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, first off, thanks for this wonderful software. I'm using it on several astrophotography setups and it works VERY well.
In my latest build, I'm trying to implement bluetooth and am having some connection issues. I'm using an HC-05 module and an appropriate firmware with bluetooth support.
When the myFocuserPro2 software connects, it initially works, then at a seemingly random place times out waiting a response from the arduino. However it never gets to the point of being able to control a motor. It's always in the initial setup that it times out.
I've set the seiral timeout to maximum at 30 seconds and the connection timeout to 10 seconds.
It times out at a different command every time it's run, sometimes it makes it pretty far, some times it times out as early as the second read.
When it times out, I can watch the red light on the bluetooth module go from solid red (connected) to blinking red (not connected).
Now here is the odd part. If I connect to the same serial port via putty, I can happily send commands to the focuser at will, forever, and it always responds. :02#, :08#, :00#, etc... always works, and always comes back with a response immediately.
Following is a typical run in the log file showing the disconnection.
I tried a different power source thinking that was the problem. No luck, same issue. I can swap over to the COM port for the Arduino Nano that this is running on, and everything works well.
Any ideas?
Thanks again.
-jim
Last edit: James McPherson 2017-11-20
Hi James
We do not recommend running serial port at 115200. Bluetooth is fine at 9600. The software serial library that implements the interface with the BT adapter wont handle that reliably at all. The limitation is in the library.
I need to know
what arduino firmware file?
Did you make any changes to file?
This is so I can check file to see if there is any issue with code. It is not obvious from the logfile.
Cheers
Robert
The logfile shows
Try to write command: :08#
This is call to get MaxSteps
Answer it got was 0
This is an invalid value for maxsteps
Are you sure you set this correctly in the controller?
So I suggest test this manually without app.
I would suggest start arduino IDE and connect to controller using serial monitor window
send
:0732182#
to the controller
next send
:08#
to the controller - it should respond with M32182#
But I recommend you use 9600 and I suspect it will burst into life.
I am also hoping you did not change the pin numbers for the BT connection - only certain pins can be used. This is just as crucial.
Last edit: brownrb 2017-11-21
Robert,
Thank you! That did it. 115200 was the default for my HC-06 bluetooth module, that's why I changed the baud rate. I had to use AT commands to set the HC-06 back down to 9600, but when I did that everything started working perfectly.
Thanks again!
-Jim