Connect to M2X API using Teensy
You can use the existing Arduino Client Library on a Teensy board. It is fully compatible.
This information is also availabe as a M2X Teensy Tutorial.
- Signup for an M2X Account.
- Obtain your Master Key from the Master Keys tab of your Account Settings screen.
- Create your Device and copy its Device ID.
- Review the M2X API Documentation.
Please consult the M2X glossary if you have questions about any M2X specific terms.
How to Run the Ethernet examples
In order to connect using Ethernet, WIZ812 Ethernet Module and Teensy to WIZ812 Ethernet Adaptor Kit are needed in addition to a Teensy board. In order to connect all devices together, soldering work is also required.
- Solder the adaptor according to the guide here. Depending on the specification of your Teensy board, you may or may not need to perform additional soldering work.
- When the soldering is done, connect the Teensy board, WIZ812 Ethernet Module and the adaptor together as shown in the guide.
- Install Arduino on your system.
- Install Teensyduino on your system.
- Install the M2X Arduino library following the steps here
- Since there's a bug in Teensyduino, please download the file in this gist, and use the
Print.cppfile to replace the same file in Teensyduino. On a Mac with standard installation, this file is at
/Applications/Arduino.app/Contents/Resources/Java/hardware/teensy/cores/teensy/Print.cpp. If you are using other OSes, the specific path may be similar but slightly different. One tip is to start looking in the Arduino application folder.
- Then you can open the
EthernetUnoPostexample, and tweak the Device ID, Stream Name and M2X Key to the valid values.
- Select the board to want to run the example on (Teensy or Teensy++), click
Upload, follow any instructions on screen, your board should be reporting data to M2X shortly!