Menu

MYFP2 --> Arduino Leonardo Clone --> uln2003 --> All tests work, but ASCOM cannot connect

2019-04-04
2019-04-05
  • Bryan ramsey

    Bryan ramsey - 2019-04-04

    I recently got these cheap clone boards from amazon, primarily because they use microUSB instead of the nanoPRO's clones miniUSB. The amazon ad says to just choose arduino leonardo and the port. Other firmware writes and functions fine. No version of the MyFocuserPro2 will work with the ASCOM driver. STRANGE though it did connect once and function. But never since. The Stepper test - Stepper drives one way, then reverses just like it should.

    Since the leonardo can act as a USB host I wonder if this is the problem. Ive tried to enable "this is a micro" in the firmware and the driver. It didn't make any difference. Device manager says "Arduino Leonardo", although that is meaninless since the manufacturer could state anything they want in there. These are not made by Arduino. It shows the driver provider as being arduino however and uses the leonardo driver. I also tried forcing it to use "USB Serial Device" instead. Makes no difference. Sketches program and function either way. Just cannot connect via ASCOM.

    I also flashed a DHT22 simple test and that outputs back to the serial console properly showing temperature and humidity, as well as the home switch test. Works great.

    Thoughts? I enabled logging in the ASCOM test program, but it just spits out a log that says it cannot connect..

    Thanks for any insight.

     
  • brownrb

    brownrb - 2019-04-05

    Does it work with the Windows application. Would be helpful to have a link to see where you purchased these from. Did you try to change the Delay On Connect delay in the ASCOM driver (under settings)?

     

    Last edit: brownrb 2019-04-05
  • Bryan ramsey

    Bryan ramsey - 2019-04-05

    It is not working with the windows (non ASCOM) application.

    Here is the amazon link:

    https://www.amazon.com/gp/product/B01MTU9GOB/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1

    the log file from the attempts:

    4/4/2019 8:02:04 PM: Connect: Timeout Exception for command ::02#
    4/4/2019 8:02:04 PM: Connect: Error message: System.TimeoutException: The operation has timed out.
    at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
    at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count)
    at System.IO.Ports.SerialPort.InternalRead(Char[] buffer, Int32 offset, Int32 count, Int32 timeout, Boolean countMultiByteCharsAsOne)
    at System.IO.Ports.SerialPort.ReadTo(String value)
    at myFocuserPro2.Focuser.ConnectBtn_Click(Object sender, EventArgs e)
    4/4/2019 8:02:04 PM: Connect: Closing and disconnecting ComPort:COM11
    4/4/2019 8:02:04 PM: Connect: Comport will be disconnected
    4/4/2019 8:02:05 PM: disableall: =START=========================================================
    4/4/2019 8:02:05 PM: disableall: =END===========================================================
    4/4/2019 8:02:09 PM: Connect: =START=========================================================
    4/4/2019 8:02:09 PM: ======CONNECT START TIME
    4/4/2019 8:02:09 PM: Connect: Windows Application Version Number: myFocuserPro2 © RB Brown 2014-2019: 2.4.3.0
    4/4/2019 8:02:09 PM: Connect: Com Port Selected = COM11
    4/4/2019 8:02:09 PM: Connect: comportbaudrate: 9600
    4/4/2019 8:02:09 PM: Connect: Setting readtimeout to 5000
    4/4/2019 8:02:09 PM: Connect: Attempting to Open COMPORT COM11
    4/4/2019 8:02:09 PM: Connect: Check if serial port opened
    4/4/2019 8:02:09 PM: Connect: Comport=isOpen
    4/4/2019 8:02:09 PM: Connect: Serial port COM11 opened.
    4/4/2019 8:02:11 PM: Connect: Test to see if controller connected
    4/4/2019 8:02:19 PM: Connect: Timeout Exception for command ::02#
    4/4/2019 8:02:19 PM: Connect: Error message: System.TimeoutException: The operation has timed out.
    at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
    at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count)
    at System.IO.Ports.SerialPort.InternalRead(Char[] buffer, Int32 offset, Int32 count, Int32 timeout, Boolean countMultiByteCharsAsOne)
    at System.IO.Ports.SerialPort.ReadTo(String value)
    at myFocuserPro2.Focuser.ConnectBtn_Click(Object sender, EventArgs e)
    4/4/2019 8:02:19 PM: Connect: Closing and disconnecting ComPort:COM11
    4/4/2019 8:02:19 PM: Connect: Comport will be disconnected
    4/4/2019 8:02:19 PM: disableall: =START=========================================================
    4/4/2019 8:02:19 PM: disableall: =END===========================================================
    4/4/2019 8:02:23 PM: RefreshComPorts: =START=========================================================
    4/4/2019 8:02:23 PM: RefreshComPorts: Serial Port is NOT open
    4/4/2019 8:02:23 PM: RefreshComPorts: Clear list of com ports
    4/4/2019 8:02:23 PM: RefreshComPorts: Reload comports from system
    4/4/2019 8:02:23 PM: RefreshComPorts: Set focuser state
    4/4/2019 8:02:23 PM: stepmodeListBox: =START=========================================================
    4/4/2019 8:02:23 PM: stepmodeListBox: Original stepmode = 2
    4/4/2019 8:02:23 PM: stepmodeListBox: Selected stepmode = 2
    4/4/2019 8:02:23 PM: stepmodeListBox: =END===========================================================
    4/4/2019 8:02:23 PM: stepmodeListBox: Clear text boxes
    4/4/2019 8:02:23 PM: RefreshComPorts: =END===========================================================
    4/4/2019 8:03:37 PM: Connect: =START=========================================================
    4/4/2019 8:03:37 PM: Connect: ERROR NO COM PORT SELECTED OR AVAILABLE
    4/4/2019 8:03:37 PM: Connect: =END===========================================================
    4/4/2019 8:03:42 PM: Connect: =START=========================================================
    4/4/2019 8:03:42 PM: ======CONNECT START TIME
    4/4/2019 8:03:42 PM: Connect: Windows Application Version Number: myFocuserPro2 © RB Brown 2014-2019: 2.4.3.0
    4/4/2019 8:03:42 PM: Connect: Com Port Selected = COM11
    4/4/2019 8:03:42 PM: Connect: comportbaudrate: 9600
    4/4/2019 8:03:42 PM: Connect: Setting readtimeout to 5000
    4/4/2019 8:03:42 PM: Connect: Attempting to Open COMPORT COM11
    4/4/2019 8:03:42 PM: Connect: Check if serial port opened
    4/4/2019 8:03:42 PM: Connect: Comport=isOpen
    4/4/2019 8:03:42 PM: Connect: Serial port COM11 opened.
    4/4/2019 8:03:44 PM: Connect: Test to see if controller connected
    4/4/2019 8:03:54 PM: Connect: IO Exception for command ::02#
    4/4/2019 8:03:54 PM: Connect: Error message: System.IO.IOException: The semaphore timeout period has expired.

    at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
    at System.IO.Ports.SerialStream.EndWrite(IAsyncResult asyncResult)
    at System.IO.Ports.SerialStream.Write(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
    at System.IO.Ports.SerialPort.Write(String text)
    at myFocuserPro2.Focuser.ConnectBtn_Click(Object sender, EventArgs e)
    4/4/2019 8:03:54 PM: Connect: Closing and disconnecting ComPort:COM11
    4/4/2019 8:03:54 PM: Connect: Comport will be disconnected
    4/4/2019 8:03:54 PM: disableall: =START=========================================================
    4/4/2019 8:03:55 PM: disableall: =END===========================================================
    4/4/2019 8:03:59 PM: Connect: =START=========================================================
    4/4/2019 8:03:59 PM: ======CONNECT START TIME
    4/4/2019 8:03:59 PM: Connect: Windows Application Version Number: myFocuserPro2 © RB Brown 2014-2019: 2.4.3.0
    4/4/2019 8:03:59 PM: Connect: Com Port Selected = COM11
    4/4/2019 8:03:59 PM: Connect: comportbaudrate: 9600
    4/4/2019 8:03:59 PM: Connect: Setting readtimeout to 5000
    4/4/2019 8:03:59 PM: Connect: Attempting to Open COMPORT COM11
    4/4/2019 8:03:59 PM: Connect: Check if serial port opened
    4/4/2019 8:03:59 PM: Connect: Comport=isOpen
    4/4/2019 8:03:59 PM: Connect: Serial port COM11 opened.
    4/4/2019 8:04:01 PM: Connect: Test to see if controller connected
    4/4/2019 8:04:08 PM: Connect: IO Exception for command ::02#
    4/4/2019 8:04:08 PM: Connect: Error message: System.IO.IOException: The semaphore timeout period has expired.

    at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
    at System.IO.Ports.SerialStream.EndWrite(IAsyncResult asyncResult)
    at System.IO.Ports.SerialStream.Write(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
    at System.IO.Ports.SerialPort.Write(String text)
    at myFocuserPro2.Focuser.ConnectBtn_Click(Object sender, EventArgs e)
    4/4/2019 8:04:08 PM: Connect: Closing and disconnecting ComPort:COM11
    4/4/2019 8:04:08 PM: Connect: Comport will be disconnected
    4/4/2019 8:04:08 PM: disableall: =START=========================================================
    4/4/2019 8:04:08 PM: disableall: =END===========================================================
    4/4/2019 8:04:10 PM: Exit =START=========================================================
    4/4/2019 8:04:10 PM: Exit: exiting
    4/4/2019 8:04:10 PM: Exit: Com port closed: exiting
    4/4/2019 8:04:10 PM: FormClosing: Start
    4/4/2019 8:04:10 PM: FormClosing: Serial port not connected
    4/4/2019 8:04:10 PM: FormClosing: Save application settings
    4/4/2019 8:04:10 PM: FormClosing: Stop timers
    4/4/2019 8:04:10 PM: FormClosing: Finish
    4/4/2019 8:04:10 PM: FormClosing: Start
    4/4/2019 8:04:10 PM: FormClosing: Serial port not connected
    4/4/2019 8:04:10 PM: FormClosing: Save application settings
    4/4/2019 8:04:10 PM: FormClosing: Stop timers
    4/4/2019 8:04:10 PM: FormClosing: Finish

    Thanks for looking. I can't help but think it has to do with the way the serial to usb works on this board. If you watch in device manager, it changes to leonardo boot loader while programing, then back to leonardo serial port after.

     
  • Bryan ramsey

    Bryan ramsey - 2019-04-05

    I tried increasing the delay as well in the ascom driver. No change. It's also worth noting that it's the same on all three units. Even without the stepper driver/motor hooked up.

     
  • Bryan ramsey

    Bryan ramsey - 2019-04-05

    I got it working. I chose geniduino micro, then chose "controller is a micro" in the driver and in the firmware. Now if I could just make the motor faster. In the motor test I took it as high a 30 (in the uln2003 test ino file) and it worked fine at those speeds. But when I make the speeds higher in the actual firmware it seems to lock up and disconnect.

    from the test file it is just : mystepper.setSpeed(30);
    In this case 30 works fine.

    but from the firmware it is:

    #define motorSpeedSlowRPM   2             // ULN2003
    #define motorSpeedMedRPM    10             // ULN2003
    #define motorSpeedFastRPM   20            // ULN2003
    

    In this case 20 locks up the controller.

    but these are in RPM. Not really sure the difference. I should probably start a new thread. Or more likely do some reading. :)

    Anyhow, thanks!

     
  • brownrb

    brownrb - 2019-04-05

    Happy you figured it out. But the 28BYJ is a geared motor - its not designed to go fast. Think about this - that the actual motor is running heaps faster than the output shaft - so you reach the limit speed of the stepper real quick - do not think of speed or rpm etc in terms of the output shaft

     
  • brownrb

    brownrb - 2019-04-05

    Yes, controller is a micro shouldvbe been enabled in both

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.