Site Logo

 
It is currently Fri Nov 21, 2014 4:29 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Arduino question
PostPosted: Mon Jan 09, 2012 2:49 pm 
Offline

Joined: Sun Jan 31, 2010 2:34 pm
Posts: 65
I have been playing around with controlling arduino i/o via the web & php. Something like this:

http://www.bushveldlab.com/Bushveld_Lab ... buntu.html

Everything seems to work ok but I have one issue. The arduino IDE need to be running with the serial console open (before I start apache btw). If I just load the code into the arduino, connected to the usb port of my computer (no IDE running) the php page just hangs.

My goal would be to just plug in the arduino to the computer and be able to manipulate the i/o via the php code. What am I doing wrong?


Top
 Profile  
 
 Post subject: Re: Arduino question
PostPosted: Mon Jan 09, 2012 3:59 pm 
Offline
Site Admin
User avatar

Joined: Sun Jan 11, 2009 6:35 pm
Posts: 861
I thinks it has something to do with that command not actually opening up the serial port. Which seems strange, I have had issues on windows machines sharing the same serial connection (the same setup on a mac didn't have any problems), in this case you could try opening up the serial port in the bash and see if that does it then you can point to the php code not working correctly.

On a side note I am attempting to do something similar although a bit more complicated, running node.js on a local host to create a server which will return the current values of the serial information if asked for.

I am doing it using:
node.js
serialnode
and javascript,

The problem is that I don't have that don't know node.js or javascript. :)

I have also had success with pyserial I have an arduino project up on google code using this here.


Top
 Profile  
 
 Post subject: Re: Arduino question
PostPosted: Mon Jan 09, 2012 10:17 pm 
Offline
User avatar

Joined: Fri Feb 05, 2010 10:35 pm
Posts: 71
call me crazy but from what I can recall the arduino doesn't use cr or nl. They also changed the general usage of serial in 1.0. Could be an issue. IDK,,,just throwing a grenade and hoping it hits.

_________________
"insert something witty here"


Top
 Profile  
 
 Post subject: Re: Arduino question
PostPosted: Tue Jan 10, 2012 6:28 am 
Offline
User avatar

Joined: Sat Apr 23, 2011 11:07 am
Posts: 189
Can you confirm /dev/ttyusb0 exists and that www-data has rw permissions before starting the ide? Using moserial, screen, or similar will help diagnose serial problems. If you're successful, then the permissions or php library is the culprit. I am assuming Ubuntu...?


Top
 Profile  
 
 Post subject: Re: Arduino question
PostPosted: Tue Jan 10, 2012 8:31 am 
Offline
Site Admin
User avatar

Joined: Sun Jan 11, 2009 6:35 pm
Posts: 861
@smittex that does happen, the usb serial drive does change upon plugging in and out of usb of the arduino (sometimes), and I am assuming the startup state of ubuntu as well, I have had issues with that happening.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL Flash Games