LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   /dev/ttyUSB0 permissions (http://www.linuxquestions.org/questions/slackware-14/dev-ttyusb0-permissions-489878/)

joegumbo 10-06-2006 12:08 AM

/dev/ttyUSB0 permissions
 
Hi,

I'm trying to sync my Palm in Slackware 10.2. I "think" I have most issues worked out. (I've installed Pilot-Link and JPilot.) The hang up seems to be on my permissions. When I try to connect through ttyUSB0, I get a message in console "Permission Denied." I tried logging in as root, chmod +x /dev/ttyUSB0, then opening another console tab and starting JPilot...I still get "Permission Denied."

Thanks,
_Joe

gbonvehi 10-06-2006 12:13 AM

+x = execute
+w = write
+r = read

joegumbo 10-06-2006 10:09 AM

When I use +r, I get "No such file or directory." But, when I press the "Sync" button on my palm pilot, I receive the following output:

root@localhost:~# !34
tail -f /var/log/messages
Oct 7 10:01:29 localhost kernel: usb.c: registered new driver serial
Oct 7 10:01:29 localhost kernel: usbserial.c: USB Serial support registered for Generic
Oct 7 10:01:29 localhost kernel: usbserial.c: USB Serial Driver core v1.4
Oct 7 10:01:29 localhost kernel: usbserial.c: USB Serial support registered for Handspring Visor / Treo / Palm 4.0 / Clié 4.x
Oct 7 10:01:29 localhost kernel: usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter detected
Oct 7 10:01:29 localhost kernel: usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
Oct 7 10:01:29 localhost kernel: usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
Oct 7 10:01:29 localhost kernel: usbserial.c: USB Serial support registered for Sony Clié 3.5
Oct 7 10:01:29 localhost kernel: usbserial.c: USB Serial support registered for Sony Clié 5.0
Oct 7 10:01:29 localhost kernel: visor.c: USB HandSpring Visor, Palm m50x, Treo, Sony Clié driver v1.7

I admit I'm lost here. In other distros, I simply used /dev/ttyUSB0 or /dev/ttyUSB1 or /dev/ttyUSBwhatever and everything worked just fine. I've tried every possible combo I can think of with this, and I still cannot get this to link with either JPilot or KPilot.

-Joe

dracolich 10-06-2006 10:25 AM

As root run chmod 666 /dev/ttyUSB0 and/or ttyUSB1. If your using a 2.6 kernel with udev you should make a rule to do this during detection. And, if you need, I could post mine for you to use as a model.

joegumbo 10-06-2006 11:46 AM

Hi dracolich!

That absolutely did it. I can sync now.

Thank you!
-Joe




Hi gbonhevi!

I didn't know about +r and +w. I'll make a note of it.

Thanks,
-Joe

gbonvehi 10-06-2006 08:56 PM

In case anyone ends here, the letters are actually a "wrap" for the numbers, they do the same thing.
1 = +x = execute
2 = +w = write
4 = +r = read

3 = 1 + 2 = +xw = execute + write
5 = 1 + 4 = +xr = execute + read
6 = 4 + 2 = +wr = write + read
7 = 1 + 2 + 4 = +xwr = execute + write + read

I guess you get the point :)

And if you are not on the subjects of permission, you may wonder why a 6 three times?
The first number belongs to the user owning the file, the second to the group the file belongs to, and the third to other users.
So with chmod 666 /dev/ttyUSB0 you gave that file read and write permissions to everyone, the owner, the group and other users.

What you did, was to give that file write and read permissions which is what the program needs to be able to sync with your Palm.

neil bradshaw 03-11-2013 06:23 PM

USB to serial in UBUNTU
 
I just went though the process and wrote a procedure as I went. So all the information is all in one place if you need to find it.
I am using Ubuntu 12.10 and needed to use a Mercer USB to serial device which uses the common prolific PL2303 chip-set for USB to serial conversion - (it won't work on windows machines for more than five minutes before windows decides to change the driver and then it won't work anymore - can't un-install or go back, windows some how gets fixated on not making it work any more!)

Neils USB to serial procedure in Ubuntu

linking the serial to the USB didn't work for me --- sudo ln -s /dev/ttyUSB0 /dev/ttyS0


To get prolific USB to serial working on Ubuntu
1. plug in (Ubuntu seemed to have the driver already?? so no work here and it wasn't me either)
2. term->dmseg and check the prolific is OK on dev/ttyUSB0 and I quote from my term:
[40147.546268] USB Serial support registered for pl2303
[40147.546297] pl2303 2-1.1:1.0: pl2303 converter detected
[40147.548045] usb 2-1.1: pl2303 converter now attached to ttyUSB0
3. you don't have access to the ports unless you are super user so change the permissions from the term line read below:

---- sudo chmod 666 /dev/ttyUSB0

(Permissions explanation attributed to "gbonvehi")

BEGINING of explanation:

In case anyone ends here, the letters are actually a "wrap" for the numbers, they do the same thing.
1 = +x = execute
2 = +w = write
4 = +r = read

3 = 1 + 2 = +xw = execute + write
5 = 1 + 4 = +xr = execute + read
6 = 4 + 2 = +wr = write + read
7 = 1 + 2 + 4 = +xwr = execute + write + read

I guess you get the point

And if you are not on the subjects of permission, you may wonder why a 6 three times?
The first number belongs to the user owning the file, the second to the group the file belongs to, and the third to other users.
So with chmod 666 /dev/ttyUSB0 you gave that file read and write permissions to everyone, the owner, the group and other users.

What you did, was to give that file write and read permissions which is what the program needs.

END of explanation

4. Go to dash and run 'serial port terminal' if you have it - download from the software center if not
5. error "Cannot open /dev/ttyS0: Permission denied"
6. ignore this as we aren't opening the serial port but the USB port
7. mouse over top bar on the whole PC screen and see the menus for serial port terminal
8. configuration>port>/dev/ttyUSB0
9. configuration>save as default so it remembers the change as normal default setting!!

Or use Moserial
1.follow above steps
2.then run Moserial instead of serial port term
3.set ttyUSB0 at the bottom of the tty list!
4.put a small screw in between pins 2 and 3 of the converter to do a loop back test
5.now change the settings and un-tick the hardware handshake as the data can't be received with out the handshake normally and with one screw only the transmit and receive pins are bridged!
6. send "hello world" send>
7. i hope that your received hello world in the receive box!!

If you want to you can now also access the serial port through virtualbox with a virtual winxp installation. Virtualbox is free so install it and then run it and install windows XP inside it this part is the easy bit and well documented on the web.....

1. Close down winXP image so you can change the settings for winXP image in the Virtualbox settings
2. Virtualbox settings for configuring the winXP go >Settings>USB port>
Set the port mode to Host device then go path>/dev/ttyUSB0
This maps the USB port of the Ubuntu to the com port 1 of the winXP image! Cool!

3. Run the winXP image by pressing the green arrow or double clicking the image
4. in winXP start>all programs>accessories>communications>hyperterminal put in dummy area code and start an new project choose COM1 and don't use hardware flow control (set it to none since a pin2-3 loop-back test does not have hardware flow control pins) put the screw back between pins 2 and 3 of the USB to serial converter (pins 2 and 3 are the transmit and receive so they can't be shorted out)
Type something and the characters will appear in the terminal (the echo chars locally settings is not ticked normally so this means the loop-back test worked – confirm this by removing the screw and typing again – the text won't print as you type so there it working!)

Regards

Neil Bradshaw


All times are GMT -5. The time now is 10:09 PM.