Software update guide?


#1

Im fairly up to date on the hardware on the openrov, but ive never been strong on knowledge with software.
Is there somewhere a guide for software noobs like me, to get a short rundown on how to transfer the new software releases to the BB and the arduino?
I have a suspicion that its a matter of transfering in the files and doing some kill or restarts.
Im very interessed in trying out the new released code, and contribute with testing.


#2

Hey Thomas! The guide to updating the software is here on the wiki: Update Software Guide

You do have to SSH into the Beagle Bone, and then type in a few commands on the command line; if you have any questions feel free to ask them here! Our dream feature is to be able to just click a button on the web interface that will auto-magically update the BB and the Cape

-Colin


#3

I feel kind of stupid now... i have used this page when i first brought up the software i have now, but i couldn't find the page again, i've been poking around on github and in the "software manual" page on the wiki without finding this section.

I didnt think of going to the assembly section where the link is.

Anyways, thank you!


#4

Don't feel stupid! You're right! This information should be there, too. As always, feel free to edit the wiki wherever you find it confusing.


#5

I did the update now, and the script didnt put out any errors, but i dont get the cocpit up and running.

i checked the logfile and this is posted:


rov@OpenROV:/opt/openrov$ tail -50 /var/log/openrov.log

module.js:340
throw err;
^
Error: Cannot find module 'nconf'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/opt/openrov/src/lib/config.js:7:13)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
rov@OpenROV:/opt/openrov$

Any thoughts? i guess i miss the nconf module, but how do i get it?


#6

i'm not that familiar with the wiki yet, so im a bit reserved about editying anything ;-)


#7

TADA!

I actually managed to fix this after some tinkering. Its been 10years since i last used linux (debian 2.2!) so it took some time to get into it again.

But this is a short rundown of what i did: (i did not do it directly like this, this took me about 1 hour to figure out. and i probably did something that i havent listed)

sudo apt-get update

sudo apt-get install npm

sudo /etc/init.d/openrov stop
sudo npm install nconf
sudo /etc/init.d/openrov start

i tried straight away with an update of the arduino, and got this message:

unpack: build dir is /tmp/tmp.PZ8phPLOTl

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
firmware-unpack.sh: Failed to untar the archive! Aborting
firmware-install.sh: Unpacking Fimrware Failed! Aborting


#8

if you follow the wiki article on the install commands it has you clear on the node modules and run a command that re-installs all dependencies.

npm is installed on the image by default

sudo /etc/init.d/openrov stop
npm install nconf
sudo /etc/init.d/openrov start
should be all you have to do to add the dependency manually.
Cheers.


#9

You can bypass the tar and download/upload tar steps by simply clicking the upload button without selecting any file from the cockpit settings screen. The system will instead install directly from the \opt\openrov\arduino\OpenROV folder.


#10

sounds good, maybe you could do an update of update.sh with this?

I also tried the arduino update but i failes aswell:

upload failed, trying again.
avrdude: stk500_getsync(): not in sync: resp=0xbf avrdude done. Thank you. Searching for stty ... /bin/stty Searching for avrdude ... /usr/share/arduino/hardware/tools/avrdude Searching for avrdude.conf ... /usr/share/arduino/hardware/tools/avrdude.conf
Initiating arduino reset
firmware-upload.sh: Failed to upload after numerous tries. Aborting.
firmware-installfromsource.sh: Uploading Firmware Failed! Aborting

i wanted to try this fix aswell: http://openrov.com/forum/topics/looking-for-folks-to-test-a-possible-fix-to-the-program-the , but i'm struggling to get the file transferred.

i've tried with winscp but i'm getting permission errors.

any tips?


#11

file owner is root, so this needs to be changed to "rov" user to change the file with winscp.

commands:

sudo chown rov firmware-upload.sh

-then upload new file with winscp

sudo chown root firmware-upload.sh (not sure if needed)


#12

Brian,

I seem to be having a similar problem to Thomas S. I've run the update script, but then the cockpit doesn't start up again. (even with sudo /etc/init.d/openrov start). I've tried running the commands in your comment, but that doesn't seem to do it either. Any suggestions?

-Ben


#13

Ben, I have not ran into the issue that you are having, I followed the Manual instructions as mentioned above and I now have the new code on the BB working. I am running into the same issues with the Arduino upload failing and just wanted to know if anyone figured out away to get this working yet. Brian I also like the work that has been done on the Cockpit much appreciated.


#14

Ben, I had also an issue on bringing up the software again due to the missing nconf module. Did you make sure that you change to the directory
/opt/openrov
before running the
npm install nconf
command? Other way the module is installed in the wrong place and won’t be found by the openrov software.
-Stefan


#15

Stefan,

It's possible that I did not. I'll test it out this evening and see if it works.

Just to make sure I understand, here's what I plan to do:

  1. ssh -l rov <IP ADDRESS>
  2. cd /opt/openrov
  3. sudo /etc/init.d/openrov stop
  4. npm install nconf
  5. sudo ./update.sh
  6. sudo /etc/init.d/openrov start

Does that look right?

-Ben


#16

Ben,
Looks good! After installing nconf from /opt/openrov, you should have a directory /opt/openrov/node-modules/nconf
-Stefan


#17

As a heads up, I tried the sequence of commands, but the npm install nconf won't work from that directory (Lots of NPM errors).

After some hair tearing, I gave up and tried the manual update, and it worked! (Though I did get the NPM errors and have to run that last set of commands.) I'm not sure why I didn't try that earlier.

Success! And the new interface looks great! I like all the new telemetry data and I look forward to more improvements.


#18

Hi Stefan

I have put together a spreadsheet showing the file structure of /opt on the BB in an attempt to try and understand the file structure being used. I am not very strong on programming so I have a few questions. The instructions you gave to update the Cape seem to work well but when I try this after having the latest software loaded on the BB it messes things up and I have to reload the software from scratch in order to get the Cockpit back to norm. I suspect that I either do not have the two folders you mentioned to create in the right location or the files that I moved into \src were not the correct ones.

I have attached a file structure spreadsheet for reference.

Your instructions below say to create two folders src & lib in mkdir but I suspect you may have meant use mkdir to create the folders is that correct? and where should these new folders reside?

#########################################################################

In mkdir I created a subdirectory called 'src' and another one
called 'lib'. I put all the files (Openrov.ino etc.) from the directory
/opt/openrov/arduino/Openrov to the subdir 'src'. Thie 'lib' directory is empty, but is
required by the 'ino' command.
When I want to upload the firmware, I go to /opt/openrov/arduino/Openrov and execute the
following simple script from there (as root with sudo):

sudo ino clean
sudo ino build
sudo /opt/openrov/linux/setuart.sh
sudo /opt/openrov/linux/reset.sh &
sudo sleep 0.4
sudo ino upload -p /dev/ttyO1

Which builds and uploads the code reliably. The crucial thing about this was to find out the correct sleep value (0.4 seconds) after starting the reset and before starting the upload - the time window seems to be very narrow.

#########################################################################

One of the things I am trying to do is change a value in:

/opt/openrov/src/lib/ArduinoPhysics.js

then get this uploaded to the Cape or at least I think it is code that gets loaded into the cape using your method of uploading. any help you can give would be much appreciated.

I guess I don't understand which files and folders get used to create the openrov.ino code

that gets uploaed to the Arduino

Regards

Dave

1519-OpenROVSoftwareDirectoryTree.xlsx (23.3 KB)

#19

David,

I don't know how the 'mkdir' made it into the text you posted, but it should read like in my comment:

http://openrov.com/forum/topics/looking-for-folks-to-test-a-possible-fix-to-the-program-the?commentId=6365107%3AComment%3A41145

You need the upload script only for the firmware that goes to the Arduino (everything located under /opt/openrov/arduino/Openrov/src/

Don't mistake this directory for /opt/openrov/src/ which is where all the node.js server and cockpit stuff resides (ArduinoPhysics.js is part of it).

-Stefan


#20

Thanks for your quick reply Stefan, I checked again and you are correct on the mkdir, not sure where that came from I had copied and pasted your comments into notepad but maybe as I was entering commands in ssh session I may have also over typed into my notepad doc without noticing it. So from what you are saying the file /opt/openrov/src/lib/ArduinoPhysics.js is part of the cockpit software on the BB and not the Arduino code so if I make a change in that file it will take effect on the BB or do I need to do anything for that change to take effect. I will test again making sure that I copied the correct files from /opt/openrov/arduino/Openrov/src/ to the new folder src that I created and see what happens to the cockpit.

Thanks again for any help you can give.