You are here

Particle Photon Configuration with Tinker Firmware | サイプレス セミコンダクタ

Particle Photon Configuration with Tinker Firmware

In the last article I wrote about using a CY3280 MBR3 Shield on a WICED WiFI 943907AEVAL1F development kit at the GE MegaHackathon.  In the next article I will show you the WICED HTTP firmware that I wrote to connect to the Particle Photon which they were using (I have written about Particle Photon before).  Obviously, I like Particle Photon because it is a WICED 43362 WiFi Radio.  In this article, I am going to show you how to get a Particle Photon going with the Tinker firmware.  Then test it with the iOS app, the web console and finally using CURL.  The CURL is just a mechanism to send HTTP Posts to the Tinker firmware, exactly what I will do in the next article on the WICED development kit.

Configure the Particle Photon

When you get a fresh Particle Photon out of the box you need to get it introduced to your WiFi network, and attached to your console.  To do this, start by going to and following the process.

Particle Device Setup Screen


Particle Device Setup Screen


Particle Device Setup Screen


Particle Device Setup Screen


Particle Device Setup Screen

Particle Device Setup Screen

Particle Device Setup Screen


Particle Device Setup Screen


Particle Device Setup Screen


Testing with iPhone App

One you have “claimed” your Particle Photon and it is connected to the network, then you can talk to it with the Particle iOS app.  Here is what it looked like when I started the App on my phone.  You can see the device called “iotexpert-example” (remember that is what I named it from above).  The “Elkhorn_creek” Photon is the one that I wrote about in this article.

Particle Device Setup Screen

Although the console says that I have the Tinker Firmware on the app, I wanted to make sure, so I use the iOS App to re-flash the Tinker Firmware.  You can do this by clicking the new device, then press the little “…” at the top right of the screen.  Finally click “Reflash Tinker”. It is awesome how fast that happens.

Particle Device Setup Screen


Once I am sure about the version of the Tinker firmware, I test to make sure that things are working correctly.  First I click on “D7”

Particle Device Setup Screen


Which brings up this screen where you can select digitalRead and digitalWrite.

Particle Device Setup Screen


Then when you press the button it will switch from high to low and vice versa.

Particle Device Setup Screen


Particle Device Setup Screen


You can also call the API directly by pressing “inspect” then “Data”

Particle Device Setup Screen

Particle Photon Console

In addition to using the iOS App, you can also interact with the Photon using the console.

Particle Device Setup Screen


When I click on the “iotexpert-example” it brings up this screen where I can run the Tinker firmware functions.  In this case I ran “digitialwrite” with “D7,HIGH” which turns on the LED on the Photon.

Particle Device Setup Screen


Testing the Particle Photon with CURL

The Particle Cloud exposes an API which lets you send Restful API requests to specific devices.  The Unix tool CURL lets me type command line requests (which I will mimic in the next Article using WICED).  The first command that I send is and HTTP GET which will return a JSON document that describes the configuration on my Photon.


You can see the device name etc in the JSON below.  It also shows that the Tinker firmware has four function built into it.


Then I can send a HTTP POST using Curl to turn on the D7 LED.

curl -d access_token=1311f67269d66b -d params=D7,HIGH

You can see the Blue LED right next to D7 turns on.

Comparator Diagram Particle


Particle Photon Tinker App

I wondered where the Tinker App API was documented?  It turns out that the App is available in Particle library.  You can search by typing “tinker”.

Particle Device Setup Screen


The section of code that matters is here.  The function takes a “String” and parses it.  It demands that the 2nd character be a PIN number between 0 and 7.  The first character be a capital “D”.  Then you need to have a “HIGH” (in caps) or a “LOW” (in caps)

