Welcome, Guest
Username: Password: Remember me
25 Jul 2018
Glad to announce of release of INDI Library v1.7.4 on 2018-07-25. A few drivers were added in this release as we continue to improve & stabilize existing drivers.
Read More...

TOPIC: Driver OnStep (LX200 like) for INDI

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9798

Hello Alain,
I have the exact problem as Ben
I am getting the message as below;
2016-08-26T19:14:46: Error connecting to Telescope. Telescope is offline.
2016-08-26T19:14:46: Failure. Telescope is not responding to ACK!
2016-08-26T19:14:36: Testing telescope connection using ACK...

I am using ALT_AZM mount, also I did the :Gc command fix.
After many connection attempt I got connection a couple of times, but no success after disconnect it.

I am using ubuntuMate on Raspberry Pi2, only indiserver working on this side, connecting via Kstars on PC
OnStep is working on Teensy 3.2, by the way OnStepESPServer and Android app is working fine

regards,
Kemal

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9806

  • azwing
  • azwing's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 112
  • Karma: 1
  • Thank you received: 18
Hi Kemal,

first thanks for feedback, this is the way to improvement :)

I tested on Raspberry with the daily snapshot of Indi and could not reproduce this behavior.

I suppose you have indi running on your raspberry and the OnStep controller connected via USB and /dev/ttyACM0 on the raspberry.
Then you connect to Indi with Kstars to your raspberry via Ethernet / WiFi.

OnStep <=> USB on Raspberry <=> Ethernet / WiFi <=> Your PC - Kstars remote Indi

I did this and connect without any issue, the connection sometimes take a second or two but no error message.

Are you sure of your communication?
I would spy the comm to see the trafic
I give you hereunder a brief description on how to do this under linux
============================= Serial Spy under Linux =============================
Debugging serial communication:

First Install jpnevulator
apt-get install jpnevulator

once done you can run it to spy the serial line:

Let's assume:
/dev/ttyACM0 is the serial device where is connected your device
then issue the following command:
jpnevulator --ascii --print --tty /dev/ttyACM0 --pty /tmp/serial --pass --read
jpnevulatro returns
jpnevulator: slave pts device is /dev/pts/4 (or whatever /dev/pts/x)

To show graphically what is going on

/dev/ttyACM0 <==> /tmp/serial <==> /dev/pts/4

which means you can connect with your client (kstars for example) to /dev/pts/4
all the communication between your serial port /dev/ttyACM0 and your virtual port /dev/pts/4
will go through the file /tmp/serial

you can then do a tail -f /tmp/serial
and observe all the trafic between your serial port /dev/ttyACM0 and your virtual port /dev/pts/4

Screenshot: jpnevulator
alain@alain:~$ jpnevulator --ascii --print --tty /dev/ttyACM0 --pty /tmp/serial --pass --read
jpnevulator: slave pts device is /dev/pts/4.

Screenshot: tail /tmp/serial where I dis send ack (^F) and OnsTep returns P for polar
alain@alain:~$ tail -f /tmp/serial
06 .
/dev/ttyACM0
50 P
/dev/pts/4
3A :
47 G
52 R
23 #
/dev/ttyACM0
30 35 3A 30 38 3A 34 35 23

=============================
To debug the communication you may use minicom connected to /dev/pts/4 and with a macro set to send ack (^F)
don't forget to set minicom serial to 9600 bauds ....

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9807

  • azwing
  • azwing's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 112
  • Karma: 1
  • Thank you received: 18
Kemal,

May be my previous answer was too quick.
It is simply possible that you cannot connect because you have no access to /dev/ttyACM0
are you sure you have read/write access to the serial device.
If not you should add the user you are running on in the dialout group

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9811

Hello Alain,
first of all, thank you so much your detailed answer.
My setup is as per you visualize
I've monitored the serial connection but, I only got "06"
I also tested the USB serial connection with minicom, and it is working as expected.
also checked the user group settings, my user account is under dialout group as you suggested.

It would be because of ubuntu mate image which I am using, I will try another OS to be sure.
every time USB adapter replugged, its tty name is changed accordinly, this is very annoying
I learned that there is a way to fix it playing with udev rules, but it took too much time for me by now.
I will feedback soon if I get any progress...
regards,

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9812

kyildirim wrote: Hello Alain,
first of all, thank you so much your detailed answer.
My setup is as per you visualize
I've monitored the serial connection but, I only got "06"
I also tested the USB serial connection with minicom, and it is working as expected.
also checked the user group settings, my user account is under dialout group as you suggested.

It would be because of ubuntu mate image which I am using, I will try another OS to be sure.
every time USB adapter replugged, its tty name is changed accordinly, this is very annoying
I learned that there is a way to fix it playing with udev rules, but it took too much time for me by now.
I will feedback soon if I get any progress...
regards,


What's the VID:PID of your USB adapter? Post it here and I'll give you the appropriate udev rule to use.

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

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9823

  • azwing
  • azwing's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 112
  • Karma: 1
  • Thank you received: 18
