Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!aioe.org!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: Thomas Rachel Newsgroups: comp.lang.python Subject: Re: Changing baud rate doesn't allow second command Date: Mon, 25 Apr 2011 18:09:15 +0200 Organization: A newly installed InterNetNews server Message-ID: References: <224f6621-2fc4-4827-8a19-3a12371f39b1@l14g2000pre.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.14) Gecko/20110221 SUSE/3.1.8 Thunderbird/3.1.8 In-Reply-To: Lines: 39 NNTP-Posting-Date: 25 Apr 2011 18:10:03 CEST NNTP-Posting-Host: 191ce7a3.newsspool2.arcor-online.net X-Trace: DXC=K2X0LWdnL2jf1oJaJ0@dmgA9EHlD;3Ycb4Fo<]lROoRa8kF The code is fine but it seems it won't switch baud rates using > pyserial. I have to initiate the first msg in 9600 to change the > setting of the gps > And then send the second command in 115200 because it's in > configuration mode on the unit. Ok. > I can see hooking two pcs together > via null modem that the command is sent but I don't see the next msg > go across. The receiver changes speed as well, I suppose? > I'll try sleeps but even w a 15 sec sleep after close > connection to allow for configuration mode to set (Which only takes > about 4 seconds) it wasn't sending the second command. mmm... strange. > My buddy suggested I make two files for the separate calls but I wouldn't > think that would make a diff or be necessary... Normally not, but it might worth trying. Anyway, have you tried to use setBaudrate() instead of close() and creating a new connection? I can't see why it should make a difference, but I as well can't see why your approach is not working, especially as it works if you do it manually... Maybe your target device expects to get something signalled via the status lines? Thomas