BETA of the controller board 2.5 aware cockpit software ready


#1

https://github.com/OpenROV/openrov-software/tree/controlboard25

It seems to be working alright. Works on the 2.5 board no problem and initial tests on the cape worked as well. I've put it in the branch instead of master to make it easy for others to get to, but to allow for additional testing. I'd like to ensure it is working on a couple of the older ROV images first to minimize breaking anyones setup.
Technically from an image and an rov on a router (with access to the internet) you should be able to:
1. SSH in to your rov
2. "cd /opt/openrov"
2b. "sudo /etc/init.d/openrov stop" (may take 30+ seconds)
3. "sudo git stash"
4. it may require you so setup some default email/username settings before it finally works. This ensures any lingering files are safely tucked away before updating software.
5. "sudo git fetch" This will get the latest information about the repository on github
6. "sudo git checkout -b controlboard25 origin/controlboard25" This will pull the latest code from the master repository
7. "sudo /opt/node/bin/npm install" #sometimes the serial.io code fails to compile. try again. You can often ignore the serial.io failures.
8a. update the /opt/openrov/arduino/OpenROV/aconfig.h as follows depending on your setup:
[KIT cape: *****************]

//Kit:
#define HAS_STD_CAPE (1)
#define HAS_STD_PILOT (1)
#define HAS_OROV_CONTROLLERBOARD_25 (0)

#define HAS_STD_LIGHTS (1)
#define HAS_STD_CALIBRATIONLASERS (0)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_CAMERAMOUNT (1)

//After Market:
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define HAS_MPU9150 (0)

[Contollerboard 25: ***************]

//Kit:
#define HAS_STD_CAPE (0)
#define HAS_STD_PILOT (1)
#define HAS_OROV_CONTROLLERBOARD_25 (1)

#define HAS_STD_LIGHTS (1)
#define HAS_STD_CALIBRATIONLASERS (0)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_CAMERAMOUNT (1)

//After Market:
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define HAS_MPU9150 (0)

8b. "sudo /opt/openrov/linux/arduino/firmware-installfromsource.sh" #should end with a 0 meaning it worked

9. "sudo reboot" To restart the ROV
After this everything should *just work*. If not please add issues. If anyone has original KIT Rovs, please test on the old image that we shipped. Please note that this should work on all image versions with the cape. The 2.5 controller boards require the updated SD card image which is shipping with the boards.
Note, there is more than likely a typo somewhere above as I have typed this from memory. If something does not work, please let me know and I'll try to get it corrected asap.
-Brian
*********
3 Nov 2013:
========
Just updated the branch with additional fixes. Major overhaul on the Camera Tilt Servo. If you were having trouble uploading with a 2.5 board, please give it another try. This *has* been tested on a 2.5 board but I have not done regressing testing on 2.4 kits yet (cape based). Please stick with the master branch for now if you are on 2.4 based cape unless you feel comfortable troubleshooting potential issues. 2.5 contollerboard based ROVs, you *need* to use this code as the master branch won't work for you.
8 Nov 2013:
========
Okay, I have verified the code working with some changes on both 2.4 and 2.5 versions of the ROV. The readme.md was also updated with clearer instructions on what you need to do in order to tailor the image. If you have an older image, please start with the image linked to from the readme and reburn it to your SD so that you are starting with the latest software. You must then follow the instructions in this post to change the git repo to point to the beta software branch. Finally you will update the Aconfig.h with your rov config and use the cockpit software to upload the arduino firmware to the arduino.

24 Nov 2013:
========
Eric added an pre-built image with the beta software so that you can simply burn a new sd card. Makes it a bit simpler if you are not comfortable ssh'ing in and running command line options. I believe it is setup for the 2.5 controller board by default, so if you using another configuration or other options in the rov you still need to update the AConfig.h and re-apply the arduino firmware updates (which is done from the UI).
https://github.com/OpenROV/openrov-software/releases/tag/v2.5.0-Beta

