Beagleboard:Weather Cape Work-Around

From eLinux.org
Jump to: navigation, search

Weather Cape Work-Around on Beagle Board Black

When you mount the Weather Cape on the Beagle Board Black, it freezes up and does not boot up because it detects a conflict with the eMMC via the expansion header. You can see this if you connect the FTDI cable to your BBB and view the boot-up through a terminal emulator (i.e. PuTTy). In order to fix this, we will disable the eMMC/HDMI virtual capes and enable the WeatherCape from the kernel command line.
Note: After performing these steps, you will not be able to use the HDMI capabilities of your BBB while using your Weather Cape. This is completely reversible, however. Just reset the uEnv.txt file back to what it originally was.

1. Download, unzip, and flash the BBB-eMMC-flasher-2013.06.06 image here. This updated version allows you to use 'capemgr.enable_partno', which is essential to getting the weather cape to work.
2. When it is done flashing, plug in your BBB to your computer via the Mini USB Data Cable. Wait for your BBB to connect to your host computer.
3. Go to My Computer>BeagleBone Getting Started> and open uEnv.txt
4. Copy and paste this command into the .txt file. Make sure to save your changes. (Ctrl+s)

optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G capemgr.enable_partno=BB-BONE-WTHR-01

5. Safely eject your BBB from your computer and mount the weather cape onto your BBB.

  • To safely eject, go to My Computer and right click "BeagleBone Getting Started". Press Eject.

6. Plug your BBB to your computer via Mini USB Data Cable and connect the external 5V supply. Your BBB should boot and you should be able to use your weather cape.

  • If it doesn't boot up, the uEnv.txt file probably didn't save. Go back to step 2 and make sure the changes from step #4 were saved.

Cape Manager

7. To check that you successfully disabled HDMI/eMMC and enabled the weather cape, navigate to the following through the command line via PuTTy. In line 4 for instance it says, 4: ff:P-O-- Bone-LT-eMMC-2G.......EMMC-2G. The absence of the letter "L" means that it is disabled. If you look at line 0, however, you can see that the weather cape is enabled.

cat /sys/devices/bone_capemgr.*/slots

PuTTy.PNG

Bonescript

8. You can test that your BBB Weather Cape is working by inserting this code into Cloud9. It outputs the results on the console, as well as dumping a .txt file on your BBB desktop of all the readings.

/***************************weathercape.js***************************************
* Created on: 6-3-2013
* Revised on: 6-21-2013
* Author: Juan Cortez
* Works on: 06-08-12 image on both BeagleBone and BeagleBone Black
* Reads humidity, lux, pressure, and temperature from the WeatherCape.
* Input: Sensors on the Weather Cape
* Output: Outputs the readings on console and makes a sensors.txt file on the 
* beagle bone's desktop.
*  uEnv.txt file should have:
* optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G capemgr.enable_partno=BB-BONE-WTHR-01
*******************************************************************************/ 

var b = require('bonescript');
var fs = require('fs'); // needed to open files

// Sensor Locations on the BeagleBone Black
var pressureInput = '/sys/bus/i2c/devices/1-0077/pressure0_input';
var humidityInput = '/sys/bus/i2c/devices/1-0040/humidity1_input';
var temperatureInput0= '/sys/bus/i2c/devices/1-0077/temp0_input';
var luxInput= '/sys/bus/i2c/devices/1-0039/lux1_input';
var temperatureInput1= '/sys/bus/i2c/devices/1-0040/temp1_input';

/* Sensor Locations on the BeagleBone 
var pressureInput = '/sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0077/pressure0_input';
var humidityInput = '/sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0040/humidity1_input';
var temperatureInput1= '/sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0040/temp1_input';
var temperatureInput0= '/sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0077/temp0_input';
var luxInput= '/sys/devices/platform/omap/omap_i2c.3/i2c-3/3-0039/lux1_input';*/

// Location where the sensor values are placed in a .txt file
var out = fs.createWriteStream('/home/root/Desktop/sensors.txt', {flags: 'w'}); // the location we will write the inputs
console.log("The following values have been read by the WeatherCape:\n");
out.write("The following values have been read by the Weather Cape:\n");


/* Opens,reads, and prints humidity, lux, pressure, and temperature. */
b.readTextFile(pressureInput, printPressure);
b.readTextFile(humidityInput, printHumidity);
b.readTextFile(temperatureInput0, printTemperature);
b.readTextFile(luxInput, printLux);

/* Prints Pressure */
function printPressure(x) {
   console.log("Pressure: ", x.data/100 + " millibar");
   out.write("\tPressure is: " + x.data/100 + " millibar\n");
}

/* Prints Humidity */
function printHumidity(x){
   console.log(x.data/1000+ "% Humidity");
   out.write('\t' + x.data/1000 + "% Humidity\n");
}

/* Prints Temperature */
function printTemperature(x){
   console.log("Temperature: ", x.data/10 + '\xB0' + " Celcius"); // '\xB0' is decimal in hexademical
   out.write("\tTemperature is: " + x.data/10 + " degrees Celcius\n");
   x.data /= 10;
   x.data *= 1.8;
   x.data += 32;
   console.log("or: ", parseFloat(x.data).toFixed(3) + '\xB0' + " Fahrenheit");
   out.write("\t\t    or: " + x.data + " degrees" + " Fahrenheit\n");
   out.write("*********************************************************\n");
}

/* Prints Lux */
function printLux(x){
   console.log("Lux: ", x.data);
    out.write("\tLux: " + x.data);
}
out.write("*********************************************************\n");

9. To reset the uEnv.txt file, type this back into the uEnv.txt file.

optargs=quiet

EEPROM Contents

Here are the contents found inside the Weather Cape's EEPROM.

EEprom.PNG