php serial communication in linux

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

php serial communication in linux

prudhvi09
I have installed xampp in fedora 13.I am trying to communicate with microcontroller through serial port using php serial class.
My code is example.phpexample.php.On opening example.php through firefox the code is being displayed again as shown



Please help me
and is there any other way to communicate to serial port other thanphp class
thank you
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Edward Martinez
On 04/29/2012 07:35 AM, prudhvi09 wrote:

> I have installed xampp in fedora 13.I am trying to communicate with
> microcontroller through serial port using php serial class.
> My code is example.php
> http://fedora.12.n6.nabble.com/file/n4938590/example.php example.php .On
> opening example.php through firefox the code is being displayed again as
> shown  http://fedora.12.n6.nabble.com/file/n4938590/image.png
>
>
>
> Please help me
> and is there any other way to communicate to serial port other thanphp class
> thank you
>
> --
> View this message in context: http://fedora.12.n6.nabble.com/php-serial-communication-in-linux-tp4938590p4938590.html
> Sent from the Fedora List mailing list archive at Nabble.com.


      the best help one can get. ;-)

     
http://download.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-16-x86_64-Live-Desktop.iso
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

bruce-83
really..

you tell the guy to download a copy of f16...

and how the f does that help his issue?????

rant off...

hey ed, tell us/me more about what you're trying to accomplish. maybe
i can help on this.

let me know.


On Sun, Apr 29, 2012 at 5:03 PM, Edward M <[hidden email]> wrote:

> On 04/29/2012 07:35 AM, prudhvi09 wrote:
>>
>> I have installed xampp in fedora 13.I am trying to communicate with
>> microcontroller through serial port using php serial class.
>> My code is example.php
>> http://fedora.12.n6.nabble.com/file/n4938590/example.php example.php .On
>> opening example.php through firefox the code is being displayed again as
>> shown  http://fedora.12.n6.nabble.com/file/n4938590/image.png
>>
>>
>>
>> Please help me
>> and is there any other way to communicate to serial port other thanphp
>> class
>> thank you
>>
>> --
>> View this message in context:
>> http://fedora.12.n6.nabble.com/php-serial-communication-in-linux-tp4938590p4938590.html
>> Sent from the Fedora List mailing list archive at Nabble.com.
>
>
>
>     the best help one can get. ;-)
>
>
> http://download.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-16-x86_64-Live-Desktop.iso
>
> --
> users mailing list
> [hidden email]
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Edward Martinez
On 04/29/2012 02:22 PM, bruce wrote:

> really..
>
> you tell the guy to download a copy of f16...
>
> and how the f does that help his issue?????
>
> rant off...
>
> hey ed, tell us/me more about what you're trying to accomplish. maybe
> i can help on this.
>
> let me know.
>
>
> On Sun, Apr 29, 2012 at 5:03 PM, Edward M<[hidden email]>  wrote:
>> On 04/29/2012 07:35 AM, prudhvi09 wrote:
>>> I have installed xampp in fedora 13.I am trying to communicate with
>>> microcontroller through serial port using php serial class.
>>> My code is example.php
>>> http://fedora.12.n6.nabble.com/file/n4938590/example.php example.php .On
>>> opening example.php through firefox the code is being displayed again as
>>> shown  http://fedora.12.n6.nabble.com/file/n4938590/image.png
>>>
>>>
>>>
>>> Please help me
>>> and is there any other way to communicate to serial port other thanphp
>>> class
>>> thank you
>>>
>>> --
>>> View this message in context:
>>> http://fedora.12.n6.nabble.com/php-serial-communication-in-linux-tp4938590p4938590.html
>>> Sent from the Fedora List mailing list archive at Nabble.com.
>>
>>
>>      the best help one can get. ;-)
>>
>>
>> http://download.fedoraproject.org/pub/fedora/linux/releases/16/Live/x86_64/Fedora-16-x86_64-Live-Desktop.iso
>>
>> --
>> users mailing list
>> [hidden email]
>> To unsubscribe or change subscription options:
>> https://admin.fedoraproject.org/mailman/listinfo/users
>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>> Have a question? Ask away: http://ask.fedoraproject.org
     FYI: that is an EOL fedora release. I don't need to explain myself
further. if you don't know why using an
     EOL release  with no security updates is a bad idea go find it.

      http://fedoraproject.org/wiki/Fedora-EOL-Support
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Reindl Harald-2


Am 30.04.2012 00:18, schrieb Edward M:

>>> --
>>> users mailing list
>>> [hidden email]
>>> To unsubscribe or change subscription options:
>>> https://admin.fedoraproject.org/mailman/listinfo/users
>>> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>>> Have a question? Ask away: http://ask.fedoraproject.org
>     FYI: that is an EOL fedora release. I don't need to explain myself further. if you don't know why using an
>     EOL release  with no security updates is a bad idea go find it.
>
>      http://fedoraproject.org/wiki/Fedora-EOL-Support
basically you should learn to use you mailclient and keyboard
for removing useless quotes like mailing-list footer and
generally to try make your messages READABLE without force
others to search for the nail of your answer

yes, your hint that F13 is EOL is correct, but not only
with a braindead link to a recent LIVE-INSTALL and not
as only answer to "php serial communication in linux"


--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

signature.asc (270 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Edward Martinez
On 04/29/2012 03:17 PM, Reindl Harald wrote:
> basically you should learn to use you mailclient and keyboard
> for removing useless quotes like mailing-list footer and
> generally to try make your messages READABLE without force
> others to search for the nail of your answer
>
> yes, your hint that F13 is EOL is correct, but not only
> with a braindead link to a recent LIVE-INSTALL and not
> as only answer to "php serial communication in linux"


     Yeah... I agree I should off explained myself better.
      I was removing  stuff until somebody said i was
      quoting out of context. so I decided to leave the emails intact.
      However after reviewing the reply i think i should remove things out
:-)
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Edward Martinez
In reply to this post by bruce-83
On 04/29/2012 02:22 PM, bruce wrote:
> hey ed, tell us/me more about what you're trying to accomplish. maybe
> i can help on this.
>
> let me know.

    Sorry for my harsh reply. i'm suffering from seasonal
allergies/fever and
    that puts me in a bad mood.
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

prudhvi09
In reply to this post by prudhvi09
hey thanks a lot guys ..sorry to bother you again .

 i was opening the file directly from browser from the location htdocs ...i changed the file location to htdocs/xampp  and it has started executing but there are some warnings


 ... I have used the command : chmod 0777 /dev/ttyUSB0  to give permissions .  I have also tried to add the apache user "prudhvi" to the dialout group by using command : $ usermod -a -G dialout prudhvi .  

But it doesnt work  . I have used the "$whoami" to check name of user  and added that user "prudhvi" to the dialout group . It still doesnt work . Please help me guys.
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

prudhvi09
When I send a command directly from the terminal using the command : echo 1 > /dev/ttyUSB0 it works and '1' is transmitted to the serial port . But using php I get the above warnings . I dont understand where the problem is .  Is it a permissions issue ? If not what could be the problem ?
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Ed Greshko
On 04/30/2012 12:57 PM, prudhvi09 wrote:
> When I send a command directly from the terminal using the command : echo 1 >
> /dev/ttyUSB0 it works and '1' is transmitted to the serial port . But using
> php I get the above warnings . I dont understand where the problem is .  Is
> it a permissions issue ? If not what could be the problem ?

I've no experience with php    But, the error message....

Warning: Specified serial port is not valid in
/opt/lampp/htdocs/xampp/php_serial.class on line 147

would have me looking to see if what I think should be defined on line 147 is really
what is being defined.


--
Never be afraid to laugh at yourself, after all, you could be missing out on the joke
of the century. -- Dame Edna Everage
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Reindl Harald-2
In reply to this post by prudhvi09


Am 30.04.2012 06:57, schrieb prudhvi09:
> When I send a command directly from the terminal using the command : echo 1 >
> /dev/ttyUSB0 it works and '1' is transmitted to the serial port . But using
> php I get the above warnings . I dont understand where the problem is .  Is
> it a permissions issue ? If not what could be the problem ?

if SELinux is active i would not wonder that httpd can not access
the serial port, however - why are you installing a lammp package
under /opt while fedora has all the needed packages in the default repos?


--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

signature.asc (270 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

bruce-83
In reply to this post by prudhvi09
hey...

it appears you're running some sort of php script to access the serial
port, for some kind of communication test.

it also appears that you want to run the test from the browser.

here's my suggestion. forget the browser for time being.

get the test running from the cmdline.
ensure the app has the correct privs, as well as the correct user
 (i have no idea what that should be)
ensure that selinux isn't interfering
once this works as you expect it to, then you can modify whatever you need to,
 then you can get it running from the browser.



On Mon, Apr 30, 2012 at 12:44 AM, prudhvi09 <[hidden email]> wrote:

> hey thanks a lot guys ..sorry to bother you again .
>
>  i was opening the file directly from browser from the location htdocs ...i
> changed the file location to htdocs/xampp  and it has started executing but
> there are some warnings
> http://fedora.12.n6.nabble.com/file/n4939982/image.png
>
>  ... I have used the command : chmod 0777 /dev/ttyUSB0  to give permissions
> .  I have also tried to add the apache user "prudhvi" to the dialout group
> by using command : $ usermod -a -G dialout prudhvi .
>
> But it doesnt work  . I have used the "$whoami" to check name of user  and
> added that user "prudhvi" to the dialout group . It still doesnt work .
> Please help me guys.
>
> --
> View this message in context: http://fedora.12.n6.nabble.com/php-serial-communication-in-linux-tp4938590p4939982.html
> Sent from the Fedora List mailing list archive at Nabble.com.
> --
> users mailing list
> [hidden email]
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

prudhvi09
In reply to this post by Reindl Harald-2
i haveput SElinux in permissive mode and tried it dint work.
with the code below it worked
 <?php
echo "hi";
$fp=fopen("/dev/ttyUSB0","w+");
if(!$fp)
echo "Port could not be opened";
else
{ sleep(3);
echo "port has been opened";
$txt="*s";
fputs($fp,$txt);

fputs($fp,$txt);

fputs($fp,$txt);
>
Can u tell me why is it not working with serial class?
Reply | Threaded
Open this post in threaded view
|

Re: php serial communication in linux

Patrick Kobly
In reply to this post by prudhvi09
Probably because "COM14" is not a valid way to refer to a serial port in a Linux environment.


On 2012-05-01, at 12:02 AM, "prudhvi09" <[hidden email]> wrote:

> i haveput SElinux in permissive mode and tried it dint work.
> with the code below it worked
> <?php
> echo "hi";
> $fp=fopen("/dev/ttyUSB0","w+");
> if(!$fp)
> echo "Port could not be opened";
> else
> { sleep(3);
> echo "port has been opened";
> $txt="*s";
> fputs($fp,$txt);
>
> fputs($fp,$txt);
>
> fputs($fp,$txt);
>>
> Can u tell me why is it not working with serial class?
>
> --
> View this message in context: http://fedora.12.n6.nabble.com/php-serial-communication-in-linux-tp4938590p4942953.html
> Sent from the Fedora List mailing list archive at Nabble.com.
> --
> users mailing list
> [hidden email]
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org

--
users mailing list
[hidden email]
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org