#2

Hi Brian,

I'm inching ever further to completing the hardware build on my openrov, installing the software & configuring the control system is now very much on my periphery.

In terms of uploading software to my controller board & BBB, could you provide some basic advice & perhaps a link to the necessary pages?

Kind regards,

Phil


#3

Dear Brian

I doing 8b.

But firmware.hex upload faild.

Is as follows.

Please give me advice.

Linking libServo.a
EEPROM/EEPROM.cpp
Linking libEEPROM.a
Wire/utility/twi.c
Wire/Wire.cpp
Linking libWire.a
arduino/WInterrupts.c
arduino/wiring_analog.c
arduino/wiring_digital.c
arduino/wiring_pulse.c
arduino/wiring_shift.c
arduino/avr-libc/malloc.c
arduino/avr-libc/realloc.c
arduino/wiring.c
arduino/IPAddress.cpp
arduino/main.cpp
arduino/HardwareSerial.cpp
arduino/Tone.cpp
arduino/Print.cpp
arduino/CDC.cpp
arduino/USBCore.cpp
arduino/WString.cpp
arduino/HID.cpp
arduino/Stream.cpp
arduino/WMath.cpp
arduino/new.cpp
Linking libarduino.a
Linking firmware.elf
Converting to firmware.hex
compilled in /tmp/tmp.fmj4xIy4oH
uploading firmware from /tmp/tmp.fmj4xIy4oH
Setting up uploader
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
firmware-upload.sh: Failed to upload after numerous tries. Aborting.
firmware-installfromsource.sh: Uploading Firmware Failed! Aborting
rov@OpenROV:~$


#4

Dear Brian

I can not firmware update Openrov controller board25 yet.

I need make file aconfig.h under the /opt/openrov/arduino/OpenROV ?

Make tool is vi editor?

Tomio Sugiura


#5

Here are some commands to help.

1) Git the latest code assuming you have a 2.5 image already

'cd /opt/openrov'

'sudo git pull'

2) To tailor your firmware settings

'sudo pico /opt/openrov/arduino/OpenROV/AConfig.h'

3) To update firmware on the arduino

'sudo /etc/init.d/openrov stop'

'sudo /opt/openrov/linux/arduino/firmware-installfromsource.sh'

'sudo /etc/init.d/openrov start'


#6

Thank you Brian

I can make AConfig.h

(your first guidance name aconfig.h)?

I have same ploblem I can not firmware update.

is as follows.

Initiating arduino reset
upload failed, trying again.
firmware-upload.sh: Failed to upload after numerous tries. Aborting.
firmware-installfromsource.sh: Uploading Firmware Failed! Aborting

Tomio Sugiura


#7

if you type

'git log' from the /opt/openrov folder what do you get for the first few entries?


#8

Thanks git log is as follows

rov@OpenROV:/opt/openrov$ git log
commit 045f0c53d41b65cad854b1f7accc1b884b5b0e73
Merge: 0d4ec66 e3ec7c6
Author: Dominik Fretz <info@code-with-passion.com>
Date: Tue Sep 3 14:43:24 2013 -0700

Merge pull request #132 from codewithpassion/master

Removing old GPIO configurations no longer needed for the new linux kernel

commit e3ec7c6a25a3012ecba521667a23b0cde414deae
Merge: 92c0ea1 0d4ec66
Author: Dominik Fretz <dominik.fretz@gmail.com>
Date: Wed Sep 4 07:40:24 2013 +1000

Merge branch 'master' of https://github.com/OpenROV/openrov-software

commit 92c0ea1f794d9a1f935478773ae275a2acc7e1a6
Merge: 8031a37 84ad3e3
Author: Dominik Fretz <dominik.fretz@gmail.com>
Date: Wed Sep 4 07:34:05 2013 +1000

Merge branch 'master' into cwp-master

