Arduino question

Topics generally related to Twin Cities Maker activities
jrsphoto
Posts: 65
Joined: Sun Jan 31, 2010 2:34 pm

Arduino question

Postby jrsphoto » Mon Jan 09, 2012 2:49 pm

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?

User avatar
paulsobczak
Site Admin
Posts: 861
Joined: Sun Jan 11, 2009 6:35 pm
Contact:

Re: Arduino question

Postby paulsobczak » Mon Jan 09, 2012 3:59 pm

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.

User avatar
Happyk
Posts: 71
Joined: Fri Feb 05, 2010 10:35 pm

Re: Arduino question

Postby Happyk » Mon Jan 09, 2012 10:17 pm

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"

User avatar
smittex
Posts: 189
Joined: Sat Apr 23, 2011 11:07 am

Re: Arduino question

Postby smittex » Tue Jan 10, 2012 6:28 am

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...?

User avatar
paulsobczak
Site Admin
Posts: 861
Joined: Sun Jan 11, 2009 6:35 pm
Contact:

Re: Arduino question

Postby paulsobczak » Tue Jan 10, 2012 8:31 am

@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.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest

cron