New Photon - Almost but Not Quite Working

Sadly, every time I unpack a new photon I seem to run into issue with setting up using the (Android flavour) app and the Web IDE. So it has been with the latest Photon - brand new out of the box last night. :frowning:

The story so far.

  1. Put the photon into AP mode (flashing blue)

  2. Found it on the app and connected to it - paired it with my House WIFI (same room, about 4 foot from the photon) with no problem.

  3. Consulted the WEB IDE and yep “devices” shows my new device - gave it a customer name there. Photon is breathing cyan like a champion. (V0.6.3 firmware and shows breathing Cyan on the WEB IDE footer).

  4. Did the “SIGNAL” test - all works fine.

  5. Tried to download some code into it (very simple known working program) but it times out. Tried 3 more times - same result. LED on the board never changes from breathing - so seems like its not even trying. BUT Will still do the SIGNAL test to order, so there is cloud communication available.

  6. Perhaps some random code in the Photon is making it crash on take off? Did a safe mode reset. No change.

  7. Reset the Wifi credentials and paired it up again (using sequence above) all seemed okay (after a couple of tries) - but I still have the same problem with uploading code to it.

Do I have a faulty Photon, or am I missing something obvious.

Thanks as always for any help.
Best regards
Alan T

What exactly is a safe mode reset?
If you place it in safe mode, are you then able to flash code to it?
Is it running Tinker (showing functions in the console)?

You could give "Particle update" and "Particle flash --usb tinker" a shot from the CLI, while in DFU mode.

Potentially dumb question, but have you made sure to place the gold star :star: next to the new device when flashing?

2 Likes

@Moors7
Yes, sorry, that is what I meant - put it into “Safe Mode”.
Well, I noticed yesterday that there are no functions and no variables associated with this photon in the console.

Since the photon appears on my App device list too, I tried (from the Android App) to “reflash tinker” but nothing happens - the LED status doesn’t change and the app just times out.

I don’t have a CLI environment rigged up, but if I get time over the next couple of days I could try to rig it up and give that command sequence.

@ScruffR
Yes, it’s gold starred.

It occurred to me that between the two attempts to setup this photon I never “unclaimed” the device. On the second config I got some kind of message on the app to confirm ownership of it. Wondering if the cloud has some confusion resulting from multiple claiming? Perhaps I’ll try an unclaim, forget Wi-fi and start again sequence? If that doesn’t work It will have to wait until I install the CLI - something I should probably do anyway as this wifi config always gives me issues.

Thanks guys!

Best regards
Alan T.

Hi Alan,

Is this your one and only Photon? Or do you have others that you know work?

Also you stated that you had [quote=“AlanSparkMan, post:1, topic:38313”]
download some code into it (very simple known working program) but it times out
[/quote]

Might be worth showing your code for good measure. Or if you want here is my ‘Prove I have control’ code:-

// Define the pins we're going to call pinMode on
int led = D7;  // You'll need to wire an LED to this one to see it blink.
int led2 = D6; // This one is the built-in tiny one to the right of the USB jack

// This routine runs only once upon reset
void setup() {
  // Initialize D0 + D7 pin as output
  // It's important you do this here, inside the setup() function rather than outside it or in the loop function.
  pinMode(led, OUTPUT);
  pinMode(led2, OUTPUT);
}

// This routine gets called repeatedly, like once every 5-15 milliseconds.
// Spark firmware interleaves background CPU activity associated with WiFi + Cloud activity with your code. 
// Make sure none of your code delays or blocks for too long (like more than 5 seconds), or weird things can happen.
void loop() {
  digitalWrite(led, LOW);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(1000);               // Wait for 1000mS = 1 second
  digitalWrite(led, HIGH);    // Turn OFF the LED pins
  digitalWrite(led2, LOW); 
  delay(100);               // Wait for 1.5 second in off mode
  digitalWrite(led, LOW);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(100);               // Wait for 1000mS = 1 second
  digitalWrite(led, HIGH);    // Turn OFF the LED pins
  digitalWrite(led2, LOW); 
  delay(100);               // Wait for 1 second in off mode
  digitalWrite(led, LOW);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(100);               // Wait for 1000mS = 1 second
  digitalWrite(led, HIGH);    // Turn OFF the LED pins
  digitalWrite(led2, LOW);
  delay(100);
  digitalWrite(led, LOW);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(100);               // Wait for 1000mS = 1 second
  digitalWrite(led, HIGH);    // Turn OFF the LED pins
  digitalWrite(led2, LOW); 
  delay(100);               // Wait for 1 second in off mode
  digitalWrite(led, LOW);   // Turn ON the LED pins
  digitalWrite(led2, HIGH);
  delay(100);               // Wait for 1000mS = 1 second
  digitalWrite(led, HIGH);    // Turn OFF the LED pins
  digitalWrite(led2, LOW); 
  delay(1500);               // Wait for 1 second in off mode
}

