From nobody Fri Oct 06 00:37:00 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S1qJ31h0kz4wNjd for ; Fri, 6 Oct 2023 00:37:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S1qJ3165bz3Yql for ; Fri, 6 Oct 2023 00:37:07 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696552627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PXq46dIALsBef+B0HGwu2HWBJJgwGDOu2bjfT1DfNY4=; b=Ryh4K3M1TnAlFDO2wtzsOn9oNUDmRK9Jceo2JhrdDhqSB42GJ8tJwxubSN9EARcCB6dGTs cFus8yJJK36Dipn+ehA5d+s8VnoHIw6zXYGNpET/UT4toy1n1o0y/uzbI9MOAVwwboTp74 3WWkIkgoityL6n7jyFxgqYI8cWcqNlUc0tlPYxyhUKFaoRaocwxGLKREmCmXdNlmVPnXfn qNLnr8pvPa3uBvKkQ20W8+ybsANXjV+C+5aoFBYT/mmhYLCTcOAASiyHDNWmBHGTcDPk2b QCxYx7b1Aw4YV97jPHKXccPKMG+/vTqEBCz4mZGTJOamEZskMyb1T6I4a6AhgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696552627; a=rsa-sha256; cv=none; b=KdsfJm+cXW2ohQHBlMDGQQ6LvNaUL92CPcBjszE4fiVPJuGa7k4AH/3kvoZhIihTZXxuNj kQIelFxtB0j6e+gCkqs6Lr0i8L1mKamCSe/OFJgHuxQEd2WPaBUMHx1oC5gnlNPZyEc8bB QWW2woiUqQ79b32dXUntMzR6AAZpRtkEXaNkkNESP9f/9dOkpSUd6z4LSPAmk9aAwMWz+r w9TCkwpvIzOxrvGmhA8+Ea27Wc79PUw316Q8NtU/W2nIn6z6lNGCLxVfJk06kFvUBHxQKy ezdUtry8LNkLIzKcxocwzsa8YsO6pkRux0BJO1SrOqiB3suHQF3ZJmxFJQV9nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696552627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PXq46dIALsBef+B0HGwu2HWBJJgwGDOu2bjfT1DfNY4=; b=EfF+9XbB0nRtYIv5Wh+tmu/7u2/h20WP6JuP9WxW6SzlNBIjMlHs/ULKoCqF1ZbX/Iv/6w 1iq8JiZrE2I2JNC4b4dxAEPBm6TTakVIffaSt07x4iVRFbMRjXw+FEmkJBI2kaqoJ6jqAG hotkmmO++tEXCDLZtR7MLoJKDTVgzhGrK9pPfMSbMI3LRb9B4F02j0XA2wUhc9PAHHgiNG CKo9yqkMoF+qOPUQ0dNfcr2WQ2w/yIaP+aHdyy4m0YyU9hScAnW3NDjB+Tc9RWkJSFjOxS AziQzZxIEEXRsfSoqr22546tLvKg+sFMqRGfXjteVE50KO67ZLyzzBZxnqHiJQ== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4S1qJ260Xqz142h for ; Fri, 6 Oct 2023 00:37:06 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: Date: Thu, 5 Oct 2023 19:37:00 -0500 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: serial port question Content-Language: en-US To: questions@freebsd.org References: From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 10/5/23 19:28, paul beard wrote: > Not strictly FreeBSD-based but adjacent, surely… > > I have a 3D printer that has a serial port connection through USB but > it's not working through the various apps that obscure the details in > the name of "convenience." You know what I mean. I like convenience as > much as anyone but sometimes I just have to get on with it. Does anyone > have experience in communicating with really simple machines over a > serial connection? It's not always easy to ID the serial device but > that's a separate problem. Allegedly I can communicate up to 115k but > I'll settle for a lot less to send simple commands like M502 or M500. > Right, I've had to hack a good amount of related software to handle the BSD-convention of naming serial lines. Unfortunately a lot of them like to filter through /dev looking specifically for ttyUSB* and thus, won't notice the cuaU* devices that we use. Usually it's as simple as that; they'll generally just use termios and it all basically just works if you can change the pattern or explicitly specify the /dev/path. IIRC there's one caveat that they're usually used to the Linux way of configuring baud rate and really want a B* constant for the baud rate they're trying to set, but we're a little more casual and explicitly guarantee in tcsetattr(3) that we're just mapping those constants 1:1 -- i.e., some of the constants they use in Linux can just be defined to the integer equivalent and they'll likely Just Work(TM). Thanks, Kyle Evans