Enter the Photon

The details

tmpF540Particle.IO have been trying to send me a Photon for as long as I can remember. This all started in the summer when I was in Spain. I was expecting the device to arrive and the Spanish postal authorities got hold of it. I don’t know if they thought it was a top secret time travel device but they sent me a form requesting proof of purchase, proof I was a company and other paperwork. So I told them that this was a sample with no value, I’m not a company and I had no paperwork I didn’t have the goods and I’d not placed an order). The unit had travelled all over the world and was now sitting in Madrid while someone made themselves important. Despite various attempts in English and Spanish by myself and others, they simply were not releasing this until they had my sock length and proof of existence. By the end I’m betting Particle.IO had wished they’d not bothered.

tmp5722However, here I am back in the UK for now and shortly after I arrived, a second unit arrived.. followed promptly by the one which was supposed to go to Spain. You have to wonder… 

Checking their website these come in at about $19 (which not doubt ends up as £19 in rip-off Britain – I’ve not checked). As always you can zoom in on these images. So opening the rather neat and tiny box, you find inside, the Photon. It has a micro-USB connector as well as reset and setup buttons.

The Difference

So, what differentiates this from say, something like an ESP-12 or similar boards? So this is a small WIFI-enabled controller, programmed in something that looks suspiciously like the Arduino language – this is course is deliberate to give it that familiar look and feel. But looks can be deceiving – this is a powerful ARM Cortex M3 processor with a Broadcom WIFI chip complete with on-board v3v3 power supply – oh and the design is open-source.

Pins include D0-D7, A0-A5, ADC, DAC and serial I/O an the unit supports battery operation. You get 1 MB Flash and 128KB RAM. There’s an RGB status LED (nice touch) and FreeRTOS is pre-installed. There is a softAP setup mode and the unit is FCC,CE and IC certified. There is an internal ceramic aerial and a connector for an external aerial. You also have SPI,I2C,I2S (whatever that is), CAN, USB and PWM.

 

tmp311C

There’s a VIN pin or you can supply power (3.6v – 5.5v) or via the USB Micro B connector. Power supply should be able to source 1A of current to be safe.

Here’s a neat thing – in one mode the unit can constantly switch between internal and external aerial to see which is the best signal – I like that. All the pins except A3and DAC are 5v tolerant – which is nice.

I’m not going to go through the fine detail as it is all on their website. https://docs.particle.io/datasheets/photon-datasheet/

Programming

I remember the hassle I had trying to get to know the ESP8266 at first. Chinese only documentation, then Chinglish documentation, a lot of vagueness (all solved now of course) – but here we have EXCELLENT documentation at least from the perspective of someone coming in from the cold.

When it comes to actually programming this device…. the WEB IDE is really very good.  Being me the very first thing I did when opening the pack was to plug the board into USB – and it started up with one blue constant light and a blue flashing light – a good indication that something is actually working.

With no previous experience I went off to the web IDE here. https://build.particle.io/signup

I provided my email and password and within seconds I had an IDE in my CHROME browser with an empty program looking remarkably like Arduino.

tmpD652

I noted an example to blink a LED and clicked on that. Like Arduino it created a personal copy of this for me to play with – I have to say – neat – but at this point I was wondering – how on earth is it going to know where my board is!! Sure enough when  I came to the button to FLASH the chip it came up with “ADD NEW DEVICE”.

The WIFI setup

I noted a reference to Android and a light went on – it probably has an ACCESS point. I grabbed my mobile and sure enough – I could see PHOTON_CQGE. I hate reading manuals and so dived straight in.

I went on the phone for any old web page thinking that a login page might appear but no – a normal web page popped up – somehow the phone knew I was being an idiot and transferred me back to my home WIFI.

The instructions in the IDE said to go get the PARTICLE APP on my phone – so I did and logged in using the same account password I’d used on the PC – it said “let’s get started” and the next thing I knew it was connected to the Particle and asking for my WIFI details.

I have to say the APP was VERY slick. It warned me the setup might take a minute. Well, it didn’t work so I tried again. That didn’t work.

The USB setup

I did remember reading something about USB – I was plugged into my PC and I started to wonder if the board was getting enough power. I plugged it into a USB hub instead. No difference. At the third attempt the APP crashed on my Samsung S4. I rebooted the Samsung and tried again. No joy. The very slick App was dead.

The website said not to worry and here was another way! For attempt 2 I plugged the Photon back into the PC (and thinks were going SO well).  I already had NODEJS on my Windows PC so I downloaded the device driver and installed it – doddle – worked first time.

I then opened up a command line window in Windows 10 and followed the instructions.

npm install -g particle-cli

