Friday, 23 August 2013

BeagleBone Weather Cape Drivers Merged into Mainline Minix

I received a BeagleBone Weather Cape earlier this week. A cape is an expansion board for the BeagleBone and BeagleBone Black. The weather cape provides sensors for temperature, ambient light, humidity, and pressure. Combined with a BeagleBone, it allows anyone to create an Internet connected weather station.

I've been working hard on drivers to support the devices on the cape in Minix. I developed drivers for the SHT21, BMP085, and TSL2550. The other active device on the board, a CAT24C256 EEPROM, was already supported from my prior work. I also updated Minix's eepromread utility. It works sort of like Linux's i2cdump, but it is also aware of a few EEPROM formats. It has a mode where it can parse and display data fields as label:value pairs. Using the updated eepromread utility, I enhanced the rc script to detect attached capes and run cape specific start-up scripts at boot which load the proper drivers.


Here are the commits:
To sum it up, all of the devices on the Weather Cape are now supported in Minix. If the cape is attached, the drivers are automatically started at boot. To get the sensor values, you just read from the device files of each device. The format should be simple to parse; it's fixed width and also has a delimiter (':'). Here's an example usage:

# cat /dev/sht21b3s40
TEMPERATURE     : 29.126
HUMIDITY        : 45.818
# cat /dev/bmp085b3s77
TEMPERATURE     : 28.5
PRESSURE        : 100432
# cat /dev/tsl2550b3s39
ILLUMINANCE     : 830


Temperature is in Celsius (C), relative humidity is a percentage (%), pressure is in pascals (Pa), and ambient light is in lux (lx). There is a small difference in temperature between the two temperature sensors. I hypothesize the difference is due to some slight heating by the BeagleBone. I got the same results when I tried the board under Linux.

My next steps will be to get a demo application working and properly integrated. I'm hoping to modify the bonescript Weather Station demo (src) to work under Minix. I plan to make a small CGI application / script to expose the sensor values via JSON. Then, I will modify the web interface to make use of the data.

5 comments:

  1. Hello,
    I try this method but my dev directory dosen't consist of sht21b3s40.Why is this so?

    ReplyDelete
    Replies
    1. Which version of Minix are you using? Which BeagleBone are you using (black/white, revision)? Which Weather Cape are you using (rev A or rev B)? Is the cape plugged in when you power on the board?

      Delete
    2. Hi, i'm not using any version of Minix. I'm using Beaglebone Black and Weather Cape rev B.

      Delete
    3. Hi, i'm not using any version of Minix. I'm using Beaglebone Black and Weather Cape rev B.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete