I have been trying to figure out how to target the photon for a compile in the cloud. I was assuming I would need to set a define like platform or something to get Particle-Dev to build for the photon but have not been able to find any instructions.
Good question! If you have a photon in your list of devices, clicking the star icon by it will target the Photon during verify and flash. If you’re using DEV, or the IDE, the same thing applies, trying to flash to a photon should automatically target that environment. Are you’re finding that isn’t working for your device?
In the compile request itself, you can set the device_id to your device, or product_id to 6 (the photon), but I don’t think that’s nicely exposed yet in the CLI. This will let you compile for a device without flashing.
We’re working on exposing better platform targeting in the coming sprints.
@Dave Thanks for the reply. Unfortunately that does not help I do not have a photon in my list. I do have 2 early photon I am guessing they are alphas all they do is blink yellow when you plug them into a usb cable.
I was hoping there would be a way to force the platform selection without requiring a working unit to be added to my account. Is there a way I can change the device type of one of the units claimed to my account as a work around?
Hey @dave is there a compiled .bin file and some simple instructions to install other than the links you gave.
I played around a little bit with the instructions on the links you sent but I am having lot of problems.
For starters I can see the device in device manager (windows) but when I enter dfu-util -l I get
dfu-util 0.8
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Cannot open DFU device 2b04:d006
No DFU capable USB device available
Yet I still see the device listed in device manager
@Dave & @bko When I click on the device Spark Photon DFU Mode in device manager I see the following in the device status box
The drivers for this device are not installed. (Code 28)
There is no driver selected for the device information set or element.
To find a driver for this device, click Update Driver.
Does this relate to the problem? My system is fully functional with a core connected do I need to update something to have dfu-util work with a photon?
how exactly do I issue a cli compile request and specify spark or photon? I looked through the compile() function in the cli code, and it seems that the compile request boils down to
return api.compileCode(files);
I don’t see an obvious place to specify what the platform is. Can I put something in the code to tell the cloud compiler what platform I’m building for? Or is there a flag to set somewhere? I’m looking for a code snippet I can insert or an example command-line command.
Here’s what I’ve got going on:
I have a directory with a program in application.ino and the two main source files from the neopixel library, neopixel.cpp and neopixel.h
I want to be able to compile and load the code onto both a core and a photon. I know that the code works fine, because I’m able to compile and load it onto a core or a photon from the web interface, including the neopixel library through the web interface. The problem is, when I build locally, I’m only able to get it to run on a core.
I pulled kennethlimcp’s commit that has the ‘particle compile platform myDirectory/’ addition, and I’m able to run ‘particle compile photon myDirectory/’ and ‘particle compile core myDirectory/’, and I get firmware for both the photon and the core. I’ve tried loading the compiled photon binary onto the photon by both wifi and USB, but it doesn’t run. I also tried spark flash photonId myDirectory/, also without luck
Any ideas? I’m working on photon compatibility for cubetube.org, and I need to have a command-line command way to compile a bunch of semi-complex code (it uses a library we wrote for our cubes, and I wasn’t able to use the local build environment to compile anything that wasn’t just a single file) and send code to a given core or photon. I’m down with local compilation or cloud compilation, I just want something that works.
I can confirm everything @enjrolas has stated above.
I have the latest develop branch of the firmware repo. I can compile it locally with no errors.
However, flashing the Photon by USB, local Particle cloud or global Particle cloud results in the Photon flashing magenta, as if it were flashing, but then it reboots into whatever code it had before.
Using the same code in the web interface successfully flashes the Photon, no problem. However, this prevents me from changing some critical things such as the 63-char limit on Events, which I find necessary for some projects.
This sounds like it could be a problem with your local build - flashing via USB is a direct write of the compiled app to the target memory (in contrast to OTA updates which is first stored to a backup location.)
When building locally, have you also built and flashed the latest system firmware? The latest firmware will breathe magenta when it is not running any application.