That worked (I’m familiar with that command thanks to Node-Red and the PI – it’s a NODE installer. I’d say all of that took maybe a minute with no errors.

I typed “particle setup” at the command prompt.

No problem – login – it didn’t help that they used colours and I’d set the command line to have a white background – but that’s my fault.  Immediately the software knew I had a Particle.

The software asked me for the WIFI setup and I put that in – but no matter what I did… the Particle would not connect. My PC is hardwired so the software asked me if I wanted to enter details manually for the WIF – I did –  “Obtaining device information..” I could not get past this. I tried the second unit – identical issue.

The page here… https://docs.particle.io/guide/getting-started/connect/core/

says “If your device is not connecting – try troubleshooting here..

I was using channel 1 (the device does not support channels above 11 which seems odd.

I had a standard network with WPA2 security….

No matter what.. the device would not connect to my router.

Inspiration

I went back to WIFI setup on a hunch. I wondered if perhaps my phone was being rather too keen to switch back away from the Photon WIFI during setup or perhaps there was an issue with it.

I went back to the Android setup and just before entering the WIFI access point and password I checked which network my phone was using. Voila – it had switched back to my own network. I switched it back to the Photon’s own access point and quickly swapped apps to run the setup. It worked flawlessly. I now had a Photo device online.

Back to the PC

With the phone turned off and armed with a Photon minding it’s own business with power only going to it and a name which SHOULD now be available – I went back to my PC setup.  I assumed that if the APP could see the device when logged in – so could the PC web application. I adjusted the simple BLINK program to flash 5 times a second and hit the lightning indicator to FLASH the board.

As if by magic the board started flashing purple to program (the RGB LED is a REALLY good idea) and seconds later D7 was merrily flashing away at 5 times a second. GOOD START.

There is a “publish and subscribe” system which looks remarkably like MQTT – if this worked then I was thinking they might get some business out of me as I use MQTT extensively with my little ESP boards – but I suspect not at least I could not find anything to suggest that it was a configurable MQTT setup. For these to be useful to me, my Node-Red setup must be able to control the boards.

tmp9296WELL – don’t you know, there’s a node-red-contrib-particle node!!! So being the impatient type I went off and installed the relevant node in Node-Red. A set of 3 nodes appeared.

I flashed the example function “Web connected LED” which created a function called LED which toggles a LED on and off (the little blue one attached by default to D7), No problem.

Playing by ear, I dropped the Particle Function node onto my work area in Node-Red (running on a Pi)

The IDE gave me my ACCESS token and the address of their server… all very easy..

Apparently there are some limitations if you use your own server – and I think that needs resolving as I do NOT want to be relying on someone else’s server for my winter heating (or door locking for that matter)… the IDE also gave me the ID number of my device.  I took a guess – the function name – LED seems reasonable.

I stuck an INJECT node into the Particle function node- and pressed the button on the Inject node and … nothing – not a sausage. Then I realised that they didn’t really mean TOGGLE – you had to pass a parameter ON or OFF.

tmp867C

I pressed the buttons – nothing. Then I noticed that the access key I’d picked in the IDE was timed out – why would that be? Well, so I pressed for another access key and punched that into Node-RED. SUCCESS!! Node-Red and hence any of my gadgets can now control the Photon. But MQTT would be good…

A Node-Red trivial MQTT to Photon function is of course simple to implement – and so we have a NEW TOOL to add to my home control box. Ok, so an ESP-12 can control a LED – I will investigate further and see just what this device can do that perhaps might not be quite so simple on an ESP-12. I guess at this point it is all down to available examples and code. This will take more than a few minutes – possibly a job for the holidays.

Library Relevations

In the IDE there is a link to “libraries” which opens up a very comprehensive list of libraries indeed including Neopixel, Onewire, Dallas, OH…. OH… and MQTT!!!

It took me all of 5 minutes to take the example MQTT program, give it my own access details and have MQTT-SPY turning this thing on and off. MARVELOUS.

Roundup

Of course this is just a surface review. Questions to be asked? What happens if the access point goes down and comes back up? What if the access point isn’t on when the unit powers up – and appears 5 minutes later? Does the Photon recover every time? I learned the hard way that all of these things need to be tested when developing my ESP8266 code (which is bomb-proof). Watch out for more information when I take this little device a stage further.

The showstopper – UK

At this point with a couple of little niggles above… I’m impressed. Very nice.  But…

MY only gripe –  prices for this device in the UK – Farnell want £19.99 and on Ebay I’ve seen £24 –  At that price I’d say the device is too expensive.  At the Particle.IO store, the device is $19 all in – but wait for it – including shipping to the UK $40.20 –  so more for shipping than the cost of the unit itself – all in comes to £26 – that is just too much. A Node-MCU board which uses the ESP8266 – though not quite as easy as this to set up comes in at £9.92 including postage. Now, depending on what you need, price may not be an issue. There is no doubt the IDE and tools therein are good and so for beginners this is a great tool but if you’re going to fill the home or office with all sorts of control gadgets, at these prices it gets expensive.

 

 

 

 

 

 

 

 

Facebooktwitterpinterestlinkedin

17 thoughts on “Enter the Photon

  1. As far as pricing goes, yes you can get ESP8266 modules much cheaper. But I think the overall specs and architecture of the Photon make this a fairly apples-and-oranges comparison. And I think that basically you can think of the Photon as essentially a development board to make it easy to evaluate their P0 and P1 modules, which lie at the heart of the system. These can be purchased in bulk for $10/$12 each. Still more expensive than ESP’s but still not too bad, considering the ARM M3 and separate WiFi coprocessor.

    Also, as already mentioned, you don’t *have* to use their cloud platform. Or even set up your own local cloud server. If you haven’t already, check out the System Modes for how to override their default cloud usage. As an example, I had a Halloween light project that really didn’t need WiFi for anything. So I used MANUAL mode to avoid firing up WiFi at all. But I also latched into the board’s Mode button so that if I pressed it, it would initiate a WiFi + Cloud connection, so that I could do OTA firmware updates when needed.

    1. Perfectly good points Doug. Certainly I had fun testing the unit – clearly they have a market – interesting that the OAK product is sharing their platform though..

  2. Peter – check out the oak from digispark in the USA – esp8266 but they work with the particle cloud and online ide !!! Just waiting for the Kickstarter to arrive

    Craig

  3. ESP8266 is not fully opensource. What secrets they might be holding.I am not sure if this is the same case with other boards.

    1. Neither is Apple or Microsoft software fully open source but that doesn’t stop anyone – I don’t think this should stop us. Espressif have been very open about their code – now I’ll grant you if the DID fully open source the lot I’d be in there and fix the PWM which never quite gets to 100% and continues to use up clock cycles even when turned “off”. But that is just about the ONLY gripe I have and I’m running these things 24-7

  4. I bought a then-Spark (now Particle) Core + Photon last year when the Photon was announced (Core now Photon later). I did fire up the Core right away, apparently I had less grief than you, and I agree that their development package and user-friendliness is better than the ESP8266. As mentioned, if I just wanted to play, or to put one or two things online easily… this would fit the bill. And the hardware is more mature and has more IO than the ESP8266.

    But i persevered with the ESP8266, and as we all know, it’s been a better and more reliable performer than many of us were initially expecting. So… having invested time into the ESP8266, the Photon costs 6x what a ESP8266 costs, but I don’t think it delivers 6x the performance or advantages.

    Perhaps if I started out first with the Photon, I’d feel differently.

  5. When initially introduced, the Photon seemed price competitive for what it offered and by all appearances a worthwhile little board to play with. Certianly a gentle introduction to the world of IoT with good documentation and a growing community.

    But now, with boards like the C.H.I.P., ESP32, and the Mediatek Smart LinkIt (http://www.seeed.cc/linkit_smart_7688/) becoming available now or in the near future, the $19 price-tag seems a little rich. Especially, since it might be argued, these other options offer more for significantly less. But, I guess cost isn’t everything since the RPi would be getting trounced by various Chinese knock-offs if it were. Also, some of these newer chips/boards, although often sporting Linux, may not be the best choice for low-power, battery-powered devices.

    Who’s complaining? It’s great to have all these options and the costs seem to continue to erode.

    1. Hi Glenn – agree on the points – mind you – the only real competitor to the Pi2 (as against the original Pi) from China that I’m aware of is Orange Pi and I’ve tested it – it is faster by some way – BUT – Raspbian works and works reliably – I don’t know of ANYONE including myself who has been able to repeatedly get Orange Pi PC to work including ports, sound etc… in other words a fully operating Orange Pi. If they had – and if the setup was repeatable – I would ditch the Pi2 in a heartbeat.

      Thanks for the link I was unaware of that seeed board.

  6. Nice. Its expensive but easy to use. ESP32 might give competition for this. ESP has more ways to code that this board. Thoughts ?

  7. I love my little Photon and you’re right, the documentation is brilliant and so is the community. They also have an offline IDE available and I’m sure I read in the forums you can use Eclipse as well.

    For the price I think they are fine if you have a one off big project but you’re right you wouldn’t want to put them all over your house as temp/humidity nodes, that is the true strength of the little esp boards.

    Also you can use Blynk with them or one of many SDKs, I’m currently playing with .Net at the moment for taking to and interacting with the Photon.

  8. Pete, £9.92 sounds expensive – assume you mean UK stock.

    I bought 2 for £10.08 so half as much via Banggood the other day. OK I had to wait but then I was on holiday round the other side of the world, so they were waiting for me when I arrived home. 🙂

    1. I probably meant $9- I note the Node-MCU at £4.37 from Banggood this morning and of course as we know the basic ESP-12 from there is cheap as £2 but that does need extra stuff added depending on what you are doing. There is absolutely no reason why someone could not have done the same with the ESP-12/Node-MCU as these guys have done with the Photon – ie C online environment – though as I mentioned in the email – would I want the switching of my heating to rely on their server being up? I think not – hence the MQTT option – but then if you use that, my own software does much of what is offered in the Photon. I have yet to try out the various features, that will come later. Certainly a good learning tool. I took a different tack with Blynk – I have Blynk work with Node-Red and the latter then worries about talking to boards. That’s a powerful way of doing things as then you can have a mix of everything.

Comments are closed.