:...skipping...
commit 045f0c53d41b65cad854b1f7accc1b884b5b0e73
Merge: 0d4ec66 e3ec7c6
Author: Dominik Fretz <info@code-with-passion.com>
Date: Tue Sep 3 14:43:24 2013 -0700

Merge pull request #132 from codewithpassion/master

Removing old GPIO configurations no longer needed for the new linux kernel

commit e3ec7c6a25a3012ecba521667a23b0cde414deae
Merge: 92c0ea1 0d4ec66
Author: Dominik Fretz <dominik.fretz@gmail.com>
Date: Wed Sep 4 07:40:24 2013 +1000

Merge branch 'master' of https://github.com/OpenROV/openrov-software

commit 92c0ea1f794d9a1f935478773ae275a2acc7e1a6
Merge: 8031a37 84ad3e3
Author: Dominik Fretz <dominik.fretz@gmail.com>
Date: Wed Sep 4 07:34:05 2013 +1000

Merge branch 'master' into cwp-master

Conflicts:
linux/arduino/firmware-upload.sh

commit 8031a377039d8be042b4c7a19946920e420ff818
Author: Dominik Fretz <dominik.fretz@gmail.com>
Date: Wed Sep 4 06:24:50 2013 +1000

Removing old GPIO setings

commit 0d4ec6612e3e51f313272cfbd823bf725db0a634
Merge: 84ad3e3 e4fadcb
Author: Dominik Fretz <info@code-with-passion.com>
Date: Sun Sep 1 18:49:24 2013 -0700

Merge pull request #131 from codewithpassion/master

Adding update script to recompile the device tree files

commit e4fadcb3a7254343282aed4aab9fa3cf6a08ffc9
:


#9

Okay. This helps. It looks like your git repo is pointed to the OpenROV/Master instead of the OpenROV/controlboard25 which has the BETA code.

Go back to step 3 in the initial post to this topic, stash and changes, and then switch to the controlboard25 branch.


#10

Mr. Brian.

my 25B LED pwr d13 bright and d49 red brink.

But BTX and RTX is no bright and brink.

Tomio Sugiura


#11

Dear Brian

openrov.log is as follows

