×

INDI Library v1.9.8 Released (29 Sep 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Serial Timeout with Moonlite Focuser

  • Posts: 28
  • Thank you received: 0
Thanks for trying.
2 years 8 months ago #50460

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28
Hi everybody,

A few days ago, I finished my own DIY focuser based on the Moonlite protocol.
It works with an Arduino, an A4988 driver and a NEMA17 stepper motor.
I have exactly the same problem as the one described here.

2020-05-05T18:25:47: [ERROR] Serial read error: Timeout error.

2020-05-05T18:20:44: [INFO] Focuser is moving to position 1500
2020-05-05T18:20:32: [INFO] Focuser reached requested position.
2020-05-05T18:20:31: [INFO] Focuser is moving to position 3480

Sometimes, the log says "[INFO] Focuser reached requested position. ", but the stepper didn't move.
Sometimes, the stepper goes the opposite direction when adjusting from Ekos. . . (focus in)

To be sure it didn't come from the firmware or the Arduino COM port, I wrote a small soft simply opening directly the COM port (Linux, blocking IO...) reading the greeting message then sending some commands to move the stepper, change the steps, move again etc...
Then I read the status. (Actual pos, step ...). Every thing works fine and I never, ever lose any char.

I have done this tenths of time, with the same result :

MarcusFocus 0.3 - Ready.
Un focuser Arduino/Moonlite sous INDI pour Greg :)

Command sent :SH#:SN0777#:FG#
Command sent :GP#:GH#
Response = 0777#FF#

Command sent :SF#:SN0000#:FG#
Command sent :GP#:GH#
Response = 0000#00#

n = 0


The problem is exactly the same with the two drivers (Moonlite and Moonlite Dro)

I also used the serial monitor of the Arduino IDE to send various commands. Again, no problem.

Hope this helps. :)

- Marc
2 years 6 months ago #53258

Please Log in or Create an account to join the conversation.

You have the full log? Can you also debug the INDI Moonlite driver to see where it is having issues with the response?
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
2 years 6 months ago #53286

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28

Hi, Jasem,

everything else in the log is irrelevant:
I can't turn on debugging of the driver. The button is non-responsive or it jumps immediately from 'ON' to 'DISABLE' (see ** in the log)

org.kde.kstars.indi: EQMod Mount : "[INFO] updateLocation: long = 9.52667 lat = 42.5603 "
org.kde.kstars.indi: EQMod Mount : "[INFO] Observer location updated: Longitude (9.52667) Latitude (42.5603) "
org.kde.kstars.indi: EQMod Mount : "[INFO] Saving device configuration... "
org.kde.kstars.indi: EQMod Mount : "[INFO] Device configuration saved. "
org.kde.kstars.indi: EQMod Mount : "[INFO] Setting UTC Time to 2020-05-06T14:24:23, Offset 2 "
org.kde.kstars.indi: EQMod Mount : "[INFO] Saving device configuration... "
org.kde.kstars.indi: EQMod Mount : "[INFO] Device configuration saved. "
org.kde.kstars.indi: MoonLite : "[ERROR] Serial read error: Timeout error. "
org.kde.kstars.indi: MoonLite : "[ERROR] Unknown error: focuser temperature value (#) " // we don't care, The Arduino is bare, no temp probe
org.kde.kstars.indi: EQMod Mount : "[INFO] Saving device configuration... "
org.kde.kstars.indi: EQMod Mount : "[INFO] Device configuration saved. "
org.kde.kstars.indi: EQMod Mount : "[INFO] Saving device configuration... "
org.kde.kstars.indi: EQMod Mount : "[INFO] Device configuration saved. "
org.kde.kstars.indi: EQMod Mount : "[INFO] Setting UTC Time to 2020-05-06T14:25:54, Offset 2 "
org.kde.kstars.indi: EQMod Mount : "[INFO] updateLocation: long = 9.52667 lat = 42.5603 "
org.kde.kstars.indi: EQMod Mount : "[INFO] Observer location updated: Longitude (9.52667) Latitude (42.5603) "
org.kde.kstars.indi: EQMod Mount : "[INFO] Saving device configuration... "
org.kde.kstars.indi: EQMod Mount : "[INFO] Device configuration saved. "
org.kde.kstars.indi: MoonLite : "[INFO] Debug is enabled. " ** Debug then immediately disable debugging again **
org.kde.kstars.ekos: "Re-disabling debug logging for MoonLite..."
org.kde.kstars.indi: MoonLite : "[INFO] Debug is disabled. "
org.kde.kstars.indi: MoonLite : "[ERROR] Serial read error: Timeout error. "
org.kde.kstars.indi: MoonLite : "[INFO] Moving to Preset 2 with position 1800. " // Nope, returns from 3500 to Pos 128 :)
org.kde.kstars.indi: MoonLite : "[INFO] Focuser reached requested position. " //Actually, this is wrong, as the window in Ekos gives the true position, 123...
org.kde.kstars.indi: MoonLite : "[ERROR] Serial read error: Timeout error. "
org.kde.kstars.indi: MoonLite : "[ERROR] Serial read error: Timeout error. "


