[noob] Learning to blink LED with web visitor

Discussion in 'General Discussion' started by routerboy309, Mar 2, 2015.

  1. routerboy309

    routerboy309 New Member

    Joined:
    Nov 29, 2013
    Messages:
    12
    Likes Received:
    2
    Hello

    Ok...a newbie here, so be gentle. :)

    I have a Dual UDOO with Apache and MySQL running smoothly (took a while, but learned a ton). I've learned how to "blink" an LED from the code posted on UDOo_Org on the Arduino side.

    I now want to learn how to get an LED to blink when a person visits a webpage that I have on my UDOO "server" . The code for the blink I'd like to use is like the simple code I found on this site:

    http://dimme.net/webvisitors-blinker/

    He's using a USB connection (serial) to a webserver, but I know we can do this internally with UDOO. I just can't get my head around the process. Can someone give me a clue on what I change his code to work with the UDOO serial code? I can't image its too hard, but I can't figure out what to add to the UDOO board to make this run.

    What goes in the head of PHP? What changes do I need to make on the Arduino side?

    I'm a visual person...so examples help me learn. :)

    TIA

    RB
     
  2. orfeus

    orfeus New Member

    Joined:
    Feb 25, 2014
    Messages:
    9
    Likes Received:
    0
    Hi im noob too, but it looks like you need to send "echo 1" to /dev/ttymxc3 ( check your serial port in Arduino IDE) and change permissions.

    Arduino code doesnt need to change.

    Good luck, leave some feedback
     
  3. routerboy309

    routerboy309 New Member

    Joined:
    Nov 29, 2013
    Messages:
    12
    Likes Received:
    2
    Hi

    Thanks for the message. No luck yet. :(

    The LED flashes once the UDOO reboots and never stops unless I load a different sketch. Its almost like no logic is being checked.

    How do we know what value the Serial port starts at? The way I read the code from the other website (WebVisitor Blinking LED) is the value of "val" starts at zero (0). But does the value of "val" go up when the commend following command is activated from the PHP page?:

    <?php exec("echo 1 > /dev/ttymxc3"); ?>

    TIA -

    RB
     
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there and welcome!
    there's a chance you need to grant the appropriate permission for the serial port to the PHP user.
    For example, take a look at this:
    https://github.com/UDOOboard/serial_lib ... master/php
    Here you should find useful resources to solve your issue.
    Andrea
     
  5. routerboy309

    routerboy309 New Member

    Joined:
    Nov 29, 2013
    Messages:
    12
    Likes Received:
    2
    OMG...what a great link!

    I guess when after I get this "project" running, I need to sharpen my searching skills. I searched and searched - and didn't see this link. :)

    Thank you,

    RB
     

Share This Page