From nobody Thu Mar 10 07:47:42 2022 X-Original-To: freebsd-arm@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 8BD7E19FA134 for ; Thu, 10 Mar 2022 07:47:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KDh4X5B4cz4SyC for ; Thu, 10 Mar 2022 07:47:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6009D26062A; Thu, 10 Mar 2022 08:47:54 +0100 (CET) Message-ID: <60f98b10-dcdc-cdf4-3d7a-fe9fd4dff223@selasky.org> Date: Thu, 10 Mar 2022 08:47:42 +0100 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Raspberry Pi 3B USB Printing Issue Content-Language: en-US To: Archimedes Gaviola Cc: freebsd-arm@freebsd.org References: <7c67118e-f6ec-c87d-9a81-3ee6a5952f49@selasky.org> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KDh4X5B4cz4SyC X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.20 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-0.92)[-0.925]; MLMMJ_DEST(0.00)[freebsd-arm]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Status: O Content-Length: 2845 Lines: 80 On 3/10/22 00:24, Archimedes Gaviola wrote: > On Thu, Mar 10, 2022 at 4:14 AM Hans Petter Selasky wrote: > >> On 3/9/22 18:55, Archimedes Gaviola wrote: >>> Hi, >>> >>> I have an Epson printer connected to one of the USB ports of my RPi 3B. >> The >>> printer is detected as a ugen(4) driver and then I have a text file - >>> myfile3.txt which contains 10 lines of repeating sentences. >>> >>> freebsd@generic:~ % dmesg | grep EPSON >>> ugen1.4: at usbus1 >>> >>> freebsd@generic:~ % cat myfile3.txt >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> The quick brown fox jumps over the lazy dog. >>> >>> freebsd@generic:~ % cat myfile3.txt > /dev/usb/1.4.1 >>> >>> I print the file successfully through device file redirection with cat >>> command as described above. However, there were times that printing >> seemed >>> to suspend and withhold especially when my RPi 3B system got idle for >> some >>> period of time. Suspended or withhold in such a way that out of the 10 >>> lines there were only 2-3 lines to be printed in the paper. So, the only >>> remedy I have for now is to reboot the system to be able to get back to >>> normal printing. I'm using the 14.0-CURRENT #0 main-n253384-45c23c2608e: >>> Thu Feb 24 09:18:58 UTC 2022 and my RPi 4B does not manifest this >> behavior >>> using this same 14.0-CURRENT version. Any idea what's going on? >>> >>> I found these sysctl knobs thinking if some tweaks would help but not >> sure >>> what are the exact settings beyond these defaults. >>> >>> hw.usb.timings.port_resume_delay: 40 >>> hw.usb.timings.port_powerup_delay: 300 >>> hw.usb.timings.port_reset_recovery: 10 >>> hw.usb.timings.port_root_reset_delay: 200 >>> hw.usb.timings.port_reset_delay: 50 >>> >>> (Resend this message without dmesg and sysctl outputs as files are quite >>> big, sorry I didn't notice it.) >>> >> >> Hi, >> >> Why are you not using /dev/ulpt ? >> >> /dev/usb/1.4.1 is the raw BULK endpoint. >> > > > Hi Hans, > > The ulpt(4) driver isn't detected with this Epson printer. Only my other > printer which is an Xprinter brand is able to get detected with ulpt(4). > Hi, Is it correctly detected if you the VID and PID to /usr/src/sys/dev/usb/serial/ulpt.c ? When you use the printer via the BULK endpoint, there might be a missing flush packet, to flush all the printed text. This happens when the payload length is a multiple of the wMaxPacketSize. --HPS