can Adafruit Webide install on udoo, using node.js & python?

Discussion in 'General Discussion' started by rootScript, Mar 23, 2014.

  1. rootScript

    rootScript Member

    Joined:
    Jan 11, 2014
    Messages:
    44
    Likes Received:
    0
    I just watched some pretty amazing videos of Adafruit webide using python remotely to program a Rasberry Pi. Take a look at these four videos in Youtube playlist:
    https://www.youtube.com/watch?v=8NoiBBgaKCI&list=PL-LlPBnLDbkXlexNd2Vq8ipI_Y9fh_byi
    Now that got me thinking that we can use Udoo & node.js to manipulate GPIO etc..., Rasberry Pi & Udoo both run Linux, both run Python, so can this be installed on another single board computer like the Udoo.

    Then I found another Youtube video, showing setting up the Adafruit webide on Beaglebone Black:
    https://www.youtube.com/watch?v=MwQGXAlq3Cc
    If it can be installed on other 'single board computers', like Beaglebone Black, why can't we have something for Udoo?

    So even though I knew it would not work, I though I would try and see how far I could get.
    Here are Adafruit's instructions for getting setup on Rasberry Pi:
    Code:
    sudo apt-get update && sudo apt-get -y install build-essential nodejs nodejs-legacy npm redis-server git
    git clone git://github.com/adafruit/Adafruit-WebIDE.git
    cd Adafruit-WebIDE
    mkdir tmp
    npm config set tmp tmp
    npm install
    editor config/config.js (change port 80 to your port of choice)
    nodejs server.js
    Well I had to try a different way:
    Code:
    sudo su
    echo "deb http://ftp.us.debian.org/debian wheezy-backports main" >> /etc/apt/sources.list
    apt-get update
    sudo apt-get -y install build-essential nodejs nodejs-legacy npm redis-server git
    curl --insecure https://www.npmjs.org/install.sh | bash
    git clone git://github.com/adafruit/Adafruit-WebIDE.git
    cd Adafruit-WebIDE
    mkdir tmp
    npm config set tmp tmp
    npm install
    editor config/config.js (change port 80 to your port of choice)
    nodejs server.js
    I had errors at the end of the npm install todo with gnu, so a bit of googling blindly:
    Code:
    sudo apt-get install python g++ make checkinstall
    Now I still can't get node.js to run, and even if I could, Adafruit's webide would probably need to be changed to run python code that could access the Udoo GPIO etc...

    Now I I can see how good it would be to be able to program the udoo using python, over a local network, I think it would be worth it for anyone with more experience than me to take a look to see if it would be possible.
    I remember their were some other guys with node.js working on Udoo, So please take a look
    ;)
     
  2. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    How the GPIO's are accessed on the UDOO is pretty different than on the BBB or RPi. At a minimum that part would need to be modified to work.
     
  3. rootScript

    rootScript Member

    Joined:
    Jan 11, 2014
    Messages:
    44
    Likes Received:
    0
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    Can you expand on this, please?
    If you have any examples showing the differences, it would be great starting point ;)
     
  4. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    If you look at the Raspberry documentation on how to control the gpio pin using bash .

    Code:
    #!/bin/sh
    
    # GPIO numbers should be from this list
    # 0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25
    
    # Note that the GPIO numbers that you program here refer to the pins
    # of the BCM2835 and *not* the numbers on the pin header. 
    # So, if you want to activate GPIO7 on the header you should be 
    # using GPIO4 in this script. Likewise if you want to activate GPIO0
    # on the header you should be using GPIO17 here.
    
    # Set up GPIO 4 and set to output
    echo "4" > /sys/class/gpio/export
    echo "out" > /sys/class/gpio/gpio4/direction
    
    # Set up GPIO 7 and set to input
    echo "7" > /sys/class/gpio/export
    echo "in" > /sys/class/gpio/gpio7/direction
    
    # Write output
    echo "1" > /sys/class/gpio/gpio4/value
    
    # Read from input
    cat /sys/class/gpio/gpio7/value 
    
    # Clean up
    echo "4" > /sys/class/gpio/unexport
    echo "7" > /sys/class/gpio/unexport
    Sorry , but using the kernel sys/class/gpio method , doesn`t that look the same on the udoo ?
    eg page 28 on the manual

    Code:
    In the /sys/class/gpio/ folder there are other sub-folders, one for each manageable
    GPIO. Each sub-folder contains files that indicate:
    ● direction (in / out)
    ● value (0 / 1)
    To read a GPIO direction:
    cat /sys/class/gpio/gpioXX/direction
    In or Out output is now expected
    To change the pin direction:
    echo out > /sys/class/gpio/gpioXX/direction
    or
    echo in > /sys/class/gpio/gpioXX/direction
     
  5. rootScript

    rootScript Member

    Joined:
    Jan 11, 2014
    Messages:
    44
    Likes Received:
    0
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    Wow, that is very similar Peter.
    I remember seeing a .sh file on marchdvd.com for remapping the GPIO pins:
    UDOO alias pins for Due numbering http://marchdvd.com/?p=149
    That method gives us some flexibility in trying the squeeze it together, too I suppose.

    I wonder if the Adafruit webide uses a 'special' python, or library, or whether it is straight?
     
  6. peter247

    peter247 New Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    I guess the other method is direct access and change the cpu`s registers direct !!!!
    If they have gone that I guess it is locked to only one cpu , but don`t adafuilt say that it will also work on the beaglebone black ?.
     
  7. rootScript

    rootScript Member

    Joined:
    Jan 11, 2014
    Messages:
    44
    Likes Received:
    0
  8. rootScript

    rootScript Member

    Joined:
    Jan 11, 2014
    Messages:
    44
    Likes Received:
    0
  9. DracoLlasa

    DracoLlasa UDOOer

    Joined:
    Oct 15, 2013
    Messages:
    419
    Likes Received:
    3
    Re: can Adafruit Webide install on udoo, using node.js & pyt

    i know i have tried both the adafruit webide and also the cloud9 IDE that is used on the BBB, i was not able to get either to work, mostly node.js issues as you have seen.

    I have talked with the UDOO team about these things because i feel a web based IDE wither ala Adafruits WebIDE, Cloud9, or something similar would be a very nice step forward in advancing the usability of the UDOO. I know they felt the ideas were good also, so there might just be something in the future from them if the community doesn't make it work first (i dont speak for UDOO, so im not saying they are actually gonna do this, i really have no idea)..
    unfortunately its beyond my skill level to do so myself
     

Share This Page