Can't run examples

Hi all.
I have setup my spark core and it is connected to the web IDE. I can flash code (magenta color on the board), and then goes back to cyan - connected to the cloud.
However, I can’t even run the most basic examples - such as the LED…not even the D7 led works!

Any suggestions please?

If you are able to flash code, it should work. :smiley:

Which example did you use and did the core flashed magenta rapidly? :wink:

Yes, everything has flashed the way it should. I used the Blink LED example, but the LED I connected didn’t work or even the LED onboard

So the RGB led is breathing cyan but the blinking example is not working?

1.) When you press and hold the RST button, does the D7 blue led come on dimly?

Yes, small blue LED light works fine when I reset

Oh nice! Now we can test that the hardware is working fine.

Could you try flashing the code again? :wink:

Flashed, magenta color and then breathing cyan.
Same results…nothing

Weird behavior…

Can you attempt to perform a factory reset and use tinker app on your mobile phone app to toggle the D7 LED?

Also, can you copy and paste or screenshot the web IDE with the code just to be sure?

I would also remove the external LED/circuitry just to be sure… :wink:

I did a factory reset but nothing. I can’t use Tinker as Im in China, and there is no Google Play for Android - can’t find the package anywhere else…

I have removed the external LED as well. Test only with D7, nothing…!

The only thing I did to make a LED work was with the TCP example and node.js. But now that I flashed it again, nothing works!!!

I am doing resets a whole day!!!

Can you use this code instead:

SYSTEM_MODE(MANUAL);

void setup(){
 pinMode(D7,OUTPUT);
}
void loop(){
 digitalWrite(D7,HIGH);
}

Nope…

Just one thing I noticed, right before it blinks fast the cyan light when it is about to connect, it flashes a couple of times green color and then goes to breathing cyan. I don’t know if it is a sign for something…

I won’t be able to assist you further on this.

You might want to consider having the core replaced or @will or @Dave shall take over from here.

If you have a rooted Android phone and want to test, you can download an test/debug APK package of my ExtTinkerApp.

Thanks I will do that, but still I don’t think there is a solution to this problem as I have verified the D7 LED works fine, however it does not run after I flash even the most simple code (as posted above) - even in manual system mode.
It looks that it connects and flashes the code correctly, but nothing further than that…

Hi @Louis,

How are you confirming your code is loaded on your core? Are you hitting the api to send commands, or verify the list of exposed functions / variables? What isn’t running? Have you installed the Spark-cli?

spark list
spark call my_core function_name params

Thanks,
David

If you flashed the code with SYSTEM_MODE(MANUAL) and was able to reflash new code again, your core probably did not reflash with the new firmware since in Manual mode, the core is not going to connect to the cloud and OTA flashing is not at all possible.

1 Like

I can't install the spark-cli. When I run this: sudo npm install -g spark-cli
I get this in my Terminal (node.js is installed fine on my machine):

serialport@1.4.5 install /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp install --fallback-to-build

child_process: customFds option is deprecated, use stdio instead.
gyp ERR! configure error
gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
gyp ERR! stack at install (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/install.js:66:16)
gyp ERR! stack at Object.self.commands.(anonymous function) [as install] (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:66:37)
gyp ERR! stack at getNodeDir (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:152:20)
gyp ERR! stack at /usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:95:9
gyp ERR! stack at ChildProcess.exithandler (child_process.js:723:7)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at maybeClose (child_process.js:1000:16)
gyp ERR! stack at Socket. (child_process.js:1168:11)
gyp ERR! stack at Socket.emit (events.js:107:17)
gyp ERR! stack at Pipe.close (net.js:461:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_name=serialport" "--version=1.4.5" "--major=1" "--minor=4" "--patch=5" "--runtime=node" "--node_abi=node-v14" "--platform=darwin" "--target_platform=darwin" "--arch=x64" "--target_arch=x64" "--module_main=./serialport" "--host=https://node-serialport.s3.amazonaws.com/" "--module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64" "--remote_path=./serialport/v1.4.5/Release/" "--package_name=node-v14-darwin-x64.tar.gz" "--staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz" "--hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/" "--hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz"
gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
gyp ERR! node -v v0.13.0-pre
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v14 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v14-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:110:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:1000:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1072:5)
node-pre-gyp ERR! System Darwin 10.8.0
node-pre-gyp ERR! command "node" "/usr/local/lib/node_modules/spark-cli/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/spark-cli/node_modules/serialport
node-pre-gyp ERR! node -v v0.13.0-pre
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node rebuild --name=serialport --configuration=Release --module_name=serialport --version=1.4.5 --major=1 --minor=4 --patch=5 --runtime=node --node_abi=node-v14 --platform=darwin --target_platform=darwin --arch=x64 --target_arch=x64 --module_main=./serialport --host=https://node-serialport.s3.amazonaws.com/ --module_path=/usr/local/lib/node_modules/spark-cli/node_modules/serialport/build/serialport/v1.4.5/Release/node-v14-darwin-x64 --remote_path=./serialport/v1.4.5/Release/ --package_name=node-v14-darwin-x64.tar.gz --staged_tarball=build/stage/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.5/Release/node-v14-darwin-x64.tar.gz' (1)

npm ERR! serialport@1.4.5 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@1.4.5 install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 10.8.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "spark-cli"
npm ERR! cwd /Users/stavrosdidakis
npm ERR! node -v v0.13.0-pre
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0

@kennethlimcp I tried the SYSTEM_MODE(MANUAL) because you suggested it. Do you know how to change it back? I factory reset again, will it help?

Were you able to flash new code with the code containing SYSTEM_MODE(MANUAL);?

Factory reset is the only way if you flashed that code successfully.

Can you take a photo of the setup of your core?

Even with manual mode nothing happened. I get the same results no matter what I have tried so far.
I can’t run the spark-cli though…

What do you mean of the setup? Nothing is connected to it at the moment…