×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Serial Timeout with Moonlite Focuser

  • Posts: 28
  • Thank you received: 0
Verbose logging was selected, I added the mount. Is this what you needed?
Thanks

File Attachment:

File Name: log_13-14-09.txt
File Size:147 KB
4 years 1 week ago #50455
Attachments:

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

  • Posts: 554
  • Thank you received: 138
No, there's still no focuser serial command data. Adding the telescope just clogs the log with irrelevant telescope information. Maybe there earlier versions don't have the serial dta available.

I don't think there is anything more I can do. The logs with serial data show the correct commands being sent and no indication that they failed, yet the hardware behaves incorrectly. It doesn't seem to happen with the Raspberry Pi so that indicates there is no fundamental issue with the code.

Maybe someone else can help.
4 years 1 week ago #50457

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

  • Posts: 28
  • Thank you received: 0
Thanks for trying.
4 years 1 week ago #50460

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

  • Posts: 139
  • Thank you received: 31
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
3 years 10 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?
3 years 10 months ago #53286

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

  • Posts: 139
  • Thank you received: 31

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: 3 years 10 months ago by Marc.
3 years 10 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
3 years 10 months ago #53298

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

  • Posts: 139
  • Thank you received: 31
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
3 years 10 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.
3 years 10 months ago #53311

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

  • Posts: 139
  • Thank you received: 31
git clone github.com/jbrazio/ardufocus.git

:) Thanks

- Marc
3 years 10 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.

3 years 10 months ago #53318
Attachments:

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

  • Posts: 139
  • Thank you received: 31
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
3 years 10 months ago #53320

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

Time to create page: 1.798 seconds