@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
server.show(""); // 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
server.show(""); // 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.)