[Gambas-user] OPEN DMX USB Failed to open with Serial Port

Ron Onstenk ronstk at ...239...
Fri Feb 8 18:01:59 CET 2008


On Friday 08 February 2008 03:14, 2020 wrote:
> 
> Hello folk,
> I tried to connect to a DMX USB device with Gambas 2.0 Serial Port example,
> but freeze wen I click on open (Button1).
> 
> http://www.nabble.com/file/p15348079/serialport_ss1.png 
> 
> The driver was loaded during my attempt;
> 
> [ 2088.929843] usb 1-8: new full speed USB device using ohci_hcd and address
> 7
> [ 2089.024217] usb 1-8: configuration #1 chosen from 1 choice
> [ 2089.025658] ftdi_sio 1-8:1.0: FTDI USB Serial Device converter detected
> [ 2089.025687]
> /build/buildd/linux-source-2.6.22-2.6.22/debian/build/custom-source-rt/drivers/usb/serial/ftdi_sio.c:
> Detected FT232BM
> [ 2089.025857] usb 1-8: FTDI USB Serial Device converter now attached to
> ttyUSB0
> 
> Any ideas, thanks in advance.
> 
> Sylvain.
> 
> 
> 

When USB devices are attached to the system, the hotplug event starts.
This will add the /dev/ttyUSB0 and set the rights/permission to root:root
You need it however as user and can add a configuration line to a
hotplug event script wich detect and mount the device to change this.

I have done something like this to add a POS display to tell me
from a php page the debug echo's durring development the php script.
Works from inside gambas too.

I hope next will help.


Ron


For me the device is called 'vfdisplay' on kubuntu 6.10

=======================================
rc.local
	chmod 777 /dev/ttyUSB0

This add to rc.local is done primair for other things.

====================================
I did add the following files to the rules.d
	25-vfdisplay.rules ( the name )
	45-vfdisplay.rules ( the permission )
	65-vfdisplay.rules ( the symlink )

The leading number is the group name=20/perm=40/symlnk=60 with 5 add by me
regarding the udev rules.


/etc/udev/rules.d
------------------
root at ...1311...:/etc/udev/rules.d# cat 25-vfdisplay.rules
# This file establishes the device names according to Ubuntu policy.
# See udev(8) for syntax.
#
# Permissions and ownership of devices must not be set here, but in
# 40-permissions.rules; user-friendly symlinks to devices should be
# set in 60-symlinks.rules.

# USB devices (usbfs replacement), group under /dev/bus/usb
SUBSYSTEM!="usb_device", GOTO="usb_device_end"
IMPORT{program}="usb_device_name --export %k"
ENV{USB_BUS}=="?*", ENV{USB_DEV}=="?*", \
        NAME="bus/usb/$env{USB_BUS}/$env{USB_DEV}"
LABEL="usb_device_end"

-------------------

root at ...1311...:/etc/udev/rules.d# cat 45-vfdisplay.rules
# This file establishes permissions and ownership of devices according
# to Ubuntu policy.  See udev(8) for syntax.
#
# The names of the devices must not be set here, but in 20-names.rules;
# user-friendly symlinks (which need no permissions or ownership) should
# be set in 60-symlinks.rules.

# Serial devices
KERNEL=="ttyUSB[0-9]*",                 GROUP="www-data", MODE="0660"

# USB devices (usbfs replacement)
SUBSYSTEM=="usb_device",                MODE="0664"
-------------------

root at ...1311...:/etc/udev/rules.d# cat 65-vfdisplay.rules
# This file establishes user-friendly symlinks to devices according to
# Ubuntu policy.  See udev(8) for syntax.
#
# The names of the actual devices themselves must not be set here, but
# in 20-names.rules; the permissions and ownership of those devices
# should be set in 40-permissions.rules.

# create /dev/vfdisplay symlink for vfdisplay
KERNEL=="ttyUSB*", SYSFS{product}=="USB-Serial Controller", \   <-----
                                        SYMLINK+="vfdisplay"



================================
root at ...1311...:/dev# ls -l /dev/ttyUSB0
crw-rw---- 1 root www-data 188, 0 2008-02-08 17:10 /dev/ttyUSB0


cat /var/log/vfdphp > /dev/ttyUSB0 shows the php log now






More information about the User mailing list