Developing for the Photon without the tool chain and without cloud compile

Hi everyone!

I’d like to develop a very simple application for the Photon, but I find the cloud compile/flash feedback loop to be a downer. I have downloaded the local tool chain which compiles the entire flash with the program and I even find that to be time consuming.

Considering what I want to do is simple (HTTP + Turning on/off LED lights) I don’t see why I can’t just compile a small C program locally with the hardware interaction stubbed out until the software is ready.

So my question is, what compiler do you recommend for compiling my ino files? I come from a C# background so I’m not familiar with the C or C++ tool chain and I know there’s lots of different compilers around. I’m just looking for a prescribed way of doing this :slight_smile:

Thanks for your time.

Hmm, your request somehow sounds like: “How can I build my C# program, but I don’t want the .Net Framework on my machine. If all the .Net Framework stuff was stubbed out I should be able to do that, right?”

However, there is a “Virtual Device” implementation (potentially related threads can be found via the search feature) built ontop of the Hardware Abstraction Layer.
But then, I’d still rather go with the Web IDE before going through all the setup procedure for that.

If you only want to write the code but never run it - judging by the comment about “with the hardware interaction stubbed out” - you would never need to employ the flashing part of that until you are actually done developing.

Actually no. The Particle firmware is modular. So you can only build the application module but don’t ahve to build any of the system parts or bootloader (which also reside in flash).

I’m not saying I want to develop without the standard C libraries. I’m saying I want to write a standard C program with standard C libraries (i.e. with the .NET framework), with the hardware interaction stubbed out. This will help me unit test my code without needing the hardware, until I get the business logic right. I should be able to #import libraries which perform HTTP functions without needing the hardware correct?

I find the attitude in a lot of posts in this forum to have a negative undertone, where you try and make the poster feel like what is being asked is dumb or doesn’t make sense.

I’ll figure this out on my own, will just take me longer.

And waiting 10 - 20 seconds to compile a few lines of code? Sorry that feedback loop sucks.

I too wish I could use a tool like the Visual Studio debug testing where you can follow the code with breakpoints and such. There is a post on the forums about how to use Visual Studio with the Photon. You have to use the developer preview edition at the moment. I’m out out the office or I would link to it. You can also do effective debugging using the serial monitor and working the appropriate debugging statements into your code. You need to have a Photon to develop but you don’t have to work in the hardware specifics (like pin assignments) until you get the overall logic down.

Thanks @ninjatill I will look into that :slight_smile:

For debugging low-level parsing and business logic that doesn’t require all of the main features of the device, I use a subset of the Wiring API built into a small library. I use it under Mac OS and Linux, but the code is plain C++ and should be able to be built under Visual Studio as a command line tool. I use this technique for unit tests and things like memory leak detection and buffer overrun detection (using valgrind under Linux). It’s in the test directory of this project:

1 Like

FWIW, you are taking @ScruffR wrong. He was not doing that to you. I have always been amazed how well he has bit his tongue with many of the ridiculous posts here.