From owner-freebsd-hackers@freebsd.org Fri Oct 27 04:46:19 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D5A5E5BBB6 for ; Fri, 27 Oct 2017 04:46:19 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92B1676AAE for ; Fri, 27 Oct 2017 04:46:18 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id b9so1221477wmh.0 for ; Thu, 26 Oct 2017 21:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mTMkGSQuNib7eid+uuGzyJEM3CxFeIhx4jfZt8rpxhs=; b=uceELuFojC8IP2oITN9kmj3bnnrSLvC+w0PhhIzoO6rb32h14MJnoBDldZDyJDanLV hzOFEgbgjDZRaWoGh29LkjSqKAGu74AYaU8cx255KUu8Vo3zIJTmL2C2liHzef5ICoxl WSfHI3QR76oJ/EdnDDlDK9Fk+n84Sc6UAXp7Ol/KfOkkI4nchxCNrFODMiyIKlSE5fIx 7MOKQK82HAdwbRDGUvrhZ3U1bhXxf64IsAsZU/MthILkfos70hMH1BdjDWmCKwVxcjkv YSK1uN65+u4W0tCxB3zdWZK+7eeZ4QeEmYCU7v4rTM7/SoH/iTvu/DC8Sgry1PB2gdhZ cfTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mTMkGSQuNib7eid+uuGzyJEM3CxFeIhx4jfZt8rpxhs=; b=pTwTFSEIaet1GUWRZzjYqb1BBCxwKF35W6zD2HbFoS/BSKusL5P+jnrvW2kElMqXlB Je65aaRd6wbIbkl6DFTL2q8BpFVgPvftDkGkkBaUPC7aHyXyucmQO0oNN1NfoTXvlEu9 SAN84wMVhMukwVeuFKkgVre+Lx+5gWTych1gLI1uvrhN5BO8WkApCCMU/FlXVXUC+C7u OD+I7tWLLbSWrA19OJHWw5z0YycTVqiKK2Pg7w89cWcB6PEDivcHi8XMcRgqLKWVkUve 8aUiHzSsbNXJ+7kQTVqueeTMhdivX7RYBQShEqptZUI0GTvJ0DkzxVP9tuCAeNQQNzKo tkrA== X-Gm-Message-State: AMCzsaVrqxv0BcQdySmMHZFFEqE5CNuSSBDO75ENq4MQcZU29e7Lmk4v evdgJjCfDzl0aknNpra2a3rIv/Lbtrc8oS6Oqg== X-Google-Smtp-Source: ABhQp+TINKGCqoWXgyxgsBQYBGNlqdK7YVOmuZyUphk8LYD8ChsA4NlDsGRoRrf5v6oI7b89kid6/1AP98Jo70Y1xTc= X-Received: by 10.80.181.90 with SMTP id z26mr31518944edd.76.1509079576978; Thu, 26 Oct 2017 21:46:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.189.139 with HTTP; Thu, 26 Oct 2017 21:46:16 -0700 (PDT) In-Reply-To: References: From: Zaphod Beeblebrox Date: Fri, 27 Oct 2017 00:46:16 -0400 Message-ID: Subject: Re: We do serial differently. To: Kyle Evans Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2017 04:46:19 -0000 OK. I played with this all again ... a bit. Firstly, when I run "arduino" (the IDE) ... the arduino board resets immediately (I can tell this because it has an LCD screen attached). But when I run pronterface, it doesn't reset until 5 seconds (roughly) after pronterface exits. I tried adding a hardcoded setDTR(0) or setDTR(1) near this code ... but it doesn't seem to make any palpable difference. On Wed, Oct 25, 2017 at 1:11 PM, Kyle Evans wrote: > On Wed, Oct 25, 2017 at 11:43 AM, Kyle Evans wrote: > >> On Wed, Oct 25, 2017 at 11:34 AM, Zaphod Beeblebrox >> wrote: >> >>> On Mon, Oct 23, 2017 at 9:45 AM, Kyle Evans wrote: >>> >>>> Hi, >>>> >>>> Are you able to connect to it otherwise (w/ cu or friends) and issue, >>>> say, an M105 manually? >>>> >>> >>> yes. With CU I can connect, it resets, then I can issue an "M105" >>> and it parrots back some status. >>> >> >> Ok, cool, that's expected and sounds like Pronterface is doing something >> it shouldn't be. >> >> I'll poke at it a little bit more- last I checked, it didn't look like it >> was doing anything too crazy with pyserial and I've got a working OctoPrint >> (w/ pyserial) setup, so I know that works to some extent. >> >> > For the sake of argument, can you try applying the following patch [1] to > printrun? I don't see a need to be toggling DTR here, and that might narrow > things down a little bit. > > [1] > diff --git a/printrun/printcore.py b/printrun/printcore.py > index b54e750..fd531c3 100644 > --- a/printrun/printcore.py > +++ b/printrun/printcore.py > @@ -218,11 +218,6 @@ class printcore(): > parity = PARITY_ODD) > self.printer.close() > self.printer.parity = PARITY_NONE > - try: #this appears not to work on many platforms, so > we're going to call it but not care if it fails > - self.printer.setDTR(dtr); > - except: > - #self.logError(_("Could not set DTR on this > platform")) #not sure whether to output an error message > - pass > self.printer.open() > except SerialException as e: > self.logError(_("Could not connect to %s at baudrate > %s:") % (self.port, self.baud) + > > >