Posts Tagged research
Going Mobile: Network Neutrality
The traditional approach for implementing solutions in wireless sensor networks is to use academically designed sensor motes, which provide an open hardware and software platform. Such devices have been good for addressing fundamental problems, like radio irregularity, routing, data aggregation, and power savings, all of which require fine-grained control (open source) over the software and hardware. While sensor motes provide a good proof of concept solution to some problems, more practical solutions are needed that are more attention-grabbing than a collection of weak, low power devices with limited sensing capabilities. Basically, there aren’t a whole lot of applications for sensor motes that would be useful to most people. A more recent approach is to use cell phones, which are increasingly becoming equipped with GPS, accelerometers, and microphones, providing a platform for interesting and practical wireless sensor solutions. However, the hardware and software of most cell phones are extremely restrictive, clamped down by manufacturers and wireless providers, effectively limiting the research possibilities. For example, one can’t just perform a clear channel assessment using a cell phone’s WiFi radio without less restrictive or open source drivers (even with Android). Such restrictiveness is hindering improvements in mobile devices and many of these improvements would be welcomed by everyday consumers.
Like landline phones, Internet users will eventually drop wired ISP connections in favor of wireless. This shift towards mobile and ubiquitous computing emphasizes that wireless infrastructure and usage policies will be critical in the coming years. With few exceptions, ISPs have followed the principles of network neutrality with respect to wired networks, permitting wired customers to use any device with any software using any communication protocol. However, such openness is not reflected in wireless networks with ISPs placing heavy restrictions on devices, software, and means of communication. To ensure competitive pricing, hardware innovations, exciting software applications, and available bandwidth for the surge in wireless traffic, wireless providers must follow the principles of network neutrality. Since wireless providers are hesitant do do so, the FCC’s decision to enforce network neutrality is a step in the right direction. The enforcement of the FCC’s network neutrality principles will allow researchers to push mobile computing to new and exciting levels and will allow consumers to get more functionality at lower prices.
The openness of the wired Internet has seldom been encroached upon by ISPs and rarely regulated by government, making the Internet the world that it is today. This freedom has been defined by the FCC’s four principles of network neutrality:
- A user can access any content over the network. All who access the Internet are provided access to everything on the Internet, whether it be an AP news report or the Unabomber Manifesto. No ISP restricts content: everything is available, even if it may be morally objectionable or illegal.
- A user can run any application or use any service over the network. Anyone can use any web service or application (Google, Mapquest, Facebook) without restriction from an ISP. No ISP prevents users from making Skype calls even if that ISP also sells landline telephone service.
- A user can connect any device to the network, given it does no harm. An Internet user can connect with any hardware, whether it be with a ten year old piece of junk running Linux or with a $10,000 top-of-the-line quad core processor running the latest Windows 7 beta. No ISP restricts a user’s Internet access because his or her computer is a piece of junk. Nor do ISPs force users to connect only with proprietary computers sold by the ISP.
- Competition among network, content, and application providers. A user is open to choose from one of several ISPs (if more than one are even available), and also has choice over competing web services and content providers.
This freedom has not always been maintained, even with the wired Internet. Two years ago, Comcast deliberately throttled the bandwidth of peer-to-peer protocols, limiting the upload and download speed of file sharing applications. With peer-to-peer using customers enraged over this finding, the FCC forced Comcast to abandon this policy. Other than this incident and a few others, the Internet has always been delivered equally to all who have access.
Unfortunately, such open policies of the wired Internet are not followed by wireless providers. From the very birth of cell phones, wireless providers have controlled everything:
- Unrestricted content. Wireless providers block (through restricted software) bandwidth-heavy content, such as streaming videos, voice/video communication, as well as file sharing. Such restrictions are in place to limit or prevent wireless network congestion. Improvements in wireless infrastructure could alleviate such congestion, but wireless providers have decided to restrict, rather than improve.
- Use of any application or service. Nearly all providers restrict the operating system and applications available on connecting mobile devices. Apple blocks the use of Skype when the phone is not connected to a WiFi network. Similarly, the Google Voice application was also removed by Apple and AT&T. Both applications provide features that could be seen as subversive to standard cellular voice calls. Instead of providing competing applications (maybe with better features), the ISP and application providers just block any competition.
- Connection of any device. Verizon’s network may be good, but their phones are terrible. A customer cannot just build their own tricked out phone and connect it to Verizon’s network. Instead, users are forced to choose from a handful of phones with menial features (only sold by Verizon, of course).
- Competition. Since content, applications, and hardware are restricted on most wireless networks, competition is limited. Only a handful of wireless providers offer large coverage areas, especially for data communication. Since the United States pays more for wireless than any other western country, it is clear that less restriction would provide more options and more competition for consumers.
Despite the crackdown on allowable hardware, software, and access, wireless executives somehow manage to argue that their industry is “perhaps the most competitive consumer market in America.” While unregulated competition would be great for consumers in terms of increasing wireless freedom, there simply isn’t enough competition to go around. There are only four major carriers in the United States, effectively forming a cartel that can set prices artificially high and extensively limit consumer freedom. With barriers to entry so high (infrastructure), few new carriers are likely to emerge. In cases like these, government intervention is the only solution. Fortunately, the FCC is investigating the lack of competition in the wireless market with respect to insane billing rules and lack of consumer freedom in comparison to the wired Internet. Of course, their latest decision to enforce network neutrality will also provide a strong push.
The end result should allow anyone to build their own phone, install a custom operating system, and connect it to the wireless provider of their choice without issue. Such a user should be allowed unrestricted access to the entire Internet without throttling or restriction of streaming video, large file downloads, or VoIP calls. Ultimately, text messaging and voice calls will be merged into wireless data plans, removing such unreal and confusing costs like $.25 to send a 160 byte message or “anytime” minutes, which are anything but anytime. Unrestricted hardware, software, and access will bring increased competition among existing wireless providers, fostering the development of better mobile hardware and cool applications.
Fixing the frustrations of the digital nomad
Current computing technology consists of a mishmash of devices, ranging in size, portability, usability, and design lifetime. Users are tied to their desks no longer: the future lies in mobile devices, and improvements to increase mobility and usability are key in the coming years. Without the following improvements, I think most users’ computing experience will become very frustrating. I’m hoping we’ll see:
A holistic computing solution
Everyone splits their computing time between a whole pile of devices: cell phones, media players, laptops, netbooks, desktops, and gaming consoles. Even typical cable TV boxes have a hard drive and user interface. The purposes and capabilities of such devices is becoming increasingly diverse and will probably continue to do so in the short term. However, it’s becoming a real pain to use a standalone device for a different task. Carry a cell phone for voice and text messages. Carry a laptop or netbook for working on the go. Carry a media player to listen to music. When at home, many people switch from a laptop to a separate desktop PC. It would be great to see some consolidation in order to reduce frustration with dragging around multiple devices and learning the quirks of each.
Since most people aren’t running weather prediction simulations, a single small mobile device would be sufficient for most people’s computing needs. Ideally, something the size of a cell phone would combine the functionalities of a phone, camera, media player, laptop/netbook PC, and even desktop PC. No longer would people with multiple devices need to synchronize information or become familiar with multiple interfaces. A single device would provide a user with most of the computing power and capability that he or she would need without the hassle of dragging around a separate phone, media player, and laptop. The device would be designed such that it could easily support and interface with different user input and output methods.
Improved user interfaces
Improved interfaces in mobile devices would make for a better user experience and improve productivity. With multiple gadgets to haul around, each comes with a different interface with varying levels of usability. For the most part, the smaller the device, the worse the user experience becomes. A desktop computer with a keyboard, mouse, and giant monitor provides a solid experience for most, with both ease of input and output. A netbook, however, may satisfy a user’s computing needs, but may cramp usability and productivity with its tiny screen and uncomfortable keyboard. Even worse, web browsing and writing emails or text messages on some cell phones can be nearly impossible. Personally, my experience with multi-touch phones has been horrible, since most of the time the phone selects something other than what I intended. Rethinking and improving the physical and software interfaces would permit a shift to a cell phone-sized holistic computing device.
Improvements to both physical and software interfaces would provide huge benefits for the end user. With respect to physical interfaces, improving multi-touch surfaces would be a big step in the right direction. Input methods that are simple and accurate would make phone calls, text messaging, and web browsing on mobile devices much more enjoyable. Output methods should extend beyond a tiny three inch screen, such as a wearable HUD or projector similar to that used in MIT’s SixthSense. With regards to software interfaces, most cell phone operating systems provide horrible user interfaces which make the simplest tasks a real pain. Most of these software designs inherit from heavyweight PC interfaces where input is made easy with keyboard and mouse. Mobile developers should focus on increasing usability by making tasks require the fewest amount of user inputs possible.
Behavior and activity recognition
Computing systems of tomorrow could predict a user’s intentions and act upon these predictions. With the introduction of accelerometers, GPS receivers, light sensors, cameras, and microphones in cell phones, plenty of research has provided ways to recognize user behavior and activities. Such research can help provide an augmented reality for users, pointing out suggestions as to what a user could do based on his or her surroundings, current activity and learned preferences and behavior. For example, a user traveling in an unfamiliar city could get instant suggestions as to where to eat when he or she normally takes a meal, with a mobile device providing directions to restaraunts that match the kinds of foods the user normally eats. A HUD would allow the device to paint a path directly on the streets to take without the user staring down at his or her phone. A device could automatically perform Internet searches and return data relevant to what a user is doing, whether it be retrieving a weather report before a user heads to the beach or providing real-time flight delay information as a user drives to the airport. Such intelligent systems could interact with the physical world and turn on the lights or adjust the temperature at a user’s home before he or she arrives. Also, behavioral and activity recognition would eliminate the need for user-generated Twitter and Facebook posts, performing automatic updates whenever a user changes activities or does something unusual.
Better inter-device collaboration
Figuring out how to get cell phone pictures off the phone and onto a computer can be a monumental task. It’s even more enjoyable to get a projector to correctly display a presentation on a laptop. Nearly every slideshow presentation I’ve witnessed, in classes and in conferences requires each presenter to wage war with his or her laptop and the projector to get the presentation to display properly. Improving inter-device communication would make everyday computing more seamless and a lot less frustrating. For example, a slideshow presentation could be loaded on a mobile device and a user could walk into a room with a projector, with the mobile device automatically connecting wirelessly to the projector and displaying the presentation. There would be no cables to plug in, no display settings to modify, and no buttons and inputs to fidget with on the projector. Synchronizing and moving data between different devices stands to gain significant improvement, for people are constantly upgrading their cell phones and laptops as well as sharing their data with others.
Longer design lifetimes
I’m guessing I’m not the only one with a pile of old hardware that’s worn out from too much use or discarded due to obsolescence. More robust devices with longer expected lifetimes would reduce the pile of useless junk in the closet. This would be especially helpful for mobile devices, which often wind up in mud puddles, toilets, or under someone’s steel-toed boot. Modular construction would allow for periodic upgrades without throwing away the whole device. An effort towards longer lifetimes and upgradeability would also significantly cut down on the amount of toxic e-waste.
Longer battery life
Most cell phones don’t last past a couple days of standby or two hours of talk time. Most laptops don’t make it past three or four hours. With an increased focus towards mobile and ubiquitous computing, improvements in battery technology, power savings, and battery recharging would do wonders. Apple has a new battery design in its latest laptops that double battery life, but more strides in this direction are needed. Efforts on power-conscious radio communication and CPU utilization will contribute to power savings through better software. Lastly, harnessing available energy sources such as motion, body heat, and the sun will also allow mobile devices to run unplugged for longer periods.
In general, these issues are what I think mobile computing needs in order to really take off. The current experience is haphazard and lacking, requiring a mobile user to carry multiple devices with poor interfaces and short battery life. With future applications, mobile devices will do a lot more than allow phone calls, web browsing, and text messaging. They will further the integration of the cyber and the physical world, helping a user interact with the environment and the Internet in ways currently unimaginable.
“When you control the mail, you control information”
Newman had the right idea: with a communication infrastructure, the end users aren’t alone in leveraging control over the information they communicate. Intermediaries have just as much control as the creators and the intended recipients. This might be true for mail, and it’s increasingly becoming an issue with the internet.
The most visible privacy issues have been raised with the introduction of social networking: Facebook’s Beacon being one of the most infamous, with Facebook secretly collecting your online activities to generate targeted advertisements. More recently, software designed to control and monitor children’s internet usage was revealed to actually transmit all internet activity, including instant messages, back to the companies that designed the programs. The list of abuses and potential abuses goes on and on and will only get worse. The introduction of cloud computing and the shift to thin clients mean that third parties are handling more and more personal data. The more opportunities others are given to handle our personal information, preferences, photos, browsing habits, and documents, the more opportunities exist for the abuse of that control.
Social networking and the monitoring of internet habits is only the tip of the iceberg. The social networking concept is quickly moving beyond the confines of the Internet and integrating itself with the physical world. The concepts of participatory sensing, body sensor networks, and smart homes/offices will see the introduction of internet-linked sensors placed everywhere. Cameras and microphones will soon be on every street corner. Temperature, humidity, and other energy monitoring sensors will be commonplace in every home, all linked to the internet. Even now, most cell phones come equipped with GPS, accelerometers, and microphones, allowing for activity recognition and localization. This “information saturation” will allow any developer to design an application that makes all kinds of weird discoveries: with body sensor networks and smart phones, rush hour traffic can be monitored in real time, local nightlife hotspots can be easily discovered, and suggestions can be made on how to save energy based on water and electricity usage in your home.
While the integration of the internet into the real world sounds cool, imagine what someone could do if your sensing information got into the wrong hands. Would you really want your health insurance company to know your heart rate or blood pressure at any time of day? Would you really want everyone to know that you waste the most water out of everyone who lives on your block? Would you want a crazed stalker to know where you were at any moment or to learn your daily activities or routines?
Privacy and security is going to be an increasing concern as sensor networks become more commonplace and integrated with the internet. While I was at UVA two weeks ago, Prof. John Stankovic mentioned that security and privacy in sensor networks is a huge problem and unfortunately, little is being done in this area.
A recent article by a UCLA student illustrated some of the problems with participatory sensing and presented some general solutions. Disclaimer: as part of the lead-in on her article, she says: “the developers I work with might say [my research area] is about telling them what they should be doing—which I must admit is the goal of this article.” When someone says they know better than you, it’s time to run, not walk, to the nearest exit. That said, I do agree with some of the things she says. The author argues that a general framework should be designed for all participatory sensing applications that allow for user privacy management. The frameworks should allow a user to easily understand how the systems work and how to control the release to the outside world of personal sensor data and inferences. Ultimately, the author argues that data generated by a sensor network that you own is yours to control and distribute. Third parties must respect the wishes of the content generators.
The author doesn’t go into fine-grained detail about how to ensure the preservation of an end user’s privacy wishes. I could imagine some kind of CA could help verify that those third parties which access a user’s content/sensor data are who they say they are. Some kind of feedback mechanism could allow a user to see where his or her sensor data went and how it was used. If a third party abused a user’s data, the CA certificate could be revoked, effectively tarnishing the reputation of that third party. Most likely, encryption would have to be introduced to ensure nobody but the permitted third parties could access a user’s data. Unfortunately, encryption is very energy and bandwidth heavy for low power wireless sensors.
We all know the wrong way to go about privacy with the experiences of Facebook and its tacked-on privacy measures. Initially, Facebook provided little privacy controls with no framework at all to allow a user to control access to his or her information. Even now, the privacy controls for Facebook are hard to access and even harder to understand what they do. A user has no fine-grained control over adjust who can access what content and exactly how your information is being shared with third party applications and advertisers. A comprehensive and user-oriented privacy framework installed from the ground up would help stop the mishaps that are common with social networking. Such a framework would come into its own with the increase in participatory sensing.
On that note, it’s time to get a few cell phones and start a participatory sensing application of my own to provide motivation for some research problems. The possibilities are limitless and I can throw privacy to the wind (for now). Unfortunately, as the author of the ACM article mentioned: researchers and developers don’t think about privacy, they think about research problems and cool applications. In a small-scale research environment, the information is mine to control since I control the sensors, the application, and the release of any data or inferences from the data. But, if anything were to be released into the wild and become popular, a framework for end user privacy control would be indispensable. I certainly don’t want some nutcase knowing when and where I’m sleeping.
Another whirlwind tour
I’m glad to say that my second segment of travel this summer is over. While I like the concept of going somewhere different for awhile, I don’t handle it well. When I travel, I tend to have trouble sleeping and also usually have trouble with the food. If I was in one place for more than a day or two, I would adjust and it would probably be better, but the trips as of late have been too fast to allow me to get used to a new environment. I still feel like I’m recovering from last week.
That said, it was an interesting trip, or sequence of trips, covering Boston for a paper presentation and then to Charlottesville for a Wireless Sensor Networks “retreat”. The first thing that happened started several days before I left to Boston, tripping on a downed branch in the street which nuked my ankle and plantar fascia, as I later found out. I got up when it was still dark out the morning I left for Boston and went running only to find my foot in incredible pain. It was the worst plantar fascia pain I’ve ever had, despite having trouble in that area plenty of times. So after getting back I found myself unable to walk without searing pain in my heel and barely able to limp around. This, right before a day of airports, subways, and walking around Boston.
Fortunately, the flights did go well this time around. Everything was basically on time going out and coming back from Boston. I left last Monday morning, connected through Washington, and took a shuttle flight to Boston. I had to take a bus from the terminal to the T station which was tricky since there were several buses that all looked the same but went to different places. The subway was straightforward but I did have to change trains once. It dumped me out two blocks from the hotel and I just walked limped from there.
In an effort to save the department some money, I went a day late. It turned out that when I got to the hotel in Boston on Monday afternoon that there were no sessions scheduled for the rest of the day. I had hoped to sit in on a few to see what everyone else was doing and to be sure that I had about 20 minutes to present. Since nothing was going on, I dropped off most of my junk at the hotel and went outside to walk around, despite my heel pain. I figured I might as well take advantage of being somewhere else besides school for a change.
Clearly, people in Boston know a good day when they see one and get out when it’s nice. This was the first time in awhile that I had been there when it wasn’t winter. The previous times, the Charles was iced over, snow piled up, and winds whipped through the streets. Not many people were out then. This time, I walked through Boston Common and it was packed. I didn’t realize there was a pond that you could swim in. I went up and down the streets near the hotel, found some food, and went back to the hotel to crash. As tired as I was, I didn’t sleep.
My presentation was first thing Tuesday morning so I practiced the night before and hoped that the length would be about right. I wanted to get up early and run in Boston before I presented, but I realized that my heel pain was too great to do that. When I got to the conference room where I was to present, there was only one guy in there in charge of the projector. Nobody else came, not even the session chair, until five minutes before I was to start. After I got going more people showed up including another professor from William and Mary who also had a paper. Fortunately, everything went well and I handled the questions without any real issues.
The next trick was getting back since I had to go to UVA the next day. I was booked on a 3 PM shuttle flight from Boston to LaGuardia, but that would give me less than an hour to connect. If there were delays, I could miss the connection and get stuck, as I experienced little more than a month ago. I wanted to get on an earlier shuttle flight but when I booked the ticket, the system wouldn’t let me. Interestingly, the book I was reading had a character that took a shuttle flight to LaGuardia and then was able to return anytime without charge since it was considered an “open” ticket. I’ve also heard elsewhere that you could just change your ticket on shuttle flights if there was room. Since the flight out had few people on it and the Boston shuttle terminal was nearly empty when I arrived, it seemed that changing my ticket wouldn’t be limited because of full flights. I got the subway and bus back to the airport and got there early to see if I could leave sooner. Nope, the gate agent demanded 50 bucks. So much for all the hype over “open” tickets. Another guy asked the same question, but apparently arriving an hour or two early was worth the money to him.
I sat in the empty Boston airport for several hours while two other shuttle flights left for New York, both with very few passengers. Finally, when I got on my plane, I was assigned an exit row where the seat in front of me was removed. I had double legroom. I guess I was rewarded for waiting. The flight back to Norfolk was a little late and I managed to get home at 8 that Tuesday night. This time I really did crash and slept for over 11 hours. Yet another big day was coming up.
On Wednesday I left home for Charlottesville and picked up the other student in our group, Zhen, from Williamsburg. We got there Wednesday night and stayed at a hotel that was hopefully within walking distance of where the meeting was the next day and Friday. Since I couldn’t run and was still in pain, I took my bike with me so I could explore Charlottesville in the early morning hours before everything started. Biking was interesting since it was dark and there were a lot of big hills compared to Williamsburg. On Thursday morning, my headlight came off its mount and shattered all over the pavement. I had to get a new one.
My adviser told us that the retreat was to be held in the rotunda, which motivated the choice of hotel since it was within walking distance. I had been to the rotunda before and it seemed weird since it was only really one room where tours were given. I asked him several times if that was where it was, but when we got there Thursday morning the doors were locked and nobody was around. I had the number of a UVA grad student which told us that it was at the business school, which was nowhere near the rotunda or the Computer Science building. He couldn’t say where in the business school it was, and after looking at a map, the business school complex was huge. We might never find where we were to go. Somehow we managed to find the right room and building after running into a knowledgeable receptionist right after we walked in the door of the first business school building we found. We got to the right room 45 minutes late. Other UVA students laughed when I told them that my adviser said the meeting was in the rotunda.
The retreat was more or less an informal series of conference-style presentations. Most everyone was a UVA student presenting on a work in progress. There were lots of unsolved problems which led to all kinds of nasty questions. It appeared as though some students didn’t practice since they went way over time or were cut off entirely with zillions of slides left. The few that finished early were given plenty of discussion to fill in the gaps. There were lots of interruptions, especially from the professors, and usually the adviser of the student would cut in with some difficult question about something that hadn’t been fleshed out yet.
The retreat went all day Thursday and then Friday until just after noon. There were a lot of demonstrations, including that of a fall detection system for the elderly where the user would wear several accelerometers and gyroscopes. One of the students with sensors taped to his shirt and legs fell down on the floor five or six times, which was pretty amusing, especially since the system didn’t indicate a fall until the last attempt. There was a breakout session where my group discussed future applications and system designs. An interesting thing that came out of that was the release of more iPhone/Google Maps-style APIs for third parties to make use of the deluge of data from sensor networks. Someone commented that very soon you’ll find a microphone, panoramic cameras, among other sensors on every street corner, essentially providing a live Google Street View. Imagine what someone could do with that: follow people remotely as they go about their day or generate a tag cloud of things people are discussing the most and break it down by location. When I got home, I noticed that Google Maps now has a traffic congestion tool that uses GPS and speed readings from mobile users to determine if a road segment is congested. Stuff like this that people currently consider to be invasive is going to be more commonplace and acceptable.
After all that I managed to get back home last Friday afternoon. Since the traffic was such a mess in the tunnels, I wound up going through some nasty parts of Portsmouth to get around everything, something I hadn’t done before. It took me as long to get from Charlottesville to Williamsburg as it did to get from Williamsburg back home.
Overall, the trip was probably worth some of the fatigue and heel pain since I gave a conference presentation and got a fair amount out of the retreat. With the start of the fall semester, most the travelling is done for awhile and it’s time to get going on work that I haven’t been able to get to since I was gone.
Rise of the Machines? I think not.
Using machine learning in the realm of wireless sensor networks, I have been able to improve sensor node localization and provide event detection. Since I found the concepts of machine learning interesting, my adviser provided me with a book to get an overview: Machine Learning, written by Tom Mitchell of Carnegie Mellon. Most machine learning techniques are equivalent to function approximation and most also require a significant amount of human intervention to work properly. A machine learning model can be trained to take a set of inputs (such as sensor readings) and provide an output (a tank is hauling butt towards my base). However, the model has to be trained to know what the correct outputs are (tank is present or not present), so a human must provide a limited set of training data where the correct output is known.
Given the state of the art in machine learning, there is no way for an AI to learn on its own. There is reinforcement learning, but even in this case a human must decide the conditions and the amount of a reward or penalty for each AI decision or output. This is why AI in games is terrible: when there are a large number of non-deterministic game states and a large number of non-deterministic actions to take, it is almost impossible to determine the correct action to take at every decision point. This means that it is difficult or impossible to provide the AI with labeled ground truth or a reward for training. More to the point, labeling each output with the correct value would be a real headache. Instead, game developers resort to a rule-based system that still has trouble covering every possible scenario. As a result, NPC characters still wind up doing something weird, like running into walls.
I’ve been working with this stuff for awhile, realizing its capabilities and especially its limitations. Then, this weekend I see a headline reading: “Scientists Worry Machines May Outsmart Man.” Overblown media hype at its best. The article concerns a conference on machine learning attended by the aforementioned Tom Mitchell and futurist Ray Kurzweil. From what I gather, the conference dealt with mostly philosophical issues with respect to advancing technology and its integration with everyday life. There wasn’t much about strong AI taking over the world, yet it was plastered all over the news that a Skynet-esque entity would rise from the Internet and doom us all. In some ways, simpler systems have already taken over our lives: GPS tells us where to drive, automated tools read MRI scans and provide diagnoses, and viruses wreak havoc on our personal computers. However, strong AI has quite a ways to go, with most machine learning research peaking decades ago. As one Slashdot commenter on the NYT article writes:
Any computer scientist who is worried about AI taking over no longer deserves to be referred to as a computer scientist. The state of “artifiical intelligence” can be best described as “a pipe dream.”
All of this comes on the heels of a TED talk on the development of a brain simulator. The speaker indicates his current brain “implementation” is running on a 10,000 core Blue Gene system. The article gives few details, but it sounds like a large scale artificial neural network, which still needs supervised training data to learn properly. 10,000 nodes is still way too small, since the average human brain has 100 billion neurons with 7,000 connections each. Maybe in ten years the requisite computing horsepower will be in place, but I’m guessing the algorithms and the intelligence will not.
In a similar light, a team of scientists recently used DNA computing to solve the NP-Complete Hamiltonian Path problem. Instead of using some artificial construct or model, billions of DNA sequences, each representing a possible path, were randomly constructed such that those having a correct solution would glow a different color. While massive parallelism makes this a relatively fast solution to an NP-Complete problem, this approach really isn’t a doomsday AI either.
While specific solutions continue to be discovered for our technological problems, development of strong AI (and the development of Skynet) will sit on the back burner. Until then (and it’ll be awhile), everyone can take off their tinfoil hats.
Equipment Failure
My aging desktop PC is starting to come apart: today is the first time I have ever heard the click of death. I had always imagined it would sound like the disengaging of the head whenever I shut down the computer. In the middle of reading a research paper, I was interrupted by a violent, pounding racket that came screaming from the case. It was so loud that for a few seconds, I was actually afraid my computer would explode or catch fire.
Fortunately, the drive was mostly unused and had nothing really useful in it, while most everything remained safe on the primary WD Raptor. The really important stuff is already backed up on my network drive or on my department disk space, so if anything else blows up I’ll still be okay. When I removed the offending drive and tried to boot, only the power supply and CPU fans started spinning, leaving me with only a blank screen. Somehow I managed to have unseated the video card from its connection to the motherboard and after I reseated it, everything returned to normal.
Quite a few people try to salvage failing computer components, but I don’t think it’s worth it. The main idea is to patch stuff up just enough to transfer off any important data. There’s the legend of sticking the drive in the freezer overnight to get it working again. Someone even got their video card working by baking it in the oven. The fear of losing data is so great to some that there even exists a sound library of hard drive failures.
I don’t think my computer has much life left in it. I don’t want to switch to my laptop for everything since it only has a VGA output and no digital connection, rendering my monitor useless. I suppose I could get a docking station, but I can’t believe that Lenovo still makes laptops without digital outputs for external monitors. Despite buying it last year, it even came with a pile of serial ports, a dial-up modem, and a PCMCIA slot that nobody would ever use. A new desktop would be good for games but that was the purpose of buying an Xbox, and besides, high end desktops are still pretty expensive. Of course something beefy would also be good for my schoolwork, since the last two projects had implementations that were extremely CPU intensive.
Regardless, I think I’m running on borrowed time.
Rome Trip: Lightning Strikes Twice
As I sit here back at home writing this, a lone book sits high on the bookshelf, looming over me: “What Are the Odds,” by Mike Orkin. An apt title for the past five days, which were probably the longest five days I’ve had in quite awhile. What are the odds that I would get screwed on the way over and on the way back from Rome? The odds were pretty good.
The mess with the delayed flight from Norfolk keeping me home for two days was frustrating, but at least I was at home and not stuck in Philadelphia. At least on the second attempt I made it without any problems. After three days of walking and my SECON presentation, I was tired and jet lagged and ready to go home. I knew that on my trip back that anything could happen. I’ve had enough experiences with cancellations, delays, and lost bags to know that with each flight I was rolling the dice. On this trip, my number came up twice.
I got up at 6:30 AM Rome time, or 12:30 AM in Virginia. The train station was right across the street from the hotel, but it took almost 15 minutes of walking to get to where the train was. There were 30 platforms, some of which were behind others, so it was quite the walk with my suitcase out to the train. Fortunately, my dad and I bought tickets before we left at a machine so I didn’t have to waste time figuring out how to get a ticket. One wheel of my suitcase started to come apart and made quite the racket as I dragged it around everywhere.
The train left on time and got to the airport on time. I entered the airport terminal the same way we left and assumed that the ticket counter would be just inside. A sign said there were concourses A, B, and C. My dad and I arrived at C, and it appeared as though I would leave the same way. A monitor said the flight was on time.
I tried to find the ticket counter. There was a whole sea of them just inside from where the train dumped me out. A directory listed all the airlines and where the ticket counters were. It said US Airways: counter 511. But, the ticket counters in the terminal only went from 200 to 400. Where was 511? Looking around in disbelief, a small, out of the way sign said US Airways ticket counters were in “Terminal 5″. Terminal 5? How did that line up with concourses A, B, or C? More importantly, how does one get there? Another small poorly placed sign announced that a bus outside would go to Terminal 5. I went outside and found the sign for the bus and waited. As I waited a crowd began to form by the sign. It got bigger and bigger and the bus wasn’t coming.
Finally, the bus came and we packed in. Half the line got left outside. The bus wound its way all over the airport for ten minutes before arriving at the secret Terminal 5. Since I had web check-in and printed my boarding pass at the conference, I didn’t need to stand in line. I got my passport checked off and was put back on another bus to the terminal I started at.
When I got to the gate there wasn’t much going on but soon all the seats were packed and a large Italian family sat next to me and had a loud and heated conversation. Some of them hovered over me as they conversed loudly. Either the concept of personal space is nonexistent to them or they were trying to get me to leave by being obnoxious. It was probably a bit of both: I got up and found another seat next to an American couple who complained about the only coffee in the place was a bar that served only espresso shots. They really wanted their brewed coffee. I didn’t blame them.
The flight back to Philadelphia left on time and arrived on time. I had a window seat, but there wasn’t much to look at but clouds and bits of the ocean beneath. We crossed over the Alps and parts of France, but the clouds covered most of that too. Most of the transatlantic trips I’ve taken had the ocean blanketed by clouds. I’m not sure why this is.
The flight was nine hours, the longest I’d ever taken, but my sister took one that was something like 16 or 18 when she went to China. Nine was uncomfortable enough. I watched a movie, read several hundred pages of a book, and went to sleep. Everything cramped up. Fortunately, the flight attendants came by frequently with drinks.
Since I was near the front of the coach section and had carried on all my bags, it was easy to get off the plane and get through passport control and customs. I was through all that within 10 minutes, and fortunately customs did not ransack my computer looking for contraband. I would have had quite the fit if they decided to do that. I’m hoping these warrantless searches go to court soon.
I arrived in terminal A-West in Philadelphia, and the Norfolk flight left from at the far end of terminal F. My dad says this is about a two mile walk. There is a shuttle bus, but since I had been on the plane for nine hours and hadn’t run or biked in four days, I wanted the exercise. I had to go back through security again at F, but it wasn’t too bad. I had plenty of time: I got through customs at 3:30 Eastern time and my plane to Norfolk didn’t leave until 5.
Then the problems started. At the gate for the Norfolk flight, it was announced that the plane would leave 30 minutes late. A whole pile of people at the gate had missed earlier Norfolk flights and would be standing by for this one. Fortunately, I had a seat assignment.
5:30 came and went and the plane never arrived at the gate and the agent disappeared. Some pilots in uniform came to the gate who were commuting home and whined about the lack of agents. With no plane and no agent, 6:00 came and went. Then, another passenger for my flight who walked down the hall to the departures monitor said the flight was cancelled. Panic ensued.
Getting hold of my parents, I was able to learn the reservations number from the Internet. Apparently the plane got stuck in New York due to weather and they just decided to drop the rest of its flights. I asked the agent about other flights. No flights had seats through Norfolk until 3 PM the next day. No flights had seats through Newport News until the next morning. Despite complaining about my outbound screwup, the reservation agent said I would not be compensated for a hotel room due to weather. The agent booked me on the early morning Newport News flight and I thought about going to one of those Special Services desks and complaining until they gave me a hotel for free.
I talked to my parents again and again, using the power of the Internet, learned that I could get to Richmond. Surprisingly, my mom said if I could get to Richmond, she would drive the two hours to get me. There was a plane that left at 6:25. If I hurried, I might make it. Unlike the Norfolk flight, this flight was a mainline flight and left from C concourse and I was in F. I raced to the shuttle bus and got on the bus which happened to be just about to leave.
As I was on the bus, my phone rang: my adviser. Thinking I was back home, he told me that the session chair said I had made it to the presentation and that it went well. This was the worst time to be discussing this: I told him I was about to be stuck in Philadelphia. He couldn’t believe it. We talked some more about what a mess the travel was and then hung up and got off the bus.
I raced through the terminal and crashed into the check in desk at the gate for the Richmond flight. The plane was there. Two agents were there, one of whom told me to slow down as I mashed into the desk and my bags fell on the floor. I told them my story about the canceled flight and my rebooking and asked if I could get on the plane to Richmond. After a minute of typing, I got a new boarding pass and got on the plane.
The plane closed its door early and we pushed back before 6:25. We got away from the terminal and stopped. Out the window, the taxiways looked like a parking lot of airplanes. They were everywhere. The pilot got on the PA and said weather was preventing takeoffs to the north, but we were going to leave to the south. The problem was that all the northbound planes were in the way and couldn’t move. He sounded less than optimistic about getting out of there anytime soon.
We waited and waited some more. A girl got up to use the bathroom. When she came out, the whole plane smelled of cigarette smoke. A flight attendant came by and asked if she had been smoking, of course she denied doing so. A guy behind me said he was on a flight where someone next to him smoked in his seat and when the plane landed, the smoker was arrested.
7:00 PM came and went and we sat there, looking at the gridlock. A few planes took off. My legs were hurting from all the sitting. I called home and my dad couldn’t believe I was still sitting on the taxiway. My mom had already left for Richmond.
As we sat there and whined about the delay, I learned the guys across from me were also refugees from the Norfolk flight. They had missed an earlier Norfolk flight and were going to stand by for mine until it was cancelled. Like me, they had called someone to come and pick them up in Richmond and drive them back to Virginia Beach.
7:45 passed by and we had moved across a runway but were still stuck with planes in front of us. The captain came on again and said the control tower had slowed down departures to one plane per 20 miles. I hadn’t seen anything take off in almost an hour. It was starting to rain. If a storm came over the airport, that would be the end. We would go back to the gate and hundreds of people would be spending the night in the airport, myself included.
Finally, by 8 PM, planes started taking off again at regular intervals, but the captain told us we were way back in line and it would still be another 25 minutes. Unbelievably, my mom had already arrived at the airport in Richmond and was waiting in the terminal. By 8:50 and after two hours of waiting, we were in the air. Fortunately, it was a short flight and we were in Richmond by 9:30. As we were deplaning, one of the other guys from the Norfolk flight said he was going to flip if his bags didn’t make the plane. Good luck.
My mom met me in the Richmond terminal and it was a quick drive back with no traffic jams. Finally, after midnight and nearly 24 hours of traveling, I was back home. I slept like a rock and it felt great to get out on the bike this morning.
Perhaps I should write letters to US Airways and the DOT. What this will accomplish, I don’t know. Maybe I’ll get a small voucher to use for my next trip, which will stay well clear of Philadelphia. There had better be direct flights to Boston when I go to WASA. I took one when I went to IC4As in 2007, but it might be different now. It seems that the solutions to these travel nightmares may be mitigated by:
- Re-introducing more mainline flights. Apparently, regional jets are more prone to maintenance issues and do not handle weather as easily.
- Add more capacity. With every flight oversold, one cancellation creates a huge cascade of stuck travelers that cannot be rebooked onto the next flight. Adding more mainline flights will help this.
- Add more point to point flights or stagger departures and arrivals at hub airports. It seems that planes leave or arrive at a hub simultaneously, leading to huge traffic delays. Southwest has a good model to follow for this one.
- Reduce capacity through hub airports that are prone to weather delays. It seems that if someone so much as spits in Philadelphia, the whole place shuts down.
- Provide better customer service to help stranded travelers. I only found out the plane was canceled when another passenger told me. With no agent at the gate, the only option was to call the reservation office. Airlines should guarantee that a passenger will arrive at his or her destination within some fixed, reasonable time period or else provide a full refund.
Fortunately, I have time to recover from this before my next plane trip in August. If my next paper gets in to RTSS, I’ll only have to go to Washington. Maybe in the meantime, I’ll actually be able to get back to doing research since the last couple weeks have been spent mostly dealing with this trip.
Rome Trip: Retry
I’ve never boarded a plane, taxied away from the gate only to turn back before the runway, and then get off and go home. It’s incredible that due to some weather, I couldn’t get to my destination until two days after my scheduled flight. It’s even more incredible that I got screwed again on the way back.
Fortunately, I made it to Rome on the second try. My dad decided to come with me on standby but left a day earlier to ensure he would get back. There was no way I was ever going to check a bag, after going through that routine on my last trip to NCAAs in the fall of 2005. I dragged everything with me through the airports, planes, trains, and through the city to and from the hotel.
The flights over were fortunately uneventful, but both were full. I got stuck in the back by the galley on the Rome flight and it was a zoo the whole eight hours. The flight attendants were banging around and the flushing of the toilet sounded as if someone was opening a door to the air rushing by outside. A kid threw up in the aisle behind me, right next to one of the lavatories and another guy behind me broadcasted his side of a conversation to half the plane about touring Italy with a bunch of Latin language students. The guy across from me yakked it up with a flight attendant for quite awhile because he learned that the flight attendant was from Pittsburgh. With the uncomfortable seat thrown into the mix, I didn’t sleep well at all. My dad was lucky to get a seat up in the front, but didn’t seem to have a much better time.
The flight over was about on par with the Scotland trip: I did manage to sleep enough to be able to make it to the hotel before crashing. Also like the other European trips, the sun never did set completely. It was twilight for a few hours and then suddenly the sun popped up and blasted the left side of the plane.
When we arrived in the morning on Tuesday, there was a massive mob surging to get through the passport control. There was no organization at all and everyone pushed and shoved their way towards one of the agents. Giant, uncomfortable crowds seem to be characteristic of Rome.
Fortunately, the conference center and the hotel were within a few blocks from Termini Station, so my dad and I took an express train from the airport which dumped us out right where we needed to be. Google Maps said the hotel was right across the street from the train station, but the place was packed with people and buses and we wound up walking right past the hotel before turning around after several blocks. The hotel was hidden in a row of similar looking buildings without much of a sign. It was nice inside and it wasn’t long before we got a room and zonked out for a few hours.
Tuesday afternoon we left the hotel and walked the short distance to the conference center for SECON where I got my registration stuff and walked through the poster and demo session. There weren’t too many posters or demos, and many of the presenters were not there to show off their stuff. The poster and demo session at SenSys was much bigger. On the whole, the quality of work was much higher at SenSys, though there were a few things that stood out. A lot of presenters couldn’t come because of visa issues. I almost couldn’t make it either.
Following the poster session, my dad and I walked down Via Cavour to the Colosseum, past the Roman Forum and Palatine Hill as well as the Circus Maximus. It seems nobody cares about the Circus Maximus anymore — it’s a dirty, grassy field that people just walk around in. It’s the only thing I saw in my tour of the city that resembled a park. There were no other open spaces anywhere. All the tiny sidewalks were packed with tourists.
Because of the lack of open spaces, I didn’t run despite bringing my running shoes. We did a lot of walking, and there were a lot of steps due to the steep hills. It was the most walking I’ve done since the knee surgery and I’m not sure all of that was good for the knee. It’s popped a few times and felt a little weird since I’ve returned. The whole time, I only saw one guy running while going along a side street after we left the Circus Maximus. Sidewalks are only a few feet wide and packed with people everywhere, with intersections nearly every ten meters. Drivers are merciless and threaten to run anyone over. There was no way I was going to run in a place like that. I wouldn’t be able to go anywhere. Somehow, there were people that would just walk out in front of the attacking cars and miraculously make it across without being touched but I wasn’t even going to think about risking that. There were only a handful of cyclists, but I did notice that cars gave them plenty of room despite the fracas. Unsurprisingly, plenty of cars had side and quarter panel dents as well as paint transfers.
We walked past the Trevi Fountain and climbed the Spanish Steps, all of which were packed with tourists. There were just too many people at the places we went to make it really enjoyable. The entire city seemed to be one giant tourist trap, with throngs of tourists packing the streets and all the major monuments and museums. Oddly, many of the places we went to did not take credit cards, and had signs announcing this. I remember it wasn’t but five years ago when it was like that at home and now I take it for granted. We went through quite a bit of cash.
My dad and I looked up a restaurant in the Rome guide we had and managed to find our way there for dinner. I had pasta with bolognese sauce, which tasted nothing like the dish of the same name at home. At home bolognese usually means ground beef, but this was more like sausage, bacon, or something cured. It was different and definitely better than what I would find at home. I also had this massive mug of Italian beer that made it a bit tough walking back.
The hotel included breakfast as part of the deal and it was far superior to anything I would find at a standard American hotel. The hotel staff were extremely nice and when I couldn’t get their Internet connection to work with my laptop, asked me several times if I wanted to try it again or get help. The wait staff at restaurants were always wearing uniforms, and as my dad said, waiting tables in Rome seems to be a serious profession. There weren’t any sloppy teenagers with surly attitudes. The hotels and restaurants were an example of service done right and were a stark contrast to the approach taken in the United States.
Following breakfast on Wednesday, I went over to the conference with my dad and we sat through a panel session on the direction of wireless sensor networks. Everyone desperately wants wireless sensor networks to be more integrated with the rest of the computing world. People want IP stacks on motes, Java on motes, and applications to extend the social networking craze. I’ve seen several panel discussions and talks on this, but not much has actually happened yet. The powers that be are asking for papers in this area, but not much has been produced. The argument is that sensor network research is maturing and now it is ready for prime time. Tighter integration with existing systems through decoupling and modularization will allow this to happen.
Following the panel session, it was time for my session on routing. I watched three other presentations before it was my turn. Though the session chair wanted me to use another computer, my presentation worked fine. I didn’t screw up and I thought I did much better than the practice runs. I got some good questions and talked to several people afterwards about my paper. A few people weren’t familiar with the zone-based forwarding approach, so I explained it afterwards.
In the afternoon on Wednesday, we took the Metro to the Vatican and stood in a massive line to walk through St. Peter’s Basillica. I found it interesting that people in line for over an hour were turned away because they were wearing shorts. We also went into the Vatican Museum and Sistine Chapel. St. Peter’s was massive inside, and really made me feel tiny. Despite how big everything was, there were almost too many people to really appreciate it. We headed back towards the hotel, walking over the Tiber and past the Pantheon, another monument mobbed by tourists.
Every single monument or attraction in Rome is completely surrounded by buildings. You just walk through a narrow alley and out pops an obelisk. There are no skyscrapers; all the buildings seem to be made of adobe and aren’t more than a few stories high. Just about everything is covered in soot and dirt.
Wednesday night, we found a restaurant near the hotel and ate dinner, another pasta dish that was very good. There was also a coffeehouse that was recommended in the guide, so we stopped there too. Drip coffee doesn’t seem to exist in Italy or Europe, instead everyone drinks espresso or cappuccino. Apparently, cafe americano is seen as crap, and you will get laughed at if you order it. The coffee I had in Rome was good, but espresso is almost like drinking liquefied beans. I like coffee strong and black, but that was overload. I’m sure I could get used to it, but I’ve never understood the enjoyment of shots, be it coffee or alcohol.
Everyone we interacted with, from hotel and wait staff to people on the street seemed to know we were Americans. This, despite me wearing loafers, slacks, and button down shirts. It’s like we had targets painted on us. At a grocery store, the cashier addressed everyone in front of me in Italian. When it was my turn to pay, she spoke to me in English before I said a word. I also made a fool out of myself since I didn’t know I had to weigh the banana and print out a tag with its price on it. An irritated line of Italian teenagers formed behind me as the cashier went to the back and weighed the banana.
On Thursday two women tried to pickpocket me as I walked towards the conference center. One grabbed my arm while the other waved something in my face, so I shoved my hands in my pockets, walked faster, and broke free. It reminds me of something I read in one of Robert Ludlum’s books: when attacked without warning, “reach for your weapon, not the wound.” Don’t fall victim to the distractions and protect what’s important.
My dad left for the airport Thursday morning and I spent the rest of the day at the conference. The most interesting paper was on detecting complex events by converting a timeseries of sensor readings to a string and performing string matching with training data. One guy from UVA gave a presentation and we talked for awhile afterwards. By the end of the day, with several shots of espresso during the breaks, I was beat. I never really got over the jet lag and didn’t sleep very well. The jet lag did not set me up well for the return trip, which became almost as much a disaster on the way out, but I’ll leave that for the next post.
Fortunately the weather held up well: it was cool in the mornings and got hot in the late afternoons, cooling down again as the sun set. The climate was much like central California, or Sacramento.
Overall, it was an interesting trip, but I don’t think I would go to Rome again. It was like Colonial Williamsburg, but with many more tourists. I’m sure there are plenty of less touristy and other interesting places in Italy that would be worth visiting if I was there for more than three days.
BCI Pulse Oximeter in TinyOS 2.1
Posted by Matt in development on June 15, 2009
After days of getting lost in TinyOS 1.1 and 2.1 low level hardware abstractions, the Harvard design BCI pulse oximeter now works in TinyOS 2.1.
Prior to writing the driver/interface code, I had to procure the pulseox hardware. Detailed descriptions of hardware, software, and applications are found at the Harvard CodeBlue website. I first ordered a Smiths Medical OEM Digital Micro Power Pulse Oximeter Board. I was able to get in contact with sales staff by emailing Smiths Medical. The pulseox board comes with a finger sensor and runs about $200.
Next, I needed an interface board to connect the BCI pulseox board to the 51 pin connector on the Crossbow IRIS. The Harvard CodeBlue source code has documentation for a PCB layout and suggests that you order the PCB from an online manufacturer. You also have to purchase some other components that must be soldered onto the interface board. Fortunately, I was able to “skip” this step with the help of Leo Selavo, who graciously supplied me with two interface boards. He emphasized that soldering the components onto the interface board requires a lot of skill and experience and if I were to try on my own that I would most likely break the PCB or components several times until I got it right. The setup with pulseox board, interface board, IRIS mote, and finger sensor is illustrated below:
With the pulseox board, interface board, and of course IRIS mote, I was ready to get my heart rate. The biggest challenge still lay ahead: writing code to interface with the pulseox. The CodeBlue pulseox code was written in 2005 for TinyOS 1.0. All of the low level UART and mote hardware interfaces have changed drastically since then, so the old code wouldn’t just work right out of the box. I had seen plenty of posts on the CodeBlue mailing list about implementations for the pulseox in TinyOS 2.x, but nobody had bitten the bullet and actually written anything.
What I wanted was to be able to use the pulseox like a sensor on the MTS300/310 sensorboard: call a Pulse.read() or Oxygen.read() command and get back a uint16_t with pulse or blood oxygen saturation. This is fairly straightforward since I had experience modifying the MTS310 sensorboard code to power on the sensors manually. I created configurations PulseC and OxygenC to provide SplitControl and Read interfaces to power on the sensor and read, respectively. I then wired PulseC and OxygenC to a PulseoxP, which functioned as an intermediary between the application and the low-level pulseox driver code. Like in the original CodeBlue source, I created a BciC configuration and BciP implementation to communicate with the pulseox directly through the UART and return data back to PulseoxP.
The key changes between the CodeBlue TinyOS 1.0 code and my implementation are all found in BciP (or BCIM.nc in the original CodeBlue source). Two issues come to mind. First, setting the mote hardware pins is done differently in TinyOS 2.1. Calls like TOSH_SET_PW0_PIN() are replaced by abstractions. I had to wire MicaBusC.PW0 to the GeneralIO interface in BciC and then call GeneralIO.set() in BciP.
The second difference is with the UART. TinyOS 1.0 uses the HPLUART interface for low level UART communication, but this has been replaced by Atm128Uart0C for the Atmel 1281 architecture. The CodeBlue source code initializes the low level UART to its default state, turns it off, and then sets the hardware registers to the desired UART configuration so that the mote can communicate with the pulseox board. After figuring out what the CodeBlue UART configuration code did, I can’t believe that you can actually write to the registers directly! Imagine if you could do that with user-level code on a PC! To enable transmissions and reception along with interrupts for the UART in TinyOS 1.x, you had to do the following:
// Enable tx/rx interrupts and tx/rx
outp(((1 << RXCIE) | (1 << TXCIE) | (1 << RXEN) | (1 << TXEN)) ,UCSR0B);
TinyOS 1.0 uses the outp() macro to set bits of a given register, but this macro does not exist in TinyOS 2.x. Instead, the UART register bits are configured in a struct with fields for each bit in the register. For the above example in TinyOS 2.1, the following union represents the control register in Atm128Uart.h:
/* UART Control Register */
typedef union {
struct Atm128_UCSRB_t {
uint8_t txb8 : 1; //!< UART Transmit Data Bit 8
uint8_t rxb8 : 1; //!< UART Receive Data Bit 8
uint8_t ucsz2 : 1; //!< UART Character Size (Bit 2)
uint8_t txen : 1; //!< UART Transmitter Enable
uint8_t rxen : 1; //!< UART Receiver Enable
uint8_t udrie : 1; //!< USART Data Register Enable
uint8_t txcie : 1; //!< UART TX Complete Interrupt Enable
uint8_t rxcie : 1; //!< UART RX Complete Interrupt Enable
} bits;
uint8_t flat;
} Atm128UartControl_t;
The flat uint8_t is a real slick way to convert all the elements in the struct to a single word, which can then be written to the register. Following the code that initializes the UART in tos/chips/atm128/HplAtm128UartP.nc, I was able to configure the UART to run with the pulseox board requirements: 4800 baud, double rate, transmission and reception interrupts enabled, no parity checking, 1 stop bit, and 8 bit word size. So, with the previous example to enable transmissions and reception, you do the following in TinyOS 2.x:
Atm128UartControl_t ctrl;
ctrl.bits = (struct Atm128_UCSRB_t) {rxcie:1, txcie:1, rxen:1, txen:1};
UCSR0B = ctrl.flat; // ctrl.flat
I ran my concerns by the CodeBlue mailing list, which elicited a reply from Prof. Matt Welsh that I was headed in the right direction. I finished my implementation, worked out some compile errors, and loaded the new pulseox and general data collection code onto a mote to see what would happen. Almost never does my TinyOS code run correctly on the first try — usually I spend hours or days debugging, but this time it was magic. A number jumped onto the screen in the data column of my PC Java application, which was connected wirelessly though a base station mote to the pulseox mote. The sensor readings seemed reasonable for a heart rate, for jumping up and down and breathing hard made it go up and laying down and trying to breathe slowly made it slow down.
I have made my code available here and any feedback, suggestions, or questions are encouraged. To use it, place the pulseox directory into the tos/sensorboards directory in TinyOS 2.x. In the makefile for your application, add the line “SENSORBOARD=pulseox”.


Recent Comments