Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: node_server example

  1. #11
    Join Date
    Apr 2015
    Location
    Austin, Texas
    Posts
    17
    Images
    15
    Rep Power
    7

    Re: node_server example

    Quote Originally Posted by oesile View Post
    Yes, you are right, there is missing a file, also I couldn't find the file even in the 20 century repo. That is why am waiting for Karl's example. He will push the code soon (I hope).
    I was in touch with them, and Andrew said that they won't be posting that because it shouldn't require that. He said he is going to look into it this evening. Apparently, that's some legacy code that's just floating around. I don't see how, but yeap -- a code check-in will fix it. In the mean time, however, you can still use the express.js calls directly. You might want to extend them a bit though.

  2. Re: node_server example

    What changes would be needed in app.js to run the file properly? A list of all the commands that can be called? Where is express.js located in the code?

  3. #13
    Join Date
    Apr 2015
    Location
    Austin, Texas
    Posts
    17
    Images
    15
    Rep Power
    7

    Re: node_server example

    OK, I think I will just push my code changes sometime in the next day or two. Then you should be able to use the demo code. Sorry, I'd push right away but I just threw out my Edison and put in the Pi and started redoing everything.

    To the community developers :: There are a lot of missing blanks in the code, and the Trossen guys are doing their best to keep up with us but I think the code is something we as a community can help the Trossen team with. So if we have code, I think it would be great if we could chip-in.

    To the Trossen guys: Can we push changes, or do you want us to fork and create a branch for the changes?

  4. #14
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,197
    Images
    952
    Rep Power
    133

    Re: node_server example

    I'd prefer a fork/branch rather than direct pushes.

    FYI, there is some incorrect or unclear info being tossed around in this thread. The legacy code is there but it's not interfering with any functionality.

    The node_server & hello_world demos work just fine on the backend without code modification, but do require Action Page remapping as they're a bit outdated. But in terms of the actual backend functionality, everything works fine.

    The missing piece of the puzzle is the hello_world webpage demo code (currently on a private repo) that I only opened to those that were in the last Hangout.

    I will be cleaning this up a bit and pushing a public repo this week, which should help people get started on it.
    Andrew Dresner
    Principal Engineer
    Interbotix GIthub
    Interbotix Labs Google+

  5. #15
    Join Date
    Apr 2015
    Location
    Austin, Texas
    Posts
    17
    Images
    15
    Rep Power
    7

    Re: node_server example

    I hear ya, I'd make the same call.

    IMHO, we should standardize the pages on app.js, instead of hardcoding it as it is right now.

    For e.g., in my setup, I basically have the system populate its page-action entires by having the code figure out what pages are valid and invalid. To achieve this, there are some minimal app.js and its co-joined C api wrapper code to change a little bit. But at least the framework code itself doesn't have to be touched. The modified C wrapper code basically returns a list of valid page names, and their corresponding #s to app.js during app.js' initialize phase. This way, app.js doesn't have to be hardcoded with the list of valid pages and their associated page #s. The benefit of doing the above is that you can also call the system to just execute pages by names, instead of #s.

    I'm tired, sorry if the above requires clarification. Ping me if anyone needs me to be more clear(er).


    Cheers,
    vj.
    Last edited by jveejay; 06-04-2015 at 12:31 AM.

  6. Re: node_server example

    Hi all,

    I'm very much a beginner to Linux. I'm trying to get nodeserver installed and functional on an HR-OS1 but I keep running into this issue:

    Fresh HR-OS1 Framework install on Raspberry Pi

    cd node_server/
    cd api_wrapper/
    sudo make
    cd ..
    sudo npm install
    node app.js

    Output:
    module.js:338
    throw err;
    ^
    Error: Cannot find module '/home/pi/HROS1-Framework/Linux/project/node_server/app.js'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

    I also get this when attempting to run grunt
    -bash: grunt: command not found

    Thanks for any help!

  7. #17
    Join Date
    Mar 2015
    Location
    Texas
    Posts
    342
    Images
    15
    Rep Power
    26

    Re: node_server example

    Looking at the directory structure on git it looks like the app.js file is located in the ./src/ directory ( https://github.com/Interbotix/HROS1-...ver/src/app.js )

    What happens when you try:
    Code:
    cd /home/pi/HROS1-Framework/Linux/project/node_server/src/
    node app.js
    01001001001000000100110001101111011101100110010100 10000001010010011011110110001001101111011101000111 0011

    My Instagram
    My YouTube

  8. Re: node_server example

    Thank you for your reply!

    the output is:

    module.js:338
    throw err;
    ^
    Error: Cannot find module 'merge-descriptors'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/pi/HROS1-Framework/Linux/project/node_server/node_modules/express/lib/express.js:16:13)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

    Thanks again

  9. #19
    Join Date
    Mar 2015
    Location
    Texas
    Posts
    342
    Images
    15
    Rep Power
    26

    Re: node_server example

    Sounds like node is missing a required module. Have you tried to install merge-descriptors?

    Code:
    npm install merge-descriptors
    01001001001000000100110001101111011101100110010100 10000001010010011011110110001001101111011101000111 0011

    My Instagram
    My YouTube

  10. #20
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    3,197
    Images
    952
    Rep Power
    133

    Re: node_server example

    Yeah, something changed with recent updates to node.js (I believe) that broke the current implementation of node server. Working on a fix.
    Andrew Dresner
    Principal Engineer
    Interbotix GIthub
    Interbotix Labs Google+

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •