How to Setup a Photon and Program with the Pi
2019-01-30 | By Maker.io Staff
The Particle Photon is a Wi-Fi module that is easily programmed to make DIY IoT projects. Unlike other modules, the Particle Photon can be programmed over-the-air and does not require a USB connection for updating the firmware. We’ll learn how to configure a Photon with a network and then program in-browser on the Raspberry Pi.
Register a Photon Account
In order to be able to use the Particle Photon, an account is required. Setting up an account is entirely free and done in-browser by visiting the link below. Once registered, the website will ask you what you would like to do; click “Setup a Photon”.
https://login.particle.io/signup?app=setup&redirect=http://setup.particle.io
Setup Your Particle Photon
The next steps ensure that you have all the correct equipment. This includes the photon itself, a USB micro B cable, a Wi-Fi network, and credentials for that network. The credentials are details including the SSID and password of your network. When you click next, it will prompt you about downloading a special secure file. This file is used to configure the photon so click “continue with local file”. Note: your computer MUST have a Wi-Fi adapter so it can connect to the photons network! It does NOT work with an Ethernet cable.
When the file downloads, open it in chrome and follow the on-screen instructions. The first step asks to hold down the SETUP button on the Photon for 3 seconds until the LED flashes blue. Next, connect to the Wi-Fi network called Photon-xxxx, where xxxx is some unique identifier.
Once a successful connection is made you are required to select your Wi-Fi network and SSID. Click next, and if successful, your LED light should be glowing cyan. If not, go back to the network configuration and re-enter your details to ensure they are correct. Once done, it is time to name your Photon.
Programming the Particle Photon
The Photon supports multiple interfaces both locally and remotely. While some users prefer to use a local IDE this tutorial will be concerned with over-the-air programming. One of the major advantages of using the web-browser based IDE is that we can program the Photon on the Raspberry Pi in the Chromium Browser. To load the IDE, follow the link below:
https://build.particle.io/build/new
Once you are logged in you should see something similar shown below. The buttons on the vertical bar are used to: flash the program in the IDE, verify the program and check that it will compile correctly, open a previous project, enter code, libraries, help, docs, devices, console, and settings.
For now, we will start by loading the blink example.
With the blink example loaded, click the flash icon on the top left of the IDE to compile and send the program to the Particle Photon. Unlike the Arduino, the Photon does not need to be connected to a computer to work. It only needs a power source and an internet-enabled Wi-Fi connection. Programming the Photon takes a while, and my Particle Photon took about 1 minute to download and flash the program before the LED started to blink blue.
Pro Tip: Multiple Photons
Up to this point we have assumed that you only have one Photon registered to your account. In this case, the IDE will automatically use that specific Photon as the target. But what if you have registered multiple Photon devices? In this case, you can tell the IDE to target a different photon by clicking the devices icon in the menu bar and then selecting the small star icon next to the Particle Photon you want to program.
There is a slight problem though; how do you identify different Photons? The designers of the Photon have got this one figured out so you can send a test signal to any connected Photon. This lets you know exactly which one is which. To do this, select the arrow symbol next to the device you want to find and then press the “Signal” button. When you press “Signal” the Photon will display flashes of color, helping you recognize which one you want to target!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum