Problem solved! Turns out this is a timing issue. Here is the code that handles the initial connection:
- Code: Select all
def ipStartup(self):
self.logger.info(u"Running ipStartup")
self.timeout = 1
host = self.pluginPrefs["ip_address"]
try:
self.logger.info(u"Connecting via IP to %s" % host)
self.connIP = telnetlib.Telnet(host, 23)
a = self.connIP.read_until("\n", self.timeout)
self.logger.debug(u"self.connIP.read: %s" % a)
The plugin opens a telnet connection and waits until a newline character ("\n") is received or for the timeout value of one second, whatever comes first. The problem is that the bridge (as well as a RA2 repeater) never sends a newline during sign-on. The first prompt is "login: " and the second prompt is "password: ". So what happens is that the plugin always waits for the one second timeout to expire, regardless of whether the bridge is ready.
On my test network, I was able to create a set of suboptimal conditions (no internet connection + firewall) that caused the Smart Bridge Pro to take as long as 30 seconds to prompt for login.
The issue with connecting from a command prompt turned out to be an incompatibility between the MacOS implementation of telnet and the bridge, which has a very rudimentary telnet server. No problems connecting from a Windows computer.
I'll put in a pull request on github but anybody who needs this update immediately can PM me.
Cheers,
-Jim