You are not logged in.

#1 2012-01-19 22:24:32

mawmillar
Member
Registered: 2012-01-19
Posts: 3

[SOLVED] Arch linux -> serial php -> Arduino

I am trying to get php to access the serial port /dev/ttyACM0 using the php serial class "http://code.google.com/p/php-serial/sou … .class.php"

I am new to Arch but not linux.

I have PHP Version 5.3.8 installed and working on i686-pc-linux-gnu

I can access the serial port from the terminal using:

echo "some_text" > /dev/ttyACM0

but not with the serial class.

I have added http as a user to the uucp group, which did not work so I changed the permissions using:

chmod 777 /dev/ttyACM0

When running the php files from either the website or the terminal (even as sudo) I get the same error from the
"php_serial.class.php" >> "Unable to open device ......" and "Device most be opened ......".

I have been trying to figure this out for a few days now with no luck, so I tried the same files on my ubuntu server and everything worked fine.

I would like to try figure this out as I am keen to learn arch linux. I want to learn ARM CPU friendly OS for when the raspberry PI is launched.

Thanks in advance for any help.

Last edited by mawmillar (2012-01-22 13:26:07)

Offline

#2 2012-01-20 21:45:46

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: [SOLVED] Arch linux -> serial php -> Arduino

I'm not a php expert, but I bet you are having problems due to the settings in /etc/php.ini

open_basedir may be of some interest (not sure if it applies to serial devices)


Website - Blog - arch-home
Arch User since March 2005

Offline

#3 2012-01-21 04:01:04

LessWire
Member
From: Bavaria
Registered: 2010-06-14
Posts: 46

Re: [SOLVED] Arch linux -> serial php -> Arduino

Maybe a hint - the author commented:

//
        // OPEN/CLOSE DEVICE SECTION -- {START}
        //

        /**
         * Device set function : used to set the device name/address.
         * -> linux : use the device address, like /dev/ttyS0 ...

I would try to change "ttyS" to "ttyACM" in the code line following this comment.

Offline

#4 2012-01-22 13:21:02

mawmillar
Member
Registered: 2012-01-19
Posts: 3

Re: [SOLVED] Arch linux -> serial php -> Arduino

pyther Thanks for your help, as you suspected the problem was with the open_basedir option in /etc/php/php.ini

I can now access the serial port with no issues.

Offline

Board footer

Powered by FluxBB