Serial Device loses connection.

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Tue Oct 04, 2011 9:25 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Serial Device loses connection.

I'm having a small problem with a serial device losing connection (I know, this isn't really a Python, or maybe even and Indigo question, but I discovered it using yergeyj's pool control plugin and there's a lot of smart Mac guys here, so hopefully someone knows something or has an idea).

Basically, the plugin will stop reporting states after being connected to the pool for a long time (day or two). It's not like it has an error, just like response strings stop arriving (command strings don't seem to work either), and the plugin carries on. Restarting the plugin does nothing.

It's not a plugin problem though. I can disable the plugin, and open with a terminal app (currently using CoolTerm). The terminal app WILL connect to the serial port, but will NOT receive any data (or have it's sent strings recognized from what I can tell).

I don't think it's a problem with the serial device from Pentair, as a reboot of my Mac cures all.

I'm using an iMac that's a couple of years old, running Snow Leopard and using a Keyspan USB-Serial adapter (with a few USB over Cat5 dongles and a USB hub to extend my range).

Any ideas?

http://nerdhome.jimdo.com

Posted on
Tue Oct 04, 2011 9:55 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serial Device loses connection.

Serial-type devices that expect specific timing characteristics are really sensitive to USB issues. This is why we (and many other software makers who support USB hardware) recommend not going through hubs - because the timing gets messed up and the device becomes unreliable. You may be suffering the same problem - maybe it's the USB over Cat5 dongles. Just a guess though.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Oct 04, 2011 2:30 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Serial Device loses connection.

Does anyone know of a way to 'reboot' the serial connection without rebooting the computer?

http://nerdhome.jimdo.com

Posted on
Tue Oct 04, 2011 2:32 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Serial Device loses connection.

What happens if you power cycle the USB hub? Does it come back online? You could do that with an ApplianceLinc.

I've also had problems with open serial connections after a Mac goes to sleep and wakes back up. I have physically disconnect the USB cable (or probably restart the Mac) for it to start working again.

Image

Posted on
Tue Oct 04, 2011 2:54 pm
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Serial Device loses connection.

My EasyDAQ cards occasionally disconnect. I can reconnect by unchecking and rechecking Comm Enabled on the Home Window.

By the way, I didn't find any AppleScript command for doing the above. Is there one that I missed?

Posted on
Tue Oct 04, 2011 3:24 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serial Device loses connection.

No, but you can with a Python script.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Oct 05, 2011 7:42 pm
yergeyj offline
Posts: 260
Joined: Dec 29, 2004

Re: Serial Device loses connection.

Swancoat wrote:
I'm having a small problem with a serial device losing connection (I know, this isn't really a Python, or maybe even and Indigo question, but I discovered it using yergeyj's pool control plugin and there's a lot of smart Mac guys here, so hopefully someone knows something or has an idea).

Basically, the plugin will stop reporting states after being connected to the pool for a long time (day or two). It's not like it has an error, just like response strings stop arriving (command strings don't seem to work either), and the plugin carries on. Restarting the plugin does nothing.

It's not a plugin problem though. I can disable the plugin, and open with a terminal app (currently using CoolTerm). The terminal app WILL connect to the serial port, but will NOT receive any data (or have it's sent strings recognized from what I can tell).

I don't think it's a problem with the serial device from Pentair, as a reboot of my Mac cures all.

I'm using an iMac that's a couple of years old, running Snow Leopard and using a Keyspan USB-Serial adapter (with a few USB over Cat5 dongles and a USB hub to extend my range).

Any ideas?


Just as another data point, my Mac mini is running the Jandy plugin, also using the Keyspan USB-serial adaptor, and has been running continuously for a week or so without any disconnection problems, cycling every ~2-3 sec through the read-write(if any commands are queued)-wait cycle.

Note though, to the points above about hubs and sleeping, that mine is connected directly to the Mac mini, and the mini is set to never sleep. I used to have problems with the connection hanging in previous AppleScript iterations if I was connected through a hub, so my guess is that's your problem.

Jim

Posted on
Thu Oct 06, 2011 7:29 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Serial Device loses connection.

My signal chain is VERY messy. Given that the serial devices are sensitive to timing as mentioned above, I'm kind of surprised it works at all.

Abbreviating C5D for a USB over Cat5 Dongle....

Mac->USB Hub->C5D->Cat5 run->C5D->unpowered hub->C5D->Cat5 run->C5D->Keyspan Adapter->Pentair Adapter.
(even one of those cat5 runs goes jumper->wall jack-in wall cable->patch panel->jumper)

Now I can probably eliminate the first hub (which is a nice, powered Belkin hub) and go directly into the mac, but the second hub is necessary (it's in my structured wiring closet), since I am also doing a similar Rube-Goldberg connection to my NuVo Grand Concerto.

The Grand Concerto can also be controlled over IP (but that's well beyond my skillz), so if someone made a plugin that controlled that, I could eliminate the hub and some of the Cat5 Dongles.

http://nerdhome.jimdo.com

Posted on
Thu Oct 06, 2011 8:51 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serial Device loses connection.

Yeah, I'd say that's likely your problem. Just curious - since you have cat 5 going all the way why not just eliminate the extra USB in the wiring closet? You would have to connect the cat5 run from the computer to the run to thepentair but that's what a structured wiring system is for, right?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Oct 06, 2011 11:20 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Serial Device loses connection.

Well, the extra USB in the wiring closet is just so that I can have a USB hub there.

The pentair is in the attic (accessible from wiring closet though), and the NuVo is in the wiring closet. Mac is in my office. I only have 2 cat5 runs to the office, and one is carrying the internet to the iMac, the other one is actually being used for the USB. So I basically carry that USB into the wiring closet, but then what? I have two serial things I want to connect, the NuVo (which is right there), and the Pentair (in the attic, but wired to wiring closet). I can't run any additional cat5 directly from the office to the Pentair.

So, I COULD use both Cat5 for USB, but then that leaves the Mac running on WiFi, and I prefer the wires. Moving music around, etc... is SUPER fast.

Other options would be some sort of IP based serial port server which I could park out in the attic, but I'm not sure if those exist, how to use them, etc... I was really hoping to get my NuVo controllable using its IP connection, and then I could make a much more direct connection to the Pentair.

http://nerdhome.jimdo.com

Posted on
Thu Oct 06, 2011 12:52 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Serial Device loses connection.

Ah - so your USB-to-Cat5 device carried multiple USB signals (ports). That explains it.

If your office has two dedicated cat5 cables to it, that means you potentially have some extra wires that aren't getting used (ethernet only uses 4, cat5 has 8 wires). Not sure if the USB-to-Cat5 uses them all, but if it only uses 4 then you could split one of them. Not a perfect solution, but it should work. Also, if you have a phone line running over a Cat5 to that room you could have some extra wires there also.

Another thought - if the run isn't that long between your wiring closet and the Pentair, you could probably just run the serial connection over the Cat5 that goes there. So, the keyspan would be plugged into the C5D in the wiring closet, and connect to the Cat5 going to the Pentair as the serial connection. Serial cables can be quite long usually.

[EDIT] - 250ft @ 9600 baud seems to be the majority consensus. I doubt your run is even close to that... ;)

Just some thoughts... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Oct 12, 2011 11:11 am
Otis offline
Posts: 210
Joined: Jan 24, 2006

Re: Serial Device loses connection.

When my EasyDAQ card has disconnected itself, and Indigo sends a command to it, I get the following in the Event Log:

EasyDAQ Relay Card sending device "EasyDAQ Speaker control - Relay 7" command on
EasyDAQ Relay Card received device "EasyDAQ Speaker control - Relay 7" update to on

I get exactly the same message when the card is connected and responding properly.

Does the "received device" log entry mean Indigo actually did receive a response from the card (even though the relay didn't change), or (since the card doesn't allow polling of its state) are you just assuming the command was executed by the card?

Reconnecting is quick and easy thanks to your Python suggestion (above), and I'm trying to find a way to determine when the card has disconnected so I can reconnected when needed, rather than just periodically.

Posted on
Fri Oct 14, 2011 10:51 am
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Serial Device loses connection.

The "received" in that case is pseudo if polling is turned off. In that case, it just assumed that the EasyDAQ got the command if there was no reported errors when the data was sent. I presume there are no errors showing in the Event Log when the connection goes bad?

I've added some additional logic to the EasyDAQ plugin that will be in the next installer which automatically tries to reconnect if there is a serial error. But that code won't be executed if you aren't seeing any errors logged at all. In that case it sounds like it is silently failing and I'm not sure there is going to be a way for the plugin to detect the bad connection.

Image

Posted on
Sun Oct 23, 2011 10:19 am
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Serial Device loses connection.

Following up on the IP-USB thought from above... Anyone tried anything like one of these:

http://www.usconverters.com/index.php?m ... cts_id=238

I could park that in my wiring closet, plug it into my IP switch and then use a couple of USB-Cat5 Dongles and a Keyspan adapter to hit my Grand Concerto and Pentair adapter.

The main advantage here is that you basically replace a couple of USB-Cat5 Dongles and a crappy hub with this one device. I assume that may help the 'timing' aspect of things slightly.

For people who have used these, how do the USB ports show up on your Mac? Do you run the manufacturer's software, and then they just show up like any other port? (i.e. will my existing plugins and stuff be able to 'see' these USB ports and the adapters on them without modification?)

What about a serial version of the same (less inclined to do this, since it will mean running some new serial cables...).

http://nerdhome.jimdo.com

Posted on
Tue Jun 05, 2012 8:39 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Serial Device loses connection.

Just an update on solving this problem.

I am reaching the serial ports on both devices now using Global Cache iTach IP2SL boxes, which are little network based serial ports. The wiring is much simpler since the both go straight to my switch in the wiring closet, and one of them is even PoE, which is perfect for my Pentair interface stuck up in the attic. My serial connections haven't failed since I went to these (~6 weeks on my Grand concerto, and only 1 week so far for the Pentair adapter). Highly recommended.

http://nerdhome.jimdo.com

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest