Saturday 31 August 2013

padconf code merged

Earlier this week, the padconf changes I was working on were merged into mainline Minix (commit). The change adds a kernel call to allow userspace drivers to dynamically change the padconf at runtime. A kernel call was needed because on the AM335X, writes to the padconf registers must be done in privileged mode.

Tuesday 27 August 2013

New Documentation Posted and Plans for the rest of GSoC

I spent part of my day today writing documentation for the Minix wiki. The new stuff includes a user guide for the BeagleBone Weather Cape, a developer guide with instructions for supporting new capes, and a developer guide for the I2C /dev interface.

If you remember my preliminary timeline, you know that I'm a bit ahead of where I planned to be at this time. There are still a few more weeks left in Google Summer of Code; the firm pencils down date isn't until September 23. Before it's over, I plan to accomplish a few more tasks...
  • libpadconf support for am335x - when developing the i2c bus driver, I found out the hard way that access to the padconf (i.e. pinmux) registers on the am335x has to be done privileged mode. As a work-around I did the configuration in the kernel at boot. I will be cleaning that up by adding a kernel call to allow the pins to be configured by user space drivers at runtime.
  • frame buffer support for BeagleBone Black - the frame buffer driver currently only supports the BealgeBoard-xM. Since I developed the Minix TDA19988 HDMI Transmitter driver and worked on part of the frame buffer driver previously, it shouldn't be too hard for me to add support for the BeagleBone Black.
  • final week tasks - in the last week I plan to read through all of the code I developed this summer, see if anything can be improved, test everything, review the documentation to make sure it's up to date and accurate, and produce a final report and summary video.

weatherstation code merged

As part of adding support for using the BeagleBone Weather Cape in Minix, I ported the weatherstation application. The task mostly involved removing the node.js and socket.io code and replacing it with a JSON interface. I also added a loading spinner using spin.js and changed the units of pressure from mbar to hPa. Lastly, I updated to the latest versions of jQuery and Processing.js.

Since Minix doesn't have a web server in the base system, I developed a tiny web server in Lua that implements just enough to serve the static content and generate JSON. I'm elated that this project affords me the opportunity to work at all layers of the software stack, from device drivers to web servers to HTML5 and javascript.

Yesterday, I recorded a video demo of the application in action. The code was also merged into the Minix base system yesterday. Here's the commit. To use the weatherstation app, you just have to plug the board into a network (doesn't have to be Internet connected), configure the NIC with `netconf`, attach the cape, and boot the system. The cape will be automatically detected, the right drivers will be loaded, and the web server will be started. In the coming days I will be writing more formal setup instructions on the Minix wiki.

Monday 26 August 2013

BeagleBone Weather Cape Demo Video Posted

I just uploaded a YouTube video showing off the Weather Cape drivers I developed along with the weatherstation application I ported from bonescript. The video is embedded below and also viewable at the following URL: http://youtu.be/QJEtuusBPak




Sunday 25 August 2013

Report 10 (August 19 - August 25)

This is Report #10. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.

Completed this week:

 Issues / Concerns / Challenges:

  • None this week :)
Plan for next week:
  • Develop a script to read from the sensors and output JSON.
  • Integrate the weather station demo and make it trivial to setup and use.
  • Write more documentation.
    • How to use the Minix I2C /dev interface.
    • How to develop support for additional capes.
    • How to use the BeagleBone Weather Cape in Minix.

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.

Sunday 18 August 2013

Report 9 (August 12 - August 18)

This is Report #9. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.

Completed this week:

  • Rebased against mainline Minix
  • Cleaned up the I2C bus driver based on comments from one of my mentors, Kees. The changes have been merged (commit).
  • Documented EDID Reading and the RTC device protocol on the Minix wiki (here and here).
  • Developed a driver for the TSL2550 Ambient Light Sensor that comes on the WeatherCape. The code is written, and I will test it when I pick up the hardware (either tomorrow or the following day).
  • Began developing a driver for the SHT21 Humidity and Temperature Sensor IC for the WeatherCape.

Issues / Concerns / Challenges:

  • None this week :)

Plan for next week:

  • Test the TSL2550 driver.
  • Finish the SHT21 driver.
  • Develop a BMP085 driver.

Sunday 11 August 2013

Report 8 (August 5 - August 11)

This is Report #8. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.

Completed this week:


Issues / Concerns / Challenges:

  • None this week :)

Plan for next week:

  • Write documentation for the Minix wiki about how EDID reading and the real time clock work.
  • Begin developing drivers for the devices on the WeatherCape: TSL2550, SHT21, and BMP085.


Friday 9 August 2013

TPS65950 driver Merged

This week I developed a driver for the TPS65950 Power Management and System Companion Device commonly found on the BeagleBoard-xM. I implemented a basic I2C driver for the chip with support for the real-time clock peripheral. The code was merged today. Here are the commits:

Thursday 8 August 2013

Real-time Clock Demo Video Posted

I just uploaded a YouTube video showing off the code I developed last week to control the real-time clock on the BeagleBone Black. The video is embedded below and also viewable at the following URL: http://youtu.be/rBakaxAGRS0


 

Monday 5 August 2013

Merge Monday

Lots of code got merged into the main Minix git repository today, including 6 patches from my Google Summer of Code project for BeagleBoard.org. Included in the commits are support for the real-time clock on the AM335X, a driver for the TPS65217 Power Management IC, support for powering off the BeagleBone / BeagleBone Black, and support for rebooting the AM335X and DM37XX. Here's the full list of commits:

In other news, an ethernet driver developed by JPEmbedded for the lan8710a was also merged today; BeagleBone and BeagleBone Black users finally have networking support (configuration instructions here). Since it isn't always clear what features are supported on which boards, I made a Feature Matrix on the Minix Wiki.

Sunday 4 August 2013

Report 7 (July 29 - August 4)

This is Report #7. I plan to post these every Sunday. They will give a rundown of what I've done during the week, list any problems I had, and what I plan to do the following week. I'll be posting the reports both to the beagle-gsoc Google Group and to my blog.

Completed this week:


Issues / Concerns / Challenges:

  • None this week :)

Plan for next week:

  • Submit changes for merging into mainline Minix:
    • frame buffer driver enhancements.
    • am335x rtc driver.
    • tps65217 driver.
    • other changes related to power-off.
    • reboot support for am335x/dm37xx.
  • Begin working on a driver for the power management chip on the BeagleBoard-xM (TPS65950).


Friday 2 August 2013

PMIC Power-Off Demo Video Posted

I just uploaded a YouTube video showing off the code I developed this week to safely power-off the BeagleBone Black when the power button is pressed. It also works on the original BeagleBone when you run `shutdown -p`. The video is embedded below and also viewable at the following URL: http://youtu.be/x51NWpnesqQ