Imp002 - OrbNext LEDs

Have an OrbNext (IMP002 main board with imp-orb led daughter board) which I have access to via my electric imp account. Assigned as a development device. All I want to do is cycle the colors on the OrbNext led board via device code. Can’t seem to find a good sample to work off of.

I’m not too familiar with this product. You said that you can actually do the blink-up and see it in your imp account? So they sold this as a project for anyone to program? At first I was thinking it was only connected to their “own proprietary system” like the “Bud Light”. But if you have full access and total control, that is pretty cool. It would really help if you could get a schematic of the board. Knowing which Imp002 pins are used and if they are using the basic WS2812 (Neopixels). How much documentation do you have with this?

You’re really positive you did a blink-up and you can send it agent and device code? When you view the code do you see any existing code? Or is it just a blank Imp? If the Imp is blank, try writing a comment line in “Agent” and build/upload the code …

// Hello World

Tell us what happens. See if you are able to write to it.

Yep, used this input:
server.log(“Hello from your imp kit”);

And get this:
2019-06-17T17:33:58.075 -06:00 [Device] Hello from your imp kit

I think this link gets me closest to being able to change the LED lights.

Downloads fine to OrbNext though ORBNext Ambient LED turns off. Agent responds to basic URL to this link:“Device Code”

With following message

2019-06-17T17:40:12.670 -06:00 [Agent] Incoming request:
2019-06-17T17:40:12.670 -06:00 [Agent] ERROR: Invalid JSON
2019-06-17T17:40:12.670 -06:00 [Agent] ERROR: in unknown agent_code:103

Suspect I am missing some additional information in the URL that the Agent would parse to make the LED change.

If I modify this line in Device Code I can change the LED color:
setLevels(0, 0, 0);

For example:

Turns the ORBNext Ambient LED a Light Blue

Still curious how I do this through the URL via the Agent.

It is expecting a JSON array.

Like this: {“color”:"#008000",“program”:“Color”}

Since I have a website, I would use PHP scripting (server-side) to POST JSON to my Agent URL. You can do that.

Otherwise, you can do it using javascripting. Or both PHP and javascripting (AJAX).

The idea of OrbNext is to have an app (like a website app) where a remote script can send it the JSON array to change color. Example, a PHP script checks the weather every 60 minutes and sends an update to your Agent URL to change the color based on current weather.

If you don’t have your own website (which you should anyhow to do cool things), you can actually use another Imp as the “website” that POSTs JSON to your OrbNext imp. I have imps doing that all the time … sending data to another imp in my house. If there is mail in my mailbox, I get a text message (using PHP) and another imp inside my house changes color on a Neopixel.

Another idea would be to NOT use JSON and use HTTP GET so you can put variables in the Agent URL. That way you would do this:

Not sure which road you are wanting to take.