kenmozi / php-serial

Automatically exported from code.google.com/p/php-serial
0 stars 0 forks source link

ttyACM* devices not supported... #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
 1. Create a symbolic link to /dev/ttyACMx (or modify php-serial source to use /dev/ttyACMx) 
 2. Use new phpSerial, deviceSet("COMx"), deviceOpen('w+'), stream_set_timeout($serial->_dHandle, 10)... as required.
 3. Use sendMessage(... more than once to see garbled data out.

What version of the product are you using? On what operating system?

 * r12 on Linux

Please provide any additional information below.

 * I'm suggesting the addition of new function (see attachment)
  * The function could be better. Eg. OS detection

Original issue reported on code.google.com by W8M2Hg9l...@gmail.com on 28 Feb 2012 at 11:23

Attachments:

GoogleCodeExporter commented 8 years ago
Having the same problem. I tried a lot. Tried to control Arduino through 
serial. Have Ubuntu Linux 12.04 with latest updates installed. And using the 
latest version of php-serial.

Original comment by Intermed...@gmail.com on 3 Aug 2012 at 6:03

GoogleCodeExporter commented 8 years ago
hello ,
https://bbs.archlinux.org/viewtopic.php?id=133920
i have same problem as in above link.. and mawmillar is able to access serial 
port with php .

detail of my system
system: Linux raspberrypi 3.2.27+ 
apache vesrion : Apache/2.2.22 (Debian)
php version : 5.4.4-11

pi@raspberrypi ~ $ sudo php /var/www/example.php
PHP Warning:  Specified serial port is not valid in 
/var/www/php_serial.class.php on line 141
PHP Warning:  Unable to set the baud rate : the device is either not set or 
opened in /var/www/php_serial.class.php on line 234
PHP Notice:  Use of undefined constant none - assumed 'none' in 
/var/www/example.php on line 12
PHP Warning:  Unable to set flow control mode : the device is either not set or 
opened in /var/www/php_serial.class.php on line 422
PHP Warning:  The device must be set before to be open in 
/var/www/php_serial.class.php on line 167
PHP Warning:  Device must be opened to read it in /var/www/php_serial.class.php 
on line 522
pi@raspberrypi ~ $

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)
Bus 001 Device 005: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 
LTE/UMTS/GSM Modem/Networkcard

pi@raspberrypi ~ $ ls /dev/tty*
/dev/tty    /dev/tty13  /dev/tty19  /dev/tty24  /dev/tty3   /dev/tty35  
/dev/tty40  /dev/tty46  /dev/tty51  /dev/tty57  /dev/tty62    /dev/ttyAMA0
/dev/tty0   /dev/tty14  /dev/tty2   /dev/tty25  /dev/tty30  /dev/tty36  
/dev/tty41  /dev/tty47  /dev/tty52  /dev/tty58  /dev/tty63    /dev/ttyprintk
/dev/tty1   /dev/tty15  /dev/tty20  /dev/tty26  /dev/tty31  /dev/tty37  
/dev/tty42  /dev/tty48  /dev/tty53  /dev/tty59  /dev/tty7     /dev/ttyUSB0
/dev/tty10  /dev/tty16  /dev/tty21  /dev/tty27  /dev/tty32  /dev/tty38  
/dev/tty43  /dev/tty49  /dev/tty54  /dev/tty6   /dev/tty8     /dev/ttyUSB1
/dev/tty11  /dev/tty17  /dev/tty22  /dev/tty28  /dev/tty33  /dev/tty39  
/dev/tty44  /dev/tty5   /dev/tty55  /dev/tty60  /dev/tty9     /dev/ttyUSB2
/dev/tty12  /dev/tty18  /dev/tty23  /dev/tty29  /dev/tty34  /dev/tty4   
/dev/tty45  /dev/tty50  /dev/tty56  /dev/tty61  /dev/ttyACM0
pi@raspberrypi ~ $

pi@raspberrypi ~ $ ls /dev/ttyACM0 -l
crwxrwxrwx 1 root dialout 166, 0 Mar  6 18:23 /dev/ttyACM0
pi@raspberrypi ~ $

pi@raspberrypi /etc $ sudo nano group
  GNU nano 2.2.6                                             File: group

root:x:0:www-data,asterisk,uucp
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:pi
tty:x:5:pi,root,www-data
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:pi,root,www-data
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:pi,asterisk,www-data,root
fax:x:21:
voice:x:22:
cdrom:x:24:pi
floppy:x:25:
tape:x:26:
sudo:x:27:pi
audio:x:29:pi,pulse,asterisk
dip:x:30:
www-data:x:33:asterisk,root,pi,uucp
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:pi
sasl:x:45:
plugdev:x:46:pi
staff:x:50:
games:x:60:pi
users:x:100:pi,www-data
nogroup:x:65534:
libuuid:x:101:
crontab:x:102:
pi:x:1000:uucp
ssh:x:103:
ntp:x:104:
netdev:x:105:pi
input:x:999:pi
messagebus:x:106:
lpadmin:x:107:
fuse:x:108:
lightdm:x:109:
pulse:x:110:
pulse-access:x:111:
rtkit:x:112:
asterisk:x:113:www-data
ssl-cert:x:114:
sambashare:x:115:

Could you please be so kind and give me a hint? I would really appreciated your 
support.
Thank you very much in advance.

Regards..
Mahendra
India.

Original comment by 143.mahe...@gmail.com on 6 Mar 2013 at 1:29

Attachments:

GoogleCodeExporter commented 8 years ago
now it works for me....

Original comment by 143.mahe...@gmail.com on 6 Mar 2013 at 2:16