Raspberry PI based ROV

Anything to do with the Raspberry Pi
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

Could you post a screenshot or screendump, please?
And if you can you config.js file
Louis_Cha
Posts: 26
Joined: Sep 9th, 2014, 5:36 am

Re: Raspberry PI based ROV

Post by Louis_Cha »

I can't remember what result it returned exactly, but from what I can remember it appeared to show the servo driver connected, I'll send a screenshot
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

If you are really stuck... you could try this image (needs a 8Gb SD card, works on Pi and Pi2)
https://www.dropbox.com/s/56700vdt8i1po ... v.zip?dl=0
Hindric
Posts: 2
Joined: Apr 8th, 2015, 4:09 pm

Re: Raspberry PI based ROV

Post by Hindric »

Hey Moki,
I am Stuck like Perfo...I think :)

I tried to follow all the additional steps listed in this topic, including what Perfo did to change the version to 0.10.0, I am unable to get the command "npm install ." to successfully work. here are the two errors I'm seeing (I have full log, let me know if you need it)

i2c.target.mk:81: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/root/Moki-ROV/node_modules/mcp3424/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.18.11-v7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/Moki-ROV/node_modules/mcp3424/node_modules/i2c
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok

AND

i2c.target.mk:81: recipe for target 'Release/obj.target/i2c/src/i2c.o' failed
make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
make: Leaving directory '/root/Moki-ROV/node_modules/i2c/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 3.18.11-v7+
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/Moki-ROV/node_modules/i2c
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.18.11-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "."
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! i2c@0.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.1.4 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the i2c package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls i2c
npm ERR! There is likely additional logging output above.

Searching on these errors, it looks like a whole bunch of breaking changes have gone in to V8 between node.js 10 and 12, with a possible work around is for the addon to use NAN to get around the issues of different node versions: https://github.com/iojs/nan

but...that looks like more work for you. just throwing info out there.

if necessary, which it sounds like it is, how do I install/downgrade node.js to v10? I tried Perfo's method but it says that it is an invalid version. When I check my version using n -v, I get 1.3.0, which doesn't seem right to begin with.

Not sure how I got everything all screwed up, but I would appreciate some help!

Thanks,
Hindric
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

The i2c module bombs out, when using nodejs v12
Downgrade to version 10, and you should be ok.

Ill have to check my notes, (not on hand today) how to do it.
Hindric
Posts: 2
Joined: Apr 8th, 2015, 4:09 pm

Re: Raspberry PI based ROV

Post by Hindric »

Well, I managed to find a way to install node v0.10.36 and finished the install instructions.

Now I get:
root@raspberrypi:~/Moki-ROV# node server.js
abort: m▒▒$0▒▒0▒▒▒▒▒%:▒▒▒▒:▒▒$

==== Stack trace ============================================

Security context: 0x2f634659 <JS Object>#0#
1: parse [/root/Moki-ROV/node_modules/i2c/node_modules/coffee-script/lib/coffee-script/parser.js:~479] (this=0x4d7081a5 <an Object>#1#,input=0x4d708195 <JS Array[711]>#2#)
2: /* anonymous */ [/root/Moki-ROV/node_modules/i2c/node_modules/coffee-script/lib/coffee-script/coffee-script.js:43] (this=0x2f634701 <JS Global Object>#3#,code=0x4d708241 <Very long string[2345]>#4#,options=0x4d708231 <an Object>#5#)
3: .coffee [/root/Moki-ROV/node_modules/i2c/node_modules/coffee-script/lib/coffee-script/coffee-script.js:19] (this=0x40e53d75 <an Object>#6#,module=0x4d708bb5 <a Module>#7#,filename=0x4d708b79 <String[46]: /root/Moki-ROV/node_modules/i2c/lib/i2c.coffee>)
4: load [module.js:356] (this=0x4d708bb5 <a Module>#7#,filename=0x4d708b79 <String[46]: /root/Moki-ROV/node_modules/i2c/lib/i2c.coffee>)
5: _load [module.js:312] (this=0x40e53d81 <JS Function Module>#8#,request=0x3d7fcbe1 <String[9]: ./lib/i2c>,parent=0x4d708bf1 <a Module>#9#,isMain=0x2f608091 <undefined>)
6: arguments adaptor frame: 2->3
7: require [module.js:~361] (this=0x4d708bf1 <a Module>#9#,path=0x3d7fcbe1 <String[9]: ./lib/i2c>)
8: require [module.js:380] (this=0x2f634701 <JS Global Object>#3#,path=0x3d7fcbe1 <String[9]: ./lib/i2c>)
9: /* anonymous */ [/root/Moki-ROV/node_modules/i2c/main.js:2] (this=0x4d708cc5 <an Object>#10#,exports=0x4d708cc5 <an Object>#10#,require=0x4d708c19 <JS Function require>#11#,module=0x4d708bf1 <a Module>#9#,__filename=0x4d708c91 <String[39]: /root/Moki-ROV/node_modules/i2c/main.js>,__dirname=0x4d708c7d <String[31]: /root/Moki-ROV/node_modules/i2c>)
11: _compile [module.js:456] (this=0x4d708bf1 <a Module>#9#,content=0x4d708d81 <String[80]\: require('coffee-script');\nvar i2c = require('./lib/i2c');\n\nmodule.exports = i2c;>,filename=0x4d708c91 <String[39]: /root/Moki-ROV/node_modules/i2c/main.js>)
12: .js [module.js:474] (this=0x40e53d75 <an Object>#6#,module=0x4d708bf1 <a Module>#9#,filename=0x4d708c91 <String[39]: /root/Moki-ROV/node_modules/i2c/main.js>)
13: load [module.js:356] (this=0x4d708bf1 <a Module>#9#,filename=0x4d708c91 <String[39]: /root/Moki-ROV/node_modules/i2c/main.js>)
14: _load [module.js:312] (this=0x40e53d81 <JS Function Module>#8#,request=0x59c25939 <String[3]: i2c>,parent=0x40e54099 <a Module>#12#,isMain=0x2f608091 <undefined>)
15: arguments adaptor frame: 2->3
16: require [module.js:~361] (this=0x40e54099 <a Module>#12#,path=0x59c25939 <String[3]: i2c>)
17: require [module.js:380] (this=0x2f634701 <JS Global Object>#3#,path=0x59c25939 <String[3]: i2c>)
18: /* anonymous */ [/root/Moki-ROV/server.js:68] (this=0x40e541c9 <an Object>#13#,exports=0x40e541c9 <an Object>#13#,require=0x40e540c1 <JS Function require>#14#,module=0x40e54099 <a Module>#12#,__filename=0x42357131 <String[24]: /root/Moki-ROV/server.js>,__dirname=0x40e541b5 <String[14]: /root/Moki-ROV>)
20: _compile [module.js:456] (this=0x40e54099 <a Module>#12#,content=0x4235b269 <Very long string[16581]>#15#,filename=0x42357131 <String[24]: /root/Moki-ROV/server.js>)
21: .js [module.js:474] (this=0x40e53d75 <an Object>#6#,module=0x40e54099 <a Module>#12#,filename=0x42357131 <String[24]: /root/Moki-ROV/server.js>)
22: load [module.js:356] (this=0x40e54099 <a Module>#12#,filename=0x42357131 <String[24]: /root/Moki-ROV/server.js>)
23: _load [module.js:312] (this=0x40e53d81 <JS Function Module>#8#,request=0x4235f34d <String[24]: /root/Moki-ROV/server.js>,parent=0x2f608081 <null>,isMain=0x2f6080b1 <true>)
24: runMain [module.js:497] (this=0x40e53d81 <JS Function Module>#8#)
25: startup [node.js:119] (this=0x2f634701 <JS Global Object>#3#)
26: /* anonymous */ [node.js:929] (this=0x2f634701 <JS Global Object>#3#,process=0x40e542a5 <a process>#16#)

Now what did I do wrong? :)

Hindric
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

Nodejs is working against ye <><

Did you try a fresh start with the Moki-ROV software (delete the directory and reinstall frim git)?

If that fails, just reinstall raspbian on the pi. And make sure you install node 10.36 only
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

Before you do anything else are you starting the thing with sudo -su ?
You need to be root for Moki's install
It isn't sufficient to do >>sudo node ***** as some files wont be available.

I would recommend either writing or coping for the net a simple node.js example and see if that works ok.. then move on to the actual project...
Johntreacy
Posts: 1
Joined: Sep 27th, 2015, 11:41 am

Re: Raspberry PI based ROV

Post by Johntreacy »

Moki wrote:With the hardware almost complete, again... it time to go back to programming.

For those that missed the adafruit-pca9685 package, i published it to NPM myself.
So that problem should be over... now to the next steps.

Ofcourse... if you have a problem with the software.. just post it here.
Maybe it easy to fix and ill post a bugfix/update of the software for you.
Thanks for publishing it. Good to see that it is getting some use.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

What about the pi sense hat ? There's no npm for it yet but it would make a lot of things neater and simpler....
Post Reply