Ok, i tried to extract the correct functions to perform factory reset over code but it’s not that straightforward because i’m calling the variable directly.
There should be some exposed functions available to perform a factory reset in user code.
Hmm, I don’t seem to be able to compile that (I added void loop() {} just to see if that had a difference).
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from clean.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
#warning "Defaulting to Release Build"
^
In file included from ../inc/spark_wiring.h:37:0,
from ../inc/application.h:29,
from clean.cpp:2:
../inc/spark_wiring_ipaddress.h: In member function 'IPAddress::operator uint32_t()':
../inc/spark_wiring_ipaddress.h:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
operator uint32_t() { return *((uint32_t*)_address); };
^
../inc/spark_wiring_ipaddress.h: In member function 'bool IPAddress::operator==(const IPAddress&)':
../inc/spark_wiring_ipaddress.h:54:72: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
../inc/spark_wiring_ipaddress.h:54:105: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
bool operator==(const IPAddress& addr) { return (*((uint32_t*)_address)) == (*((uint32_t*)addr._address)); };
^
clean.cpp: In function 'void setup()':
clean.cpp:2:3: error: 'OTA_FLASH_AVAILABLE' was not declared in this scope
#include "application.h"
^
clean.cpp:3:3: error: 'REFLASH_FROM_BACKUP' was not declared in this scope
void setup();
^
clean.cpp:4:3: error: 'USB_DFU_MODE' was not declared in this scope
void loop();
^
clean.cpp:5:3: error: 'FACTORY_RESET_MODE' was not declared in this scope
#line 1
^
make: *** [clean.o] Error 1
Error: Could not compile. Please review your code.
Do I need to include something special to be able to access those system variables?
No worries - Just figured I’d post up the results.
I’m heading to bed anyways (it’s almost midnight here, and I have work in the morning), but thank you again for all your help!
So I tried running from source, and I get the following error:
$ sudo node app.js help
module.js:340
throw err;
^
Error: Cannot find module '/home/tamotsu/Programs/spark-cli/js/bin/app.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Running nodejs version 0.10.29 (from ppa:chris-lea/node.js).
Copying the app.js file from the js directory into the bin directory and rerunning results in:
$ sudo node app.js help
module.js:340
throw err;
^
Error: Cannot find module 'xtend'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/tamotsu/Programs/spark-cli/js/settings.js:31:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
Thanks Dave, I did indeed forget to install (npm install) before running the commands.
After a successful install, I attempted reflashing, with the same results.
The .webm’s linked below detail the results of different attempts.
Thank you for posting those videos, but they cut off right as they were getting to the good part, a few seconds after the flash / while the core is trying to get online… Any chance you could post the 10-15 seconds after the core starts up while it’s trying to get on the network?
HI there, @DanielBernard - Why don’t you drop me a line at hello@spark.io and we’ll get you into the pipeline for a replacement - please reference this thread and we’ll get you taken care of quickly.
Just shortly reviving this thread in which I found the exact problem that I am experiencing since a couple of days and could not find a solution. First I though having a problem with my code compatibility after some updates to the web ide and firmare of the core i have been using with xivley successfully for about 1 year and then stopped posting data onto the xivley feed. I thinkl it was breathing cyan but not connected to the web.
It turned out that the core is directly breathing cyan/white after every boot and flashing firmware and tinker over CLI but the it directly returns to breathing cyan and I can´t get the core into listening mode. It just freezes whith a solid white when pressing the mode button for a couple of seconds.
It seems to me beeing the same than describe above.
-DFU Mode works
-Flashing over USB with CLI works
But entering listening mode is not possible anymore.
I though I just try my luck and maybe there have been some new insights to this since last post?