LilyPad Arduino Setup Tutorial


The LilyPad is an Arduino based device used for wearables and e-textiles and as such uses the M2X Arduino library to send/receive data to/from AT&T's M2X service.

Getting Started

  1. 1 Obtain your Master Key from the Master Keys tab of your Account Settings screen.
  2. 2 Create your first Device and copy its Device ID.
  3. 3 Review the M2X API Documentation.
  4. 4 Obtain a LilyPad and use a 3g/Cellular Modem Shield and set it up.

How to Install the Library

The M2X Arduino library depends on jsonlite. The installation steps are as follows:

1. Clone the jsonlite repository.

2. Open the Arduino IDE, click Sketch->Import Library...->Add Library..., then navigate to amalgamated/jsonlite folder in the cloned jsonlite repository. The jsonlite library will be imported to Arduino this way.

NOTE: If you cloned the jsonlite library, there will be 3 folders named jsonlite:

  • jsonlite: the repo folder
  • jsonlite/jsonlite: the un-flattened jsonlite source folder
  • jsonlite/amalgamated/jsonlite: the flattened jsonlite source for arduino

3. The last folder is the one you should use — the first two won't work!

4. Use the instructions outlined in Step 2 above to import the M2XStreamClient library in the current folder from the M2X Arduino library.

5. Now you can find M2X examples under File->Examples->M2XStreamClient

Board Setup

The LilyPad website has a very good tutorial on setting up the LilyPad. It contains detailed instructions on how to install the Arduino IDE as well as connecting to your LilyPad. Feel free to proceed to the Arduino site to get a basic overview on how Arduino based boards work.

NOTE: On Mac OS X 10.9 if you are experiencing connection issues such as "programmer not responding" please see this thread.

Wifi/Ethernet Shield Setup

The LilyPad has no direct shield interface nor are the MISO/MOSI pins exposed to manually connect to the shields. Accordingly, there is no support for this connection at this point in time.

3g/Cellular Modem/Shield Setup

Since Serial RX/TX is exposed through the FTDI connection, the LilyPad can access the Internet through a compatible 3d/Cellular Modem using the M2X SerialModem library and connecting the Serial RX/TX lines to the Modem. Installation instructions can be found on the SerialModem GitHub page.