rov@OpenROV:/var/log$ vi openrov.log
Cannot load StringPrep-0.1.0 bindings. You may need to `npm install node-stringprep'

dead_zone: 10,
video_frame_rate: 15,
video_resolution: '1920x1080',
video_device: '/dev/video0',
video_port: 8090,
port: 8080,
serial: '/dev/ttyO1',
serial_baud: 115200,
preferences:
{ stores: { file: [Object], defaults: [Object] },
sources: [],
version: '0.6.7',
Argv: [Getter],
Env: [Getter],
File: [Getter],
Literal: [Getter],
Memory: [Getter],
key: [Function],
path: [Function],
loadFiles: [Function],
"openrov.log" [readonly] 89L, 2924C 1,1 Top


#12

Hi,

I was getting an identical error to what Tomio is getting. I changed the baud rate to 115200 in the firmware-upload.sh file. This was based on someone else's post. Now I get the following error about 7 times and the arduino upload terminates.

Setting up uploader

avrdude: Version 6.0rc1, compiled on Sep 4 2013 at 13:06:11

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "/etc/avrdude.conf"

Initiating arduino reset

User configuration file is "/home/rov/.avrduderc"

User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyO1

Using Programmer : arduino-openrov

Overriding Baud Rate : 115200

avrdude: stk500_recv(): programmer is not responding

avrdude done. Thank you.


#13

Go ahead and grab the latest code from the controlboard25 branch. I just made some updates, including removing the reset command from the firmware-upload.sh which was causing some problems for the SPI uploads.


#14

Mr. Brian.

same result

I am sad.

Linking libarduino.a
Linking firmware.elf
Converting to firmware.hex
compilled in /tmp/tmp.Y7IfQJhUAS
uploading firmware from /tmp/tmp.Y7IfQJhUAS
Setting up uploader
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
Initiating arduino reset
upload failed, trying again.
firmware-upload.sh: Failed to upload after numerous tries. Aborting.
firmware-installfromsource.sh: Uploading Firmware Failed! Aborting
rov@OpenROV:/opt/openrov$


#15

This still looks like a version issue. If your running the latest code, you will see much more detail.


#16

Here is the Make file results for the npm install step. Suspicious stuff in bold.

rov@OpenROV:/opt/openrov$ sudo /opt/node/bin/npm install

> serialport@1.1.3 install /opt/openrov/node_modules/serialport
> node-gyp rebuild

make: Entering directory `/opt/openrov/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
SOLINK_MODULE(target) Release/obj.target/serialport.node
SOLINK_MODULE(target) Release/obj.target/serialport.node: Finished
COPY Release/serialport.node
make: Leaving directory `/opt/openrov/node_modules/serialport/build'
rov@OpenROV:/opt/openrov$ rov@OpenROV:/opt/openrov$ sudo git checkout
-bash: rov@OpenROV:/opt/openrov$: No such file or directory
rov@OpenROV:/opt/openrov$ rov@OpenROV:/opt/openrov$ sudo /opt/node/bin/npm install
-bash: rov@OpenROV:/opt/openrov$: No such file or directory
rov@OpenROV:/opt/openrov$
rov@OpenROV:/opt/openrov$ > serialport@1.1.3 install /opt/openrov/node_modules/serialport
-bash: serialport@1.1.3: Permission denied
rov@OpenROV:/opt/openrov$ > node-gyp rebuild
-bash: node-gyp: Permission denied
rov@OpenROV:/opt/openrov$
rov@OpenROV:/opt/openrov$ make: Entering directory `/opt/openrov/node_modules/serialport/build'
> CXX(target) Release/obj.target/serialport/src/serialport.o
> CXX(target) Release/obj.target/serialport/src/serialport_unix.o
> SOLINK_MODULE(target) Release/obj.target/serialport.node
> SOLINK_MODULE(target) Release/obj.target/serialport.node: Finished
> COPY Release/serialport.node
> make: Leaving directory `/opt/openrov/node_modules/serialport/build'
> rov@OpenROV:/opt/openrov$
> ^C

This may be me causing this. When I follow your steps I get this error.

rov@OpenROV:/opt/openrov$ sudo git checkout -b controlboard25
[sudo] password for rov:
fatal: A branch named 'controlboard25' already exists.
rov@OpenROV:/opt/openrov$

So I used this command.

rov@OpenROV:/opt/openrov$ sudo git checkout. I was thinking this should pull from the controlboard25 branch.

It compiled fine after this.

Thanks

Pat


#17

Please disregard earlier post. Make and compile have no errors. Communications issue between Beagle Bone and Arduino?

rov@OpenROV:/opt/openrov$ sudo /opt/node/bin/npm install

> serialport@1.1.3 install /opt/openrov/node_modules/serialport > node-gyp rebuild

make: Entering directory `/opt/openrov/node_modules/serialport/build'

CXX(target) Release/obj.target/serialport/src/serialport.o

CXX(target) Release/obj.target/serialport/src/serialport_unix.o

SOLINK_MODULE(target) Release/obj.target/serialport.node

SOLINK_MODULE(target) Release/obj.target/serialport.node:

Finished COPY Release/serialport.node make: Leaving directory `/opt/openrov/node_modules/serialport/build'

rov@OpenROV:/opt/openrov$ sudo /opt/openrov/linux/arduino/firmware-installfromsource.sh

unpacking staging: build dir is /tmp/tmp.CzGqBveY1i staged src in to build folder unpacked into folder /tmp/tmp.CzGqBveY1i

compilling in /tmp/tmp.CzGqBveY1i Searching for Board description file (boards.txt) ... /usr/share/arduino/hardware/arduino/boards.txt

Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt Detecting Arduino software version ... 1.0 (1.0.5)

Searching for Arduino core library ... /usr/share/arduino/hardware/arduino/cores/arduino Searching for Arduino standard libraries ... /usr/share/arduino/libraries

Searching for Arduino variants directory ... /usr/share/arduino/hardware/arduino/variants Searching for avr-gcc ... /usr/share/arduino/hardware/tools/avr/bin/avr-gcc

Searching for avr-g++ ... /usr/share/arduino/hardware/tools/avr/bin/avr-g++

Searching for avr-ar ... /usr/share/arduino/hardware/tools/avr/bin/avr-ar Searching for avr-objcopy ... /usr/share/arduino/hardware/tools/avr/bin/avr-objcopy src/OpenROV.ino Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt Detecting Arduino software version ... 1.0 (1.0.5)

Scanning dependencies of src

Scanning dependencies of arduino

Scanning dependencies of Servo

Scanning dependencies of EEPROM

Scanning dependencies of Wire src/Command.cpp src/MinIMU_Vector.cpp src/MinIMU_Compass.cpp

src/Timer.cpp src/Device.cpp

src/Thrusters2X1.cpp

src/MinIMU_LSM303.cpp

src/MinIMU_L3G.cpp

src/CalibrationLaser.cpp

src/Cape.cpp

src/MinIMU_matrix.cpp

src/Pin.cpp

src/Pilot.cpp

src/Motors.cpp

src/Lights.cpp

src/Settings.cpp

src/CameraMount.cpp

src/MinIMU9AHRS.cpp

src/MinIMU_I2C.cpp

src/MinIMU_DCM.cpp

src/MinIMU9.cpp

src/MinIMU_Output.cpp

src/FreeMem.cpp

src/OpenROV.cpp

Servo/Servo.cpp

Linking libServo.a EEPROM/EEPROM.cpp

Linking libEEPROM.a Wire/utility/twi.c Wire/Wire.cpp

Linking libWire.a arduino/WInterrupts.c arduino/wiring_analog.c arduino/wiring_digital.c arduino/wiring_pulse.c arduino/wiring_shift.c arduino/avr-libc/malloc.c arduino/avr-libc/realloc.c arduino/wiring.c arduino/IPAddress.cpp arduino/main.cpp arduino/HardwareSerial.cpp arduino/Tone.cpp arduino/Print.cpp arduino/CDC.cpp arduino/USBCore.cpp arduino/WString.cpp arduino/HID.cpp arduino/Stream.cpp arduino/WMath.cpp arduino/new.cpp

Linking libarduino.a

Linking firmware.elf Converting to firmware.hex compilled in /tmp/tmp.CzGqBveY1i uploading firmware from /tmp/tmp.CzGqBveY1i


#18

Hm. Hard to tell as no errors are reporting from the upload. I will make a mod tonight to inject the version data in to the log so that I can validate we are all referencing the same code.


#19

I’m wondering if it is a communications issue between the beagle bone and arduino. Someone posted that they saw an identical error and got it working by changing the baud on the serial port to 115200 and swapping out the chip on a regular arduino uno board. I tried setting the baud to 115200. It did not fail the connection immediately like it is doing now. I got a different error. The upload did eventually fail but it took longer. I posted the errors I got at 115200 previously


#20

Hey Patrick,

Just checking the obvious. The 2.5 boards use the SPI interface, not serial to program the arduino. Won't work with the cape based boards that were shipped with the 2.4 kits.

From the command line you should be able to run the following command and get the following results which shows everything is wired and ready:

sudo avrdude -P /dev/spidev1.0 -c linuxspi -p m2560


avrdude: warning at /etc/avrdude.conf:13309: programmer linuxspi overwrites previous definition /etc/avrdude.conf:1003.

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801

avrdude: safemode: Fuses OK

avrdude done. Thank you.

rov@OpenROV:~$