It is written to alternatly blink 2 LED’s as I offten add a second LED to D6, but you don’t need to. It will simply flash the on board LED…

If you have a cyan breathing photon, that you can get a rainbow signal responce to, that code above should atleast work.

Liam

and you can try the SIGNAL button on the web IDE or the ping button on the web console.

He already did that

@AlanSparkMan, unclaiming/reclaiming a device never solves anything. If it's claimed to the account and you can signal it it's claimed and I'd leave it that way unless you want to pass it on to someone else.
CLI is the way to go I think.

2 Likes

Thank you @VideoLiam

To answer your questions in the order you pose them.

  1. Yes, I have about 10 Photons and I can re-program any of the others okay, including putting this simple test code into them. Other photons are programmed with this code, no problem. So the problem is definitely this specific photon or its configured environment.

  2. Yes, I have been using the “Signal” facility on the GUI IDE - and as I stated that does work flawlessly

This is a very odd problem.

Hi @ScruffR

Yeah, you’re right; unclaiming/reclaiming had no effect.

I am installing the CLI as I type this - will let you know the next installment!
Thanks.

Best regards
Alan T

1 Like

Okay, results are in…

Installed the CLI on my desktop Windoze PC.

Quickly realised that the software proceeds from the (so far as I can see undocumented?) assumption that you are running it on a computer that connects via Wifi - not wired!! That should probably be stated somewhere in big letters upfront in the docs. If it is, and in my haste I missed it, I pre-apologise!

So, installed on my gash Linux (Ubuntu 16) laptop (which does connect by WifI). CLI installed fine, setup sweet as you like, photon got to “ready”. “particle list” shows that photon has installed functions (digitalWrite etc).

Went for broke and installed my test program from the Web IDE - success first time. All working!

I wonder what the hell is causing that. Must centre on my mobile phone somehow, or the app installed on there - cos setting up that way has always been very hit and miss for me. Anyway, now I have the CLI installed I’ll use that in future.

Thanks for the help everyone @ScruffR gets the prize for calling it this time.

Best regards
Alan T.

2 Likes

CLI only needs a WiFi connection on the computer to do the WiFi “auto-setup” for any wired stuff it’s perfectly fine to have it installed on a no-WiFi machine.

BTW, since the “auto-setup” tries to connect to the Photon’s SoftAP a WiFi capability of the device to attempt that is an implicit requirement for that - but as said not compulsory.

2 Likes

Hi Alan,

Thanks for your responce. That rules out quite a few suggestions I would have had.

I think the CLI and ‘particle doctor’ are way to go. They are very useful tools to have.

Just as an aside:-
I messed up setting up a photon at the London Hackspace last night, the setting up the WI-fi got interupted. and it took a bit of trying to get it sorted, Turn off and leave 5min. Reboot after updating the CLI etc… The Hackspace’s internet/Wifi are never a great place to do that kind of thing, as network resources can be tied up with someone else going some thing which causes time outs etc… But it took a bit of repeative trying. I’ll spare you the details. But I’ve always, eventually got them back. So give the CLI a try and good luck.

Oh, yes. One point to mention if you are using Windows, it can take quite a while for the right drivers to be installed, as some times windows insists on trying to find the drivers from its own resources before letting you specify were to find them on your own machine (Up to 10min) for it to ‘go through the process’ . This seems to be linked to the problem of some windows machines not doing its own ‘System updates’ in a timely fashion. If your using windows, keep and eye on Device Manager to check it installs the serial drivers in time and this also applies to when in DFU mode. Its a different driver I think.

Anyway good luck.

Liam