Raspberry Pi

Note: This is not a completed set of instructions. At this point I am not 100% sure the Arduino communication is working properly. This page will be updated as the process is better understood and more info is added by other users. Until it is complete you can: test, debug and help us get the info completed. For now the only way this works is to run as Root. This hopefully will be resolved soon. Because of this we won't be using sudo and will just be doing everything as Root. From documentation I have been using it appears that the TX/RX pins and/or reset pin can only be accessed by the root user. --Dan Myers (talk) 11:33, 5 December 2012 (PST)

Note 2: The pi is being powered from the OpenROV cape. We are not using the MiniUSB to provide 5V into the Pi.

This build is based on the Arch Linux image and the Raspberry PI

Step 1. Initial System Configuration
Have a working Raspberry Pi with the Arch Linux image running. The image is for a 2GB SD card. Due to the number of packages, a 4GB or larger SD card is preferable.

You need to expand the image from 2GB and you can do so by following this. Scroll down to "Manually resizing the SD card on Raspberry Pi"

Note: This step is deleting your partition table and recreating a new one before you write all the steps to the sdcard. Understand that you are DELETING/REMOVING/ERASING/VAPORIZING your SD card partition. If all goes as planned, no data should be lost, but if you do have any data on the card back it up now.

Step 2. Update the Arch distribution
Enter the following as root:

Step 3. Install needed packages
Some of these packages may not be needed. minicom, for example is a serial terminal program used only for testing. This list contains all the packages I installed along the way. base-devel is a collection. You can choose "all" when prompted.

Note:  Several of these packages may already be up to date. Also, many of them are for diagnostic purposes and eventually will not be needed.

Step 4. Free the Serial Port
Raspberry Pi is configured to enable the pins we are going to be using as a serial console. Lets disable that.

Reference 1 Reference 2

Remove the two options referring to the serial port "ttyAMA0": console=ttyAMA0,115200 kgdboc=ttyAMA0,115200

Step 5. Get NodeJS Source:
Note:  Previous instructions used Node Version Manager (nvm) and the nodejs package. Certain versions of nodejs cannot install packages properly on the Raspberry Pi. The following directions are a stop-gap measure (using a version that works) until newer releases can be confirmed working.

Step 6. Customize NodeJS Source:
Around line 82, add -march=armv6

Comment out some lines around 157:

Step 7. Build NodeJS
Note:  One of the major downsides to this method is that this step takes 6+ hrs to run. I highly suggest leaving it overnight.

Step 9. Fix SSL
Fix SSL errors and download required Node.js modules

Download modules:

Step 10. OpenROV Changes for Pi
Change the serial connection from: /dev/ttyO1 to /dev/ttyAMA0

Next:

Comment out both lines that Echo 20 and Echo 0. The pins are already configured correctly for TX/RX. - to be confirmed

Step 11. Arch changes for OpenROV
Now either log off/on to fire bashrc or type: bash

Step 12. Test
If all works as planned you should be able to load the cockpit.

Note:  If you cannot seem to find the Pi's IP address, try creating a static IP as detailed here.

More
The following pins should be the ones required. This is how I currently have my OpenROV cape and Pi wired and am still working through all the issues.

I believe P1-11/P1-25 would be the proper link to enable the reset function. If the code itself cannot be further modified to enable reset the tool gpio can be called. We installed it with the wiringpi packaige. wiringpi