Firmware v0.2.0 released, with many fixes

@BDub So what is actually included in this new updated regarding the following:

 Spark.connect(), Spark,disconnect(), WiFi.on(), WiFi.off()

&

#include "spark_disable_wlan.h"
#include "spark_disable_cloud.h"

You can always enable them at runtime in your code via:

WiFi.on(); // turns on WLAN
Spark.connect(); // Connects to CLOUD

I didn’t see this feature mentioned in the update info but know it was supposed to hit the Web IDE firmware in this next update. Please fill me in what the deal is what these features since they are not mentioned in the release info.

Sounds like Zach is going to be writing up the docs on the functions… there are actually more things like status involved.

Basically if you add this to the top of your application.cpp or .ino:

#include "spark_disable_wlan.h"

it will disable your WiFi connection from the time you power up your Core. Your RGB led should breathe white. Your code will run as soon as your core gets power.

In your code you can then run WiFi.on(); to connect to WiFi (WLAN) and your core will breathe GREEN.

At this point your core will probably connect to the cloud automatically? But if you also had included #include "spark_disable_cloud.h" in your code the Cloud would be disabled until you ran Spark.connect();

There is an intermediate step after running WiFi.on(); before you should run Spark.connect(); This is where you would look for the WiFi.status() == WIFI_ON like this:

if(WiFi.status() == WIFI_ON) {
  Spark.connect();
}

Spark.disconnect(); will disconnect you from the Cloud, and WiFi.off(); will disconnect you from WLAN.

3 Likes

@BDub You Da Man :smiley:

Thank you very much for the clean and clear explanation!

2 Likes

BTW, those tarballs are a PITA - it mangles the names so the makefile can’t find things, because of the trailing spark_3

@BDub @david_s5

I loaded the new updated firmware and I’m happy to announce that it seems that the most annoying issue I had with the Spark Core seems to be gone and fixed now. The issue I and @Bdub had was when my cellphone would loose its data connection or when it would reset the Spark core would freeze up and flash dark blue until a manual rest was done which was happening often lately.

I’ve tried to force this to happen about 4 times now and the spark core reconnects successfully every time so far.

Very good news for us end users who were having this issue.

The reason we haven't documented all these functions is that in the future — probably the next firmware release in a couple of weeks — the syntax for these functions will change to be simpler. Didn't want to "release" something only to immediately deprecate it. Just know that we will be re-designing the syntax for these functions in the very near future.

2 Likes

That’s definitely better than waiting around for the perfect implementation to release a feature, like Apple did with cut, copy, paste… lol.

The “safe mode” has not been removed in v0.2.0. It will be in the next release.

I am not able to reproduce any issues. Any further debugging news @kennethlimcp? And is anyone else experiencing unexpected instability?

I decided not to pursue further since it gets my core in a cranky state and I need DFU everytime.

Since safe mode is on, it’s somehow not working.

But we might isolate it to socket related issue where your code keeps opening and closing connections repeatedly and ends up flashing red. In this scenario, safe mode doesn’t seems to help.

I have other videos where the core does weird OTA magenta sequences (i’m confident it’s on V0.2.0) but decided not to post it to cause any confusion. :wink:

I can’t think of other code where I can force safe mode to kick in. If we have an example like that, I can help to test it out.

How do we do that -- the tag thing? Is it some git command? How do we see these tags? What exactly is, "tagged as"? Am I mixing up terminologies and simply way of track here?

I've not seen any documentation on this. All I'm doing is, git pull in the folders I originally, git cloned. It's all I know how to do, with git anyway. (I use subversion usually. Sorry for swearing! :-P)

Thanks.

If you use th web github, look for the button releases near the branches etc

Good question @gruvin!

The easiest thing is to just download the core-firmware release and use DFU to flash the core-firmware.bin that’s there. But to drop a little git knowledge on you…

In each of the 3 repositories (core-common-lib, core-communication-lib, core-firmware), run

git pull
git fetch --tags
git checkout spark_3

Then, connect your Core, put it in DFU mode, and clean, build, and flash.

cd core-firmware/build
make clean all program-dfu

You only have to clean the first time, not for changes on the same branch/tag thereafter.

EDIT: When you’re finished just do git checkout master in each repo to get back to normal.

4 Likes

Please help with some further confusion.
I have converted to using NetBeans (and the integrated call to dfu). Will the core-firmware.bin be “automatically” loaded by NetBeans???

  1. I manuall get the V0.2.0 revisions.
  2. Manually copy them into my exsiting directories, overwriting what is there.
  3. Then clean, build and load.

Am I properly capturing all the needed core updates???
Am I capturing the cc3000 updates???

I don’t have NetBeans to verify with @LZHenry, but as long as you download and replace all three repositories, I think the process you described should work fine.

You are not capturing the CC3000 updates yet, because there are not yet finalized updates to share. :smile: Soon!

@zachary @LZHenry

I have used the netbeans approach to loading firmware onto the spark core manually and all you need to do to get the latest firmware working is to replace the 3 old folders with the new and recompile and then flash.

2 Likes

Thank you both. It is good to have confirmation that I properly understand the loading process.

1 Like

Dear Spark :spark: guys

Can you please fix the extern Timer Interrupt handler error on your web based IDE so that I could load via cloud.

…/…/core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning “Defaulting to Release Build” [-Wcpp]
timer.cpp: In function ‘void TIM2_IRQHandler()’:
timer.cpp:32:14: error: previous declaration of ‘void TIM2_IRQHandler()’ with ‘C++’ linkage
timer.cpp:68:33: error: conflicts with new declaration with ‘C’ linkage

I know you guys are busy and this fix may not be on top of the priority todo list, but I need the feature.
Currently I am compiling locally from netbeans.

regards,
Muez

Hi @Muez

I think this was resolved in another thread:

It looks like you have to put your interrupt handler in a separate file in another tab. Have you tried that already?

1 Like

Totally not :heart:-ing V0.2.0 somehow :smile:

I got a blinking red after an OTA as i try to get the 595 working for my LCD!

A reset immediately went to blinking red and i had to DFU a firmware in before reconnecting to the net.

The next OTA without any change of code didn’t caused this.

Yes. It works just fine. :smiley: