How do you know when the code has downloaded to the imp from the planner?


I have noticed that the red light starts flashing on the imp as the code is being flashed to the imp. However, it is unclear to me when this process actually takes place, particularly when viewing from the planner. Are you planning on making a refresh button? Is the download on a timer(based on imp or server)?



If you enter the code viewer of the actual imp (click the tool icon on the imp blob, click edit) then the play button above the text forces a reload of the code.

This doesn’t quite work for me. I followed this and the code still would not reload. If I changed from the Hello World sample to the Blink sample the code does not deploy/execute. I still see the “Hello World” on the imp blob and it says it is running the First Program. Oscilloscope shows that pin 9 is not blinking as well (so it isn’t just a display update issue).

The only way I can reliably reload is to deploy the code as you say and then bound the imp’s power. Then it reloads the program fine.

Maybe it is just me I’ve only been playing with this for about 25 minutes so…

Oh but let me add that even though the Blink program does load and it says it is running the blink-o-matic program it still displays “Hello World” underneath. I have to actually delete the node before plugging it back in for it to completely update the node properly.

The text on the block does not clear when new code loads - this is a known issue.

If you add"") to the blink code then this will clear that text.

I have a similar issue to Dennisma. I have “hello world” and the temperature sensor programs set up. While it is set to read temperature the temperature value is displayed in the node on the planner and updates in the log while viewing the code. If I change the code to “Hello world” in the planner, it still keeps showing the temperature. When I edit “Hello World” and hit run, it displays “hello world”. If I go back to the planner and change back to temperature sensor then it locks up. No matter what I do in code or planner I can’t get temperature to work again without physically unplugging the imp. This used to work a couple of weeks ago.

I’m wondering which software version I have in my imp. I haven’t tried to re-blinkup yet.

Update: Three hours later,without any power cycle or other intervention, I pressed the run code button on the temperature sensor code and it started working. So in the planner I changed the code back to Hello world, still shows temperature sensor in planner. Edit Hello world code and the log still shows temperature but does not update. Press run for hello world and a new temperature shows up in the log. Now I can’t get it to switch from temperature to hello world.

I am also having these issues reported above. Sending new code to the imp does not happen unless I physically disconnect power from the imp. The “play” button in the code window works sometimes, but as mentioned above, if different firmware is loaded, the “play” button seems to stop working. At this point, even hard power cycle does not restore the “play” button to working.

I am wondering if there is a way to check the firmware version on my imps. I’ve tried logging out of the blinkup app, re-blinkup the imps, power cycle, and load the imp.unboundsq firmware to apply the new firmware version, but I have been unable to witness any upgrade process.

Hugo, did you mention in another thread that there is a way to check your firmware version in the planner UI?

@jetrost: you have the latest on both imps. There is currently no way to display fw rev on your imps but we will be adding this.

Are you determining the working/not working state of reloading firmware from the planner screen? It could well be that it’s the planner screen not working vs the imp not starting new code. Do your impees have any devices attached that could be made to indicate what code they were using?

@Hugo: I determine the working/not working state of reloading the firmware based on both the planner screen and devices (LEDs) attached to the impee.

I am using the SparkFun Electric Imp shield that has two LEDs (one orange [pin9], one red [pin8]). To test, I have these two seemingly simple sketches:

`// orange_LED - TEST ORANGE LED""); // clear the server message

hardware.pin9.configure(PWM_OUT, 0.5, 0.50); // 2Hz, 50% duty cycle

imp.configure(“Orange LED”, [], []);
// EOF`

`// red_LED - TEST RED LED""); // clear the server message

hardware.pin8.configure(PWM_OUT, 0.5, 0.5); // 2Hz, 50% duty cycle

imp.configure(“Red LED”, [], []);
// EOF`

Here are the steps I take:

  • Load the imp.unboundsq firmware in the Planner

  • Physically remove the imp from the impee (i.e. disconnect power)

  • Select the impee node in the Planner and click “delete node” (I deleted everything from the Planner space to ensure I was not mucking around with one impee in the Planner whilst looking at a different impee on my desk)

  • Insert imp into the impee (i.e. connect power)

  • See that the impee appears in the Planner, showing “BLANK” as the server message (no LEDs are blinking on impee)

  • Select orange_LED firmware from the dropdown box in the node settings

  • Nothing happens…

  • Cycle power to imp

  • Orange LED on impee begins blinking, indicating that my orange_LED firmware is running

  • Select red_LED firmware from the settings dropdown box in the Planner

  • Nothing happens…(orange LED is still blinking on impee)

  • Cycle power to imp

  • Red LED on impee blinks, indicating that red_LED firmware is running

Essentially, it seems that after a different firmware selection is made in the settings window on the Planner, no further actions are sent to the imp until a power cycle is done. The “run code” feature in the code editor will update the imp in real-time immediately after a power cycle. But after changing the firmware in the Planner, clicking the “(edit [code])” will bring up the code editor, and the “run code” icon will not send changes to the imp (even though the icon is enabled).

(I did find a somewhat unrelated issue with the “run code” feature and PWM signals. After a power cycle, editing the current firmware from the Planner will cause the “run code” feature to operate correctly. From my orange_LED code above, if I change the “hardware.pin8.configure(” to “hardware.pin9.configure(” and then do “run code”, it indeed begins a PWM signal on pin9, as expected. But the PWM signal on pin8 continues to toggle the LED. But that is a bit off-topic for this thread.)

Hi - We think we’ve fixed the problem but let us know if it persists. Thanks.

@Nong: the problem with downloading the firmware from the Planner appears to be fixed. Life is much less frustrating now! #:-S

The other issue with the PWM signals “overlapping” from previous firmware still remains: create a simple sketch where there is a PWM signal on one pin. Load this onto the imp. Then change the firmware to have the PWM signal on a different pin. When you “run” the changed firmware, the new pin begins the PWM signal, but the previous PWM pin does not stop its signal…does that make sense?

Yep, that makes sense and we’re aware of it; right now the workaround is to reconfigure all the pins to ensure they are at default (digital in) at the start of your code.

This will end up happening automatically.