So I tried to verify what cxxone said about Kstars 3.0.0 . Of course Kstars doesn't know much about COM ports, but I used the INDI git tree to return to the commit contemporary of Kstars 3.0.0 ( git checkout a06fbccc544296333a59b585b2685f7573501952 ) recompiled it and used the last Kstars with the old indiserver (!).
Well cxxone was right, no more Timeout error and the focuser works perfectly.

Now I'm a bit stuck. The indiserver log doesn't say much about Moonlite.
Is there a way to enable debugging of the drivers from the command line when launching the indiserver ? I don't remember.

If you have an Arduino (UNO or Nano V3) it only takes 5 minutes to setup a working Moonlite (Bare, no need of a driver or a stepper motor to test ) ...
You just plug the Arduino to an USB port, use the IDE to upload the firmware and you're good to go. Really takes 5 minutes.

- Marc
Last edit: 2 years 6 months ago by Marc.
2 years 6 months ago #53297

Please Log in or Create an account to join the conversation.

  • Posts: 554
  • Thank you received: 138
I've just tried and in order to turn driver logging on logging needs to be enabled in EKOS

In the logs window set verbosity to Verbose and set the Output to File.
Then logging in the INDI control panel can be enabled and remain on. I enable logging in the driver and check every box This gives a driver log in ~/.indi/logs/<date>/<driver>.

It's all a bit strange because any change in the EKOS logs settings seems to disable logging but setting verbose and file seems to cause the driver debug settings to remain.

Chris
The following user(s) said Thank You: Marc
2 years 6 months ago #53298

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28
Well here comes the MoonLite driver log.... I filtered the relevant infos to shorten the file.
It appears every serial Timeout occurs after a :GT# command (Get temperature). Sometimes the response seems to fit, and sometimes, it generates a Timeout.
One time, there is an incomplete answer (chars lost) without Timeout and not after a :GT# command. ( see ??????????? )
The response to the :GI# command (Is the motor moving ?) should have been “01” if the motor is moving, otherwise “00”
To be honest, I must say there is no physical temp probe so far, as I didn't receive the componant yet. The question now is why the Timeout only occurs sometimes?
And why did older versions did not lose chars (See my previous message), when this one does ?

- Marc
2 years 6 months ago #53301
Attachments:

Please Log in or Create an account to join the conversation.


What files exactly do I need to flash to Arduino UNO? I have one over here.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
2 years 6 months ago #53311

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28
git clone github.com/jbrazio/ardufocus.git

:) Thanks

- Marc
2 years 6 months ago #53312

Please Log in or Create an account to join the conversation.

Thank you. I just finished testing this:

1. GT# command sometimes times out. I tried changed polling period to 1 second, which makes this timeout appear less, but it still happens at random times. Maybe the Arduino is looking for the sensor and taking quite a bit of time there? Not sure.
2. The board returns NOT MOVING even though when it is moving. It happens randomly, maybe 5-10% of the time, but it's definitely there. See screenshot below, I was at 13,000 steps and commanded it to 20,000 and at 14956, it decided to return 00# for the :GI# command. Why? beats me.

The reason you don't see these errors is because you're not running in a loop. Most of the time, these things work OK, but because the drivers continuous reads the value, you see them. The timeout error is not critical and can probably be improved with increasing the polling period. I even stopped reading temperature completely while in motion, but I still kept getting random time out commands.

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
2 years 6 months ago #53318
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28
Thanks a lot Jasem. :) So I guess I need to find a better firmware for my focuser :(
if someone has a good plan for this ...

Anyway, thanks again for your time and kindness.

- Marc
2 years 6 months ago #53320

Please Log in or Create an account to join the conversation.

  • Posts: 554
  • Thank you received: 138
The Moonlite hardware works well with the Moonlite driver. Better than leeching off other people's work.

Looking at that repository it's typcal linux. Precious about it's own copyright, with messages plastered over everything, while being completely contemptous of other peoples copyright, including part of MY ASCOM driver documentation.
2 years 6 months ago #53332

Please Log in or Create an account to join the conversation.

  • Posts: 132
  • Thank you received: 28
Chris,

I'm sorry to hear this thing infringes some of your own copyrights.How would have I known ? At least, now everybody here knows it is faulty :) Thanks, Jasem !
You're not talking about the Linux world (remember, this thing runs under an Arduino, not under Linux, Windows or Mac.) You're talking about people who do not respect the work of others.
And this kind of people, you can find them on both side, Copyrights and Copylefts ;) Also, remember your beloved Mac runs under Darwin which is ... Free Software deriving from NextStep (Copyright) and BSD (Free Software). Only the GUI is Copyright. I guess things are never binary in the real world :)

Now, you've made your point and you were right to do so. Let's end this, this is not the place for that kind of discussion..

- Marc
2 years 6 months ago #53341

Please Log in or Create an account to join the conversation.

Time to create page: 0.999 seconds