Raspberry PI based ROV

Anything to do with the Raspberry Pi
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

Ah ok that's cleared a few of those questions up then ...thanks...
I'll probably not bother with the $80 one then the MPU-9150 should do most of what I want. Though even most of that may not be absolutely necessary. I would like to measure depth though just so I can instigate a depth hold, maybe if I get the distance sensors working I can ping of the bottom (or surface) to get depth. I like the idea of measurement to the bottom as this will be repeatable in different water level or wave conditions where as pressure will be different.
My Pi is some distance from me but I'm ssh'd in to it and I'll be installing nodejs and give your software a bash...

As for IP cams I've got a couple off ebay for £25 ish each and though they aren't brilliant quality (640X480) they will do for now..
Ta...
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

hmmm not sure where to post this , so please feel free to get an admin to delete it.

I installed fresh version of Rasbian and did all the updates / upgrades...
Enabled i2c by following the guide and checked it with the i2cdetect -y 1 command and get the expected grid.

However when I try to install your software as per the wiki after the
npm install .

...I get

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.7+
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.0
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Linux 3.18.7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "."
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! i2c@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.1.8 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.

npm ERR! Please include the following file with any support request:
npm ERR! /root/Moki-ROV/npm-debug.log

It seems to install all the other stuff Ok though but gives me

/root/Moki-ROV/server.js:75
var ms5803 = new makeMS5803({address: MS5803_ADDR, device: i2c_device' });
^^^^^

If I try to run server.js....
I guess it is complaining that I haven't got a MS5803 connected but with my limited knowledge of the code it appears to check what I have on the I2C bus before it tries to access it and thus I assumed it would ignore anything not there.
Any clues at to what's happened here ? I know it'll be me that's done something silly but I can't spot it...

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

Re: Raspberry PI based ROV

Post by Moki »

I am not sure were the first error came from, but it looks like you have node v 0.12 installed. That may be a problem, not sure.
You could try this:

Code: Select all

apt-get -y install curl
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs
apt-get install -y build-essential
npm install -g node-gyp
And the second error, is my fault (a small typo, which is corrected)
Just re-run the install commands:

Code: Select all

sudo su -
git clone https://github.com/Moki38/Moki-ROV.git
cd Moki-ROV
npm install .
git clone https://github.com/richards-tech/RTIMULib.git
cd RTIMULib
patch -p1 < ../RTIMULib.patch
cd Linux/RTIMULibDrive
make
make install
cd ../../..
apt-get install subversion libjpeg8-dev imagemagick libav-tools cmake
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
make install
cd ../..
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

For those upgrading from an older version, to the a new kernel (3.18)
You may loose your I2C device, in to progres.

(From http://www.raspberrypi.org/forums/viewtopic.php?t=97314)

Add "dtparam=i2c_arm=on" to your config.txt and reboot.

Yer config.txt file can be found in /boot ;)

My I2C grid looks like this:

Code: Select all

root@pihome:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- 41 -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- 6c 6d -- --
70: 70 -- -- -- -- -- 76 --
PCA9685 at 0x41
MPU-9150 at 0x68
MS5803-14A at 0x76
MCP3424 at 0x6c and 0x6d
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

A splendid and speedy response thanks..
I'm reformatting an SD at present so I'll go through it again in a jiffy and see how I get on.
Thanks...
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

hmmm
I have to use
sudo modprobe i2c-dev

to get my I2C running but once I've entered that is appears to be ok....

at the
npm install -g node-gyp bit I got illegal instruction
I then typed npm -v to see what version I've got and that said illegal instruction so I guessed maybe it wasn't installed.

I then did a bit of googling and installed npm and now -v and the instruction above worked

however typing
npm install . and I get the following errors : --- I wish I knew what I was doing , then I may be able to figure it out ...but alsa no..

Incidentally I still appear to have node v0.12.0 installed and npm 2.5.1

make: Entering directory '/root/Moki-ROV/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
bufferutil.target.mk:85: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed
make: Leaving directory '/root/Moki-ROV/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
npm ERR! Linux 3.18.7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "."
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! i2c@0.1.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the i2c@0.1.8 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.

npm ERR! Please include the following file with any support request:
npm ERR! /root/Moki-ROV/npm-debug.log
root@ROV:~/Moki-ROV# node -v
v0.12.0
root@ROV:~/Moki-ROV# npm -v
2.5.1
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

I rolled back nodejs to version 0.10.0 by using the n version manger...
In case this helps anyone else this is how I rolled back to version 0.10.0
Whilst still in the sudo su

type

Code: Select all

npm install -g n
then

Code: Select all

n 0.10.0 

to check I then typed in

Code: Select all

node -v 
and got back the expected node v0.10.0
Now the
npm install . worked ..yayy . there where a few warnings but nothing important just package json readmes missing I think...
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

Now when I run it :-

Code: Select all

root@ROV:~/Moki-ROV# node server.js
PCA9685 Not found, disabled!
MPU9150 Not found, disabled!
MS5803 Not found, disabled!
MCP3424 Not found, disabled!
ROV Server up and running. Go to http://192.168.2.13:3000
Fair enough it can't see the various I2C board as I haven't got any connected....

It runs for about 10 seconds then

Code: Select all

connected

/root/Moki-ROV/server.js:412
imuserver.on('listening', function () {
          ^
TypeError: Cannot call method 'on' of undefined
    at Namespace.<anonymous> (/root/Moki-ROV/server.js:412:11)
    at Namespace.EventEmitter.emit (events.js:95:17)
    at Namespace.emit (/root/Moki-ROV/node_modules/socket.io/lib/namespace.js:205:10)
    at /root/Moki-ROV/node_modules/socket.io/lib/namespace.js:172:14
    at process._tickCallback (node.js:415:13)
Do I have to run this as ROOT ie sudo su - or should it run from a normal user ? Not a problem as long as I know...

Sorry for so many questions. It does look good even though its only for 10 seconds :)
Thanks
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Raspberry PI based ROV

Post by perfo »

Moki wrote:
The software doesn't do anything with camera or mjpeg stream. If you don't start the mjpeg_streamer... the software still works.
You could try to point the <iframe> reference in the "public/index.html" to your PTZ stream. It may just work.
pointing the iframe ref to my camera stream does indeed work. The picture is the wrong size and position on the screen but does show...
User avatar
Moki
Posts: 119
Joined: Oct 21st, 2014, 2:19 am
Location: The Netherlands

Re: Raspberry PI based ROV

Post by Moki »

perfo wrote:
Moki wrote:
The software doesn't do anything with camera or mjpeg stream. If you don't start the mjpeg_streamer... the software still works.
You could try to point the <iframe> reference in the "public/index.html" to your PTZ stream. It may just work.
pointing the iframe ref to my camera stream does indeed work. The picture is the wrong size and position on the screen but does show...
Funny thing about software development, people use your software in ways it was never intended or imagined.

Ill add it to the wishlist ;)
Post Reply