There’s a Button for That

Uber
5 min readbeginner
--
View Original

Overview

The article discusses the use of the AWS IoT Button to simplify the process of requesting an Uber ride. It details the implementation of a programmable button that can request different Uber services based on the type of button press.

What You'll Learn

1

How to program the AWS IoT Button to request an Uber ride

2

Why surge pricing acceptance is important when using Uber

3

When to use different button presses for various Uber services

Prerequisites & Requirements

  • Basic understanding of AWS IoT services
  • Familiarity with HTTP requests and JSON

Key Questions Answered

How can the AWS IoT Button be used to request an Uber?
The AWS IoT Button can be programmed to send a JSON object to an AWS endpoint when pressed. Depending on the type of press (single, double, or long), it can request different Uber services like UberX or UberBlack.
What happens when surge pricing is in effect for an Uber request?
If surge pricing is active, the Uber API returns a status code 409 along with a surge_confirmation_id. The user must accept the surge pricing through a web interface, which can be automated in the code.
What are the different types of button presses recognized by the AWS IoT Button?
The AWS IoT Button recognizes three types of presses: SINGLE, DOUBLE, and LONG. Each type corresponds to different actions, such as requesting an UberX, requesting an UberBlack, or cancelling a request.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Hardware
AWS Iot Button
Used to programmatically request Uber rides with a simple button press.
Backend
AWS Lambda
Processes the JSON object sent by the AWS IoT Button to handle Uber ride requests.

Key Actionable Insights

1
Implementing the AWS IoT Button can significantly streamline the process of requesting rides, reducing the steps involved to just a button press.
This is particularly useful in situations where quick access to transportation is needed, allowing users to bypass multiple app interactions.
2
Automatically accepting surge pricing can save time and ensure that rides are secured during high-demand periods.
This approach is beneficial for users who prioritize immediate transportation over cost, especially in urgent situations.
3
Using different button presses to request various Uber services can enhance user experience by providing flexibility.
This allows users to customize their ride requests based on their needs at the moment, such as opting for a more luxurious ride or cancelling if necessary.

Common Pitfalls

1
Failing to handle surge pricing correctly can lead to unsuccessful ride requests.
If surge pricing is not accepted, the request may be denied, leaving users without a ride when they need it most.
2
Not properly detecting button press types can result in incorrect Uber service requests.
If the button press type is not accurately identified, users may end up requesting the wrong type of ride, which can be frustrating.

Related Concepts

AWS Iot Services
HTTP Requests
JSON Handling
Uber API Integration