Re: Port devel/arduino serial port problems [SOLVED]
On 03/13/13 21:56, Arthur Chance wrote: I'm trying to get devel/arduino working.[snip] I shouldn't work 13 hour days. Now I've had some sleep, I've spotted what I missed last night. The underlying code from comms/rxtx is trying to create a lock file in /var/spool/lock and that is only writeable by user uucp and group dialer. Given that I have absolutely no serial devices (or ports) on this box apart from the Arduino when it's plugged in, can anyone see any problems with making the lock directory world writeable? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Port devel/arduino serial port problems [SOLVED]
On Thu, 14 Mar 2013 08:48:22 +, Arthur Chance wrote: On 03/13/13 21:56, Arthur Chance wrote: I'm trying to get devel/arduino working.[snip] I shouldn't work 13 hour days. Now I've had some sleep, I've spotted what I missed last night. The underlying code from comms/rxtx is trying to create a lock file in /var/spool/lock and that is only writeable by user uucp and group dialer. Given that I have absolutely no serial devices (or ports) on this box apart from the Arduino when it's plugged in, can anyone see any problems with making the lock directory world writeable? Simply add your user (or the account the program is running under) to the dialer group. This has been a common method to allow users to access dialing programs (which were reserved for root use without this group addition). -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Port devel/arduino serial port problems [SOLVED]
On 03/14/13 13:08, Warren Block wrote: On Thu, 14 Mar 2013, Polytropon wrote: On Thu, 14 Mar 2013 08:48:22 +, Arthur Chance wrote: On 03/13/13 21:56, Arthur Chance wrote: I'm trying to get devel/arduino working.[snip] I shouldn't work 13 hour days. Now I've had some sleep, I've spotted what I missed last night. The underlying code from comms/rxtx is trying to create a lock file in /var/spool/lock and that is only writeable by user uucp and group dialer. Given that I have absolutely no serial devices (or ports) on this box apart from the Arduino when it's plugged in, can anyone see any problems with making the lock directory world writeable? Simply add your user (or the account the program is running under) to the dialer group. This has been a common method to allow users to access dialing programs (which were reserved for root use without this group addition). This is also mentioned when the Arduino port is installed: To allow serial port locking, add your user to the dialer group: pw usermod myuser -G dialer Warren and Polytropon, thanks. I realised that this morning and added myself to dialer. I'd originally thought the requirement for dialler group was simply to access /dev/cuaU0 and wrote a devd.conf file to set that as mode 666. It was only after catching up with my sleep I thought of lock files. However, my point was a little more general than just fixing this specific access problem - many desktop machines these days don't have serial lines or any need for dialer programs, and adding yet another group to an ever increasing list just so that I can talk to an Arduino seems a little redundant. (As does using /var/spool/lock - isn't that what /dev/cuaU0.lock is for?) For anyone else thinking of playing with Arduinos on FreeBSD, this bug http://www.freebsd.org/cgi/query-pr.cgi?pr=163749 in avrdude bit me (on a 9.1-RELEASE-p1 amd64 machine, talking to an Arduino Uno R3). The second patch (patch-arduino.c) fixed the problem, but it's a shame it's not included in the port 14 months after it was submitted. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Port devel/arduino serial port problems [SOLVED]
On Thu, 14 Mar 2013 14:59:12 +, Arthur Chance wrote: However, my point was a little more general than just fixing this specific access problem - many desktop machines these days don't have serial lines or any need for dialer programs, and adding yet another group to an ever increasing list just so that I can talk to an Arduino seems a little redundant. Remember that this group isn't _that_ new, it has its own historical value. :-) Furthermore, if you consider PPPoE, what are you actually doing? You're _dialing_ (not with a phone number, not even through the serial port, but utilizing means of PPP) with your modem connected by an Ethernet cable. This mechanism also requires root privileges, except you are in the dialer group. :-) http://www.freebsd.org/doc/faq/serial.html (As does using /var/spool/lock - isn't that what /dev/cuaU0.lock is for?) No, those are actual devices, see man 4 uart for details. The subtree /var/spool is primarily used for things like mail and printer subsystems. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org
Re: Serial Port Problems (Solved)
On Thu, 2007-03-01 at 15:27 -0600, Dan D Niles wrote: If I disconnect and come back later (sometimes), or if I hit return without entering a login name (always) it starts spitting out junk like: nooo~:Woo{;6(|uww~now~nou})|t}}t9- I found a solution, although I'm not sure why it works. When you just hit enter getty goes back to the beginning of its loop. This also happens if you enter a name starting with - or consisting of just spaces. These also causes the output to become garbled. At the beginning of the loop it calls setttymode(0). If I insert a sleep(1) before this call, everything works correctly. If I insert the sleep after that, the output still gets garbled. Like I said, I don't know why it works, but it does. I don't think a short delay is unreasonable after entering invalid or no information. I am going to submit a PR with a patch. I have the same behavior as you do on some machines here. But I originally thought it was caused by the (old) serial port card I used to build a serial console server. The card is an EasyIO PCI 8-port card from Stallion Technologies as suggested by Gregory Bond's article Console Server from http://www.freebsd.org/doc/en_US.ISO8859-1/articles/console-server/index.html (BTW, don't buy this card today because it's driver was not ported from FreeBSD 4.x to neither 5.x nor 6.x.) That being said, I checked /usr/src/libexec/getty/main.c to find out how to recreate your fix. But I'm not a huge C programmer, so I tried other ways to solve this. That brought me to gettytab(5) which says that the de field controls the delay secs and flush input before writing first prompt as the man page puts it. So I changed a test machine's gettytab default entry from: default:\ :cb:ce:ck:lc:fd#1000:im=\r\n%h (%t)\r\n\r\n:sp#1200:\ :if=/etc/issue: To: default:\ :cb:ce:ck:lc:fd#1000:im=\r\n%h (%t)\r\n\r\n:sp#1200:\ :if=/etc/issue:de=2: And restarted (not sure if a reboot is necessary here?). I had to fiddle a bit with the delay, but it did help. HTH, David -- David Robillard UNIX systems administrator Oracle DBA CISSP, RHCE Sun Certified Security Administrator Montreal: +1 514 966 0122 ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Serial Port Problems (Solved)
On Fri, 2007-03-16 at 11:16 -0400, David Robillard wrote: That being said, I checked /usr/src/libexec/getty/main.c to find out how to recreate your fix. But I'm not a huge C programmer, so I tried other ways to solve this. I submitted a bug report and patch, but it has not been accepted yet. I'm not even sure that it has been reviewed. I'll attach my patch to this message. That brought me to gettytab(5) which says that the de field controls the delay secs and flush input before writing first prompt as the man page puts it. This puts a delay before the first prompt but not the prompts after entering a null login name or other invalid input. It could help if you were having problems with garbled output all the time not just after invalid input. If that is the case, you probably need to set de and use my patch. Dan --- libexec/getty/main.c.orig Tue Mar 6 15:55:35 2007 +++ libexec/getty/main.cTue Mar 6 15:58:06 2007 @@ -295,6 +295,8 @@ /* remove any noise */ (void)tcflush(STDIN_FILENO, TCIOFLUSH); } + if (!first_sleep) + sleep(1); first_sleep = 0; setttymode(0); @@ -376,6 +378,7 @@ continue; if (name[0] == '-') { puts(user names may not start with '-'.); + oflush(); continue; } if (!(upper || lower || digit)) { ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Serial Port Problems (Solved)
On Thu, 2007-03-01 at 15:27 -0600, Dan D Niles wrote: If I disconnect and come back later (sometimes), or if I hit return without entering a login name (always) it starts spitting out junk like: nooo~:Woo{;6(|uww~now~nou})|t}}t9- I found a solution, although I'm not sure why it works. When you just hit enter getty goes back to the beginning of its loop. This also happens if you enter a name starting with - or consisting of just spaces. These also causes the output to become garbled. At the beginning of the loop it calls setttymode(0). If I insert a sleep(1) before this call, everything works correctly. If I insert the sleep after that, the output still gets garbled. Like I said, I don't know why it works, but it does. I don't think a short delay is unreasonable after entering invalid or no information. I am going to submit a PR with a patch. Dan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]