From owner-freebsd-hackers@freebsd.org Sat Oct 28 22:01:37 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 138D2E4E58D for ; Sat, 28 Oct 2017 22:01:37 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (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 D1E2381AAC for ; Sat, 28 Oct 2017 22:01:36 +0000 (UTC) (envelope-from zbeeble@gmail.com) Received: by mail-io0-x235.google.com with SMTP id b186so19649105iof.8 for ; Sat, 28 Oct 2017 15:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=Vy8BCgKjuCfnKkuDEcmEwuJ/mRS0DTWE0ybd7gNQHs8=; b=faCHPejaReg2XIwZCrmLEhivhn9Y8wEGnMxrp37adg05eclifbGzo8IeRE7OXMNiRh /3f8a8xMFAfRRgcRF6I/3LoMeD7+7CzihAVo8egcSEuOlaifr/lSJ0UmK7rG0iKa0SEy XjUlcN89GaaDK62ipem4AosHtQvNfojXae5f4M4mHS8Fo3CUb/+eG/CZ1mflZ1k9perb XffhaU0QbSQ4UOEBq3kjO8MgY/b+B3IJb5C6g8JPjb+in2ZYqi0VWcmN89XgBAZ1L4zO aOkNxLT8OfP5efQuy352ttBoLeT8UsNxJtpSfflMMcAPuKIn5QaKoXYrWbxQ4THKiGb4 aFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=Vy8BCgKjuCfnKkuDEcmEwuJ/mRS0DTWE0ybd7gNQHs8=; b=VvrCwlZdXwLcINuNMHqJiLOdQe0S8k/+wzUYG4W7260kJj2OwIveZakqsAKRqRuQ45 Y8PvMGJzBC5a4+ZpS6N0Ph7RmLSwYSewtpcu2C0vkOP2VCOSU84BO09b4P16e12zzfXL 9DL4K6KfiMJQe3Q70EgI8TI8gWLt6m5MLzD9gQmfcNpfPzdKQHEKkdonOYrsArcL0ZB5 NmyR/VnHuFKnjIKdtana+xqXl0YTwln9yLpHkgXpkbntkFUaN+fVHamWmoUBR4g6IZiB QuBI7TqE9LZQ1nTi/3klhlL9jRkaDbDtgMQhbmYnPFxhoyjgRmLaaIBFxmN09KBzlnny QoDQ== X-Gm-Message-State: AMCzsaWCvDHH08iudMWswcwk68TERAOE8qkTX7NM2K+ylbuadk25Vxku qz3MgyuW6y9niW1zgZEt11z3fFM= X-Google-Smtp-Source: ABhQp+QrOAE3xAUAPhceCdIZrsglh/gl8BBmj4CvFE3QT2MCzvtDHJ4FAVtfvXVb1ryscyEB06+0mA== X-Received: by 10.107.10.82 with SMTP id u79mr5560532ioi.252.1509228095789; Sat, 28 Oct 2017 15:01:35 -0700 (PDT) Received: from canoe.dclg.ca (strike.eicat.ca. [66.96.16.50]) by smtp.gmail.com with ESMTPSA id h81sm181013itb.18.2017.10.28.15.01.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Oct 2017 15:01:34 -0700 (PDT) Subject: Re: We do serial differently. To: Kyle Evans Cc: FreeBSD Hackers References: From: Zaphod Beeblebrox Message-ID: Date: Sat, 28 Oct 2017 18:01:35 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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: Sat, 28 Oct 2017 22:01:37 -0000 I've tried hacking at directly.  I can't send it a file (as in that script) because the printer isn't setup yet.  I'm still working on it. ... I have poked on the .send() method (with M105) ... and that doesn't seem to have effect.  Also ... if I ctrl-C the python process, it doesn't exit.  I'm not patient... but so far I've only been able to exit with CTRL-\ ... (core dump). On 27/10/2017 07:59, Kyle Evans wrote: > What happens if you just invoke printcore directly, like the example > script in the printrun readme? > > Pronterface has got to be doing something not-entirely-sane here. The > reset should always coincide with the port being open()d, and it > should behave like the Arduino IDE and cu(1) do. The mega doesn't > really have any crazy requirements just to function properly. > > > On Oct 26, 2017 11:46 PM, "Zaphod Beeblebrox" > wrote: > > 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) + > > > >