Hi,

Yes you are right, this /dev/ttyxxx changing anytime is really anoying.
Yes Udev Rules are the solution but is device specific. and therfore not really starightforward for common users.
I will investigate a solution more user firendly. (May be a /dev/chooser in the indi dialog).
Difficult to manage these distribution specific behavior :-)

Next Week I will try to get some time (I will be off and will have time to check)

Regards
The following user(s) said Thank You: knro

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

Last Edit: by azwing.

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9833

Hello Alain,
I have reproduce my problem with freshly installed rasbian/jessie image.
But I found a very odd situation accidentaly;
if I power-off and power-on the OnStep hardware just after pressing connect button from Indi control panel, now I am able to connecting everytime.
I could get the sites information which I uploaded before, and able to guide manually.
I don't know if this info guide you some point, but thanks again for this valueable plugin.
regards,

Kemal

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

Last Edit: by kyildirim.

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9834

Hello Jasem,
my usbconverter is FTDI based and shown as per below from lsusb output

Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

regards,
Kemal

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9835

by the way I am checking indilib source file lx200driver.ccp
there is a function ; check_lx200_connection(int in_fd)
there is a loop in this fuction which is two times checking the connection;

for (i=0; i < 2; i++)
{
if (write(in_fd, ack, 1) < 0) return -1;
tty_read(in_fd, MountAlign, 1, LX200_TIMEOUT, &nbytes_read);
if (nbytes_read == 1)
{
DEBUGDEVICE(lx200Name, INDI::Logger::DBG_DEBUG, "Testing successful!");
return 0;
}
usleep(50000);
}
I will check Onstep command.ino if it is fully compatible with this check conditions.
The following user(s) said Thank You: azwing

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9838

  • azwing
  • azwing's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 112
  • Karma: 1
  • Thank you received: 18
Hi Kemal,

After some test, the issue with the port assignment changing after reconnection of usb devices can be solved with udev assigning a symbolic link to the device.
you already discovered your device's Vendor Id : Product Id (0403:6001).
This requires to uniquely identify your device with Vendor Id, Product Id and Serial.
Do a tail -f /var/log/messages after having plugged in the device
you should see something like:
==================
root@alain:/etc/udev/rules.d# tail -f /var/log/messages
Aug 28 23:34:13 alain kernel: [ 5604.299012] usb 2-1: New USB device found, idVendor=0403, idProduct=6001
Aug 28 23:34:13 alain kernel: [ 5604.299022] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 28 23:34:13 alain kernel: [ 5604.299027] usb 2-1: Product: FT232R USB UART
Aug 28 23:34:13 alain kernel: [ 5604.299031] usb 2-1: Manufacturer: FTDI
Aug 28 23:34:13 alain kernel: [ 5604.299034] usb 2-1: SerialNumber: A600emN7
Aug 28 23:34:13 alain kernel: [ 5604.302748] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected
Aug 28 23:34:13 alain kernel: [ 5604.302823] usb 2-1: Detected FT232RL
Aug 28 23:34:13 alain kernel: [ 5604.303169] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
===================
The bold text gives respectively Vendor Id, Product Id and Product Serial Number
with these noted create a file named 99-usb-serial.rules in /etc/udev/rules.d/
and add a line like the following:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="serial", SYMLINK+="arduino"
replacing "serial" with the serial number of your device and save the file.

next time you plug in your device you can connect always to /dev/arduino whatever real dev/ttyUSBn you really have connected to the device
you can add as much of those lines for each individual device and give them a symbolic link.

PS: I will install a Ubuntu Mate and test to see if I can reproduce your issues.
The following user(s) said Thank You: knro, kyildirim

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

Last Edit: by azwing.

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9840

Thank you Alain,
udev rule fixed the serial interface port assignment problem
but this was not my real problem, from beginning I was aware that port name is changing when replugged.

The problem is OnSTep/Indiserver can not handshake but can talk :-)
not only occuring on UbuntuMate, I reproduced the same situation on Raspbian/Jessie
Now, my solution is power off and power on the OnStep hardware just after connecting from indiControl panel :-)
By doing this I am disabling the handshaink process I think.

I will test this by changing check_lx200_connection(int in_fd) function

regards,

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

Driver OnStep (LX200 like) for INDI 1 year 11 months ago #9846

  • azwing
  • azwing's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 112
  • Karma: 1
  • Thank you received: 18
Hi Kemal,

I will buy a Teensy to make some test with this configuration. Could you please provide your detailed config?
I am not able to reproduce this annoying connection problem.
My test were done with following configs:
Platform Arduino Mega 1280 and Mega 2560
Connection via USB or Bluetooth directly to PC
Connection via USB or Bluetooth via Raspberry Pi3
Never got this connection issue
Now I really want to test with the Teensy platform and see if I can reproduce your issue.

Regards

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

Time to create page: 0.141 seconds

Login



3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!


Gallery

Replica

Why INDI

Replica