* Function Name  : tinkerDigitalWrite
* Description    : Sets the specified pin HIGH or LOW
* Input          : Pin and value
* Output         : None.
* Return         : 1 on success and a negative number on failure
int tinkerDigitalWrite(String command)
bool value = 0;
//convert ascii to integer
int pinNumber = command.charAt(1) - '0';
//Sanity check to see if the pin numbers are within limits
if (pinNumber< 0 || pinNumber >7) return -1;
if(command.substring(3,7) == "HIGH") value = 1;
else if(command.substring(3,6) == "LOW") value = 0;
else return -2;
pinMode(pinNumber, OUTPUT);
digitalWrite(pinNumber, value);
return 1;
else if(command.startsWith("A"))
pinMode(pinNumber+10, OUTPUT);
digitalWrite(pinNumber+10, value);
return 1;
else return -3;

In order to access the digitalwrite function via the network, they publish it (and some others).

* All the based tinker functions are registered. You can add you own code.
// This #include statement was automatically added by the Spark IDE.
#include "Tinker.h"
void setup() {
//Register all the Tinker functions
Spark.function("digitalread", tinkerDigitalRead);
Spark.function("digitalwrite", tinkerDigitalWrite);
Spark.function("analogread", tinkerAnalogRead);
Spark.function("analogwrite", tinkerAnalogWrite);
void loop() {

When I first thought about the Tinker firmware I thought that it must be reasonably complex.  But it is not because it takes advantage of the Particle cloud functionality.  All in all what they did is very elegant and simple..

Now that it looks like my Particle Photon is working, in the next article I will show you WICED firmware to read the CapSense buttons and then Turn On/Off the LED on the Photon.



Jaredosorio_2966451's picture

Thank you for sharing. This is really informative post, I will definitely share this with my friends. I am writer, currently providing write my paper service for student.

William Riley's picture

Thanks for taking time for writing on particle photon configuration with tinker firmware. This will sure help developers who are looking for such kind of tutorial how to configure particle photon with easy steps. By after providing college assignments help to university students at Quality Dissertation under the guidance of expert writers, I love to read tutorial & guidance, tips on various subjects which are important for everyone in daily life as well as professional.

joesimon817_2942771's picture

Great tutorial!
Word meaning, definition Spanish dictionary online

Router help

samwithers_3002041's picture

I read your entire article and I genuinely like it. like this

mondevoyance_3031296's picture

I think this is an informative post and it is very useful and knowledgeable. Voyance par téléphone gratuite.

Melworks Beads's picture

A great article on particle photon. I remember when I took my first modern physic subject at new mexico state university, it was awesome. Now I am doing other things in life but still keep an eye on the latest developments in this field.  Some of my other interests now include online gemstones & beads

このサイトに掲示されているすべてのコンテンツと資料は、「そのままの状態」で提供されます。サイプレス セミコンダクタとその関連サプライヤは、これらの資料について、いかなる目的への適合性をも表明することはありません。また、これらの資料について、すべての保証や条件を放棄します。これには、暗示的な保証および条件、商用性、特定の目的への適合性、すべてのサードパーティの知的財産権に対する権利と非侵害などが含まれますが、これらに制限されることはありません。サイプレス セミコンダクタにより、明示または暗示にかかわらず、禁反言などによるライセンスは、付与されないものとします。このサイトに掲示されている情報の使用には、サードパーティまたはサイプレス セミコンダクタからのライセンスが必要となる場合があります。

このサイトのコンテンツには、特定のガイドラインや使用制限が含まれている場合があります。このサイトにおけるすべての掲示やコンテンツの使用は、サイトの利用規約に準じて行われるものとします。このコンテンツを使用するサードパーティは、制限やガイドラインに従い、このサイトの利用規約を遵守するものとします。サイプレス セミコンダクタとそのサプライヤは、コンテンツや資料、その製品、プログラム、サービスに対し、いつでも修正、削除、変更、改善、向上、その他の変更を加える権利を有します。また、いかなるコンテンツ、製品、プログラム、サービスを予告なく変更または閉鎖する権利を有します。