Serial Web Services API

The Serial Web Services API allows data sent into the Serial Smart Board (SB-5) and be routed to web services from Twitter, Google, Yahoo, etc. Using this API, you can have a microcontroller send email, request stock quotes, and get the current temperature and time - opening up the world wide web to microcontrollers and embedded serial devices. The IO-204 acts as a conduit to the Internet and web services for microcontrollers connected to a serial smart board.

Setup

Connect a serial device to the transmitter, receiver, and ground of the Serial Smart Board connected to the IO-204 Ethernet module. Match baud rate and signal type (true or inverted) on both your serial device and the serial smart board. Serial settings are configured on the Module tab.

Usage Limits

Transactions

Using this API allows for so many transactions in a 24 hour period. Abuse will cause the disruption of messages temporally. The limit is 1440 transaction is a 24 hour period, which equates to one transaction per minute.

Long Messages

The serial smart board has a buffer of 200B. When the buffer is full, the RTS pin goes high. The buffer clears a moment later and you can send more data. You can send long commands thru the board if you put a second of pacing between 200B chunks of the message. The API looks for the opening brackets and closing brackets before the service acts on the command. However, if you transmit more than 200B to the board without pacing, only 200B will be transmitted to the server which breaks the command.

Web Service Commands

The format for commands are as follows:

[[[command|parameters]]]

Sending serial strings wrapped in brackets will cause the command to be routed to web services. The commands are delimited by pipes (“|”).

email

[[[email|address|subject|body]]]

Reply: Sent

Use the email service to allow your microcontroller to send email, text messages, Twitter / Facebook updates, and UberNote notes

Text Messaging

You can also receive notifications to an event as a text message by entering your cell phone's email address. Your cell phone number can be converted to an email address based on your service provider.

  • AT&T: yournumber@txt.att.net
  • Verizon: yournumber@vtext.com
  • T-Mobile: yournumber@tmomail.net

Note: ioBridge Corporation is not responsible for charges incurred by text messaging. Your standard text messaging rates apply with your mobile carrier.

Twitter Mail

Twitter Mail allows you to send an email to a email address that's linked to your Twitter account. They will then use the Twitter API to post a new Twitter for you. The service works extremely well. Once you get your Twitter Mail address you can natively add it to your Email Accounts on ioBridge.

Twitter Mail

Social Networks via Ping.fm

Ping.fm allows you to update multiple social networks via email. Ping.fm is recommended to update your Twitter, Facebook, and GTalk status. Once you sign up at Ping.fm, you will have an email address that is linked to your social networks. Add that email account to your ioBridge.com account and now your ioBridge actions can tweet, update Facebook, etc.

Ping.fm

UberNote

UberNote is free note taking service that is a replacement for Google Notes. UberNote allows email access to post new notes. Once you setup and account, an email that is linked to your account is created and listed under your settings page. If your action sends a message to the UberMail address, it will be automatically posted to your account. UberNote also supports tagging and public RSS feeds of notes.

UberNote

datetime

[[[datetime]]]

Reply: yyyy-mm-dd hh:nn:ss (GMT/UTC)

date

[[[date]]]

Reply: yyyy-mm-dd

time

[[[time]]]

Reply: hh:nn:ss (GMT/UTC)

stock

[[[stock|symbol]]]

Reply: (last trade stock price)

weather

[[[weather|location|options]]]

Location can be any zip code or city name.

Options:

  • temp_f
  • temp_c
  • humidity
  • wind_condition

Default: temp_f

Reply: (weather info)

calc

[[[calc|expression]]]

Expressions are based off of Google Calculator syntax. You can convert units and perform mathematical operations.

Reply: (result)

get

[[[get|url]]]

Reply: (response up to the first 70-80 characters)

Use the “get command” to GET a URL of your choice.

data_log

[[[data_log|key|timestamp|data]]]
  • key: 18 alpha numeric characters - The key is created at ioBridge.com by adding a Data Log from an External Source to your account. This key will tie the serial data being pushed to the database.
  • timestamp: yyyy-mm-dd hh:nn:00 - If the timestamp field is blank, the API will use the current GMT/UTC system time.
  • data: Serial string up to 50 characters

Reply: Inserted

Arduino Example

Request

Serial.print("[[[stock|GOOG]]]"); 

Reply Handler

char charIn = 0;
byte i = 0;
char stringIn[32] = "";

while(Serial.available()) {
    charIn = Serial.read();
    stringIn[i] = charIn;
    i += 1;
}

int stockPrice = atoi(stringIn);

Basic Stamp (BS2) Example

Humidity

The following command replies back with the current humidity percentage in Gainesville, FL.

SEROUT 8,84,["[[[weather|Gainesville, FL|humidity]]]"]

Sends serial data out of pin 8 of a BS2 at a baud rate of 9600 with an inverted signal

Basic Stamp Email

The following command emails the current temperature measured by a serial temperature sensor.

SEROUT 8,16468,["[[[email|support@iobridge.com|My Temperature|My temperature in my room is ", SDEC tempF,".]]]"]

Sends serial data out of pin 8 of a BS2 at a buad rate of 9600 with a true signal - SDEC tempF is from a serial sensor hooked up to the BS2

Projects

Internet-enabled Message Center - Project from ioBridge user that uses the Arduino and the Serial Web Services API to get stock quotes, get weather, and send email.

Resources

 
api/serial-web-services-api.txt · Last modified: 2009/11/28 02:33 by iobridge

Recent changes RSS feed Driven by DokuWiki