×

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

Bi-monthly release with minor bug fixes and improvements

RasPi serial ports become unreliable with two devices

  • Posts: 554
  • Thank you received: 138
I'm seeing some unreliability with serial communication on a RasPi 3 if more than one serial device is running.
The devices I'm connecting is the Celestron GPS and the MoonLite focuser.
If either is connected on it's own everything works reliably but if both are connected I see occasional serial read timeout errors.
The FTDI USB to serial converter I'm using with the Celestron shows that something is being send but there is no reply. I guess that means that whatever was sent wasn't recognised by the mount.

Does anyone have any ideas? Am I driving the RasPi too hard? I'm reasonably confident that the hardware - cables etc. - is OK, it hasn't changed between running a single driver and running two.

The only solution I can see is to implement retries for critical code, or for polling state ignore the failures.

Chris
4 years 11 months ago #37972

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

  • Posts: 407
  • Thank you received: 74
The only time I had a problem ,as you describe ,was when I was using Prolific adapters or cheap "non genuine" FDTI adapters especially with "long" (1m plus) cables.

Perhaps you should try a powered hub and see if the problem goes away.

And of course poor cables/connectors.
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
4 years 11 months ago #37994

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

  • Posts: 79
  • Thank you received: 13
A powered hub is the way to go especially if you are using devices which draw power. The RPI3 B+ Maximum total USB peripheral current draw is only 1.2a. . That may not be your issue, but it eliminates one variable and allows you to add extra devices. One of the neatest add-ons is an USB game pad/joystick for direction, speed and park.
4 years 11 months ago #37995

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

  • Posts: 554
  • Thank you received: 138
I am using a powered hub. I'm aware of the power issues with the RasPi.

I'm also aware of the problems with Prolific adaptors and am using a FTDI one.
The cables seem good to me and I've found a short one for the Moonlite. The FTDI serial adaptor has the cable built in, about 200mm long.

Each driver is fine individually but not when they are both running. With both drivers running I see several timeout errors a minute on both but with only one no errors. I haven't changed the cabling, just starting and stopping drivers.

I've tried two Moonlite boxes and it's the same on both. They use their own power supply so overloading the USB power is unlikely to be an issue.

Just tried it again, I only get timeout errors when both drivers are running. No change to connections.

Chris
4 years 11 months ago #37997

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

  • Posts: 407
  • Thank you received: 74
Cant remember ,think the answer is no , can you adjust any read time out parameters for one or both of the ports in Indi Devices to allow longer delays ?

RPI may not be fast but I have DSLR,Mount,GPS adapter, DIY Moonlite focuser(Arduino) all plugged in (no USB HUB used) and haven't noticed any errors but I just use 5GHZ Wifi. Days are gone when you needed hand shaking via DTR/DSR etc.

Maybe a software issue with the drivers - have you another mount - say SW - that could replace the Celestron - as a test. I know Moonlite protocol is "chatty" but its hardly likely to overload the USB BUS.

Nothing odd in RPI LOGS ?
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
4 years 11 months ago #38015

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

  • Posts: 554
  • Thank you received: 138
Thanks stash,

I've been spending a lot of time tinkering with the drivers to see if I can fix it, both use a basic tty_write - tty_read based send_command function. The timeouts are long, 5 seconds for the Celestron and 3 for the Moonlite. I'm familiar with the protocols, I write and maintain the ASCOM drivers for both of them.

I'd post logs but the critical DEBUG_ERROR messages only show on the display, not the log.

I haven't tried connecting both directly to the Raspi, only throuh a powered hub but that's a good idea. At present I have a keyboard and mouse connected directly but they are pretty passive while this is all going on.

My day job for many years was sorting out this sort of thing, only with electron microscopes, and using a variety of platforms but in more recent years Windows. I used to have a system that had a special RS232 connector that allowed snooping on both sides of the RS232 signals. It would only work on early Windows, Windows 98 was probably the last, and I don't think I've needed it for 20 years. Now I can see a need again.

I really like the idea of a RasPi communiting wirelessly rather than an active USB extension under the back door to a laptop on the washer but I'm getting a bit tired of the struggle.

Chris
4 years 11 months ago #38023

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

  • Posts: 407
  • Thank you received: 74
Th eonly other options I can think of are :-

1. If you have a spare RPI - connect 2 x Indiserver chained one with Mount and the other with Filter wheel see if the problem still exists.

or

2. Again if you have a spare RPI (even a zero(w) will work) and if you know ser2net (will need to be installed) run the Mount on the "Spare" and configure Ser2net (again on the Spare) to pass thru Ethernet IP and port to USB0 . Set the Mount Ethernet as the connection type on the Indi Device to the IP/Port of the spare. Connect the Adapter to the Mount and then the USB port on the "Spare".
Ser2net has got some decent logging if my memory serves me but you can also "T" the data .

Not sure if either will find the problem .
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
4 years 11 months ago #38031

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

  • Posts: 554
  • Thank you received: 138
From what I hear a Pi should be able to cope with two USB serial devices. I think I'll try writing a TTY exerciser and see if that gives any clues about what is going on.

But not today, I'm going flying.
4 years 11 months ago #38045

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

  • Posts: 407
  • Thank you received: 74
Just in case there is a problem with either mouse or keyboard (yes I know there shouldn't be) unplug them and use SSH or Remote VNC via wireless - just a thought !

Enjoy your flying.
RPI3 Ubuntu 16.04 / AMD desktop Kstars under Ubuntu 16.04 Mounts :azeq6 ,SWAZGoTo

RPI3 Fedora testing out on AMD desktop Fedpra 28 - running kstars 2.9.4 , Indilib 1.7.4 ?????
4 years 11 months ago #38069

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

  • Posts: 554
  • Thank you received: 138
Thanks for the suggestions stash, connecting the telescope and focuser directly to the Pi and running remotely through VNC and using KStars remotely seems to give reliable communication.

I need to experiment to see how to get everything else connected. I can't avoid a hub entirely because I have 5 USB devices (scope, focuser, filter wheel, guide camera and main camera). At least I can move on now.

Thanks again,
Chris
4 years 11 months ago #38115

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

Time to create page: 0.974 seconds