Spark Core - Local control

@Jeffery, by compiling locally, you can flash your Core via USB. You will need to get the tools installed on your PC to compile locally obviously. Which sites are you having problems with?

You are probably having trouble with dfu-util. Try this thread for answers:

How-toPlug your Spark Core into your computer over USB. When the Spark Core is in Listening Mode, open a serial port over USB using the standard settings, which should be:
Baudrate: 9600
Data Bits: 8
Parity: none
Stop Bits: 1
Once you’ve opened a serial connection, you have two commands at your disposal by hitting either w or i on the keyboard. Here’s what they do:
w: Set up your Wi-Fi SSID and password
i: (“i” as in identify) Read out the Spark Core ID
NOTE: If you connect your Core over USB the first time, you will also need to manually claim your Core to connect it with your account. Please see the section below on claiming your Core for more details.

i followed this but i dont see a tut for the window putty so i dont really understand what to do
i tried some stuff but it’s not working

i got dfu installed i think.
not sure if it’s working till i try it

C:\Users_______>$ spark flash --usb tinker
’$’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users_______>spark flash --usb cc3000
Apparently I didn’t find a DFU device? util said
Error writing firmware… no dfu device found.

You core has to be in flashing yellow (hold mode and tap reset, release mode when you see yellow flashing after about 3 seconds).

You have to have a driver installed on Windows:

yeah i did that it’s flashing yellow

C:\Users\Student>spark flash 54ff6e066678574941470567 tinker
Including:
C:\Users\Student\AppData\Roaming\npm\node_modules\spark-cli\binaries\spark_t
inker.bin
attempting to flash firmware to your core 54ff6e066678574941470567
flash core said {“ok”:false,“errors”:[{“error”:“Timed out.”}]}

now i got this

i got it to connect to the WLAN that i want but it still trying to connect to spark cloud.

If you have no cloud connection you should try putting your Core into dfu mode (flashing yellow) again and try

spark flash --usb <WHATEVER_YOU_WANT_TO_FLASH>

instead of doing it OTA

As long as you (better your development computer ;-)) has internet access you don’t need a local toolchain for coding and building you firmware.
You can still use the Web IDE for that, but instead of OTA flashing you’d download the bin file (see screenshot) and flash it as outlined above


how do i do it
example i code from https://www.spark.io/build# and compile and download firmware binary
then i flash it

C:\Users\Student>spark flash --usb tinker firmwar (2).bin
.bin was unexpected at this time.

C:\Users\Student> “C:\Users\Student\AppData\Roaming\npm\node.exe” “C:\Users\S
tudent\AppData\Roaming\npm\node_modules\spark-cli\bin\spark.js” flash --usb tin
ker firmwar (2).bin

so is it working cause it said was unexpected at this time, i have noidea what is it talking about

Best would be if your bin file name would not contain blanks otherwise the command line interpreter sees tinker, firmwar and (2).bin as three seperate parameters.
You could also use "firmwar (2).bin" but I’d rather avoid blanks (and don’t add tinker if you only want to flash your code and not Tinker!).


You really need to read posts and tutorials more carefully

e.g.

This does not suggest to add tinker (and it avoids blanks).

where should i be putting my file in?

Preferably in the same directory as where you’ve got the df-util files. You should also open your command prompt from that same directory.

Not contradicting @Moors7, since this is a neat way of doing it, but you could even put it wherever you like …

… if you’ve got CLI installed correctly you should be able to cd into your files directory and do the flashing from there, or you’d just give CLI the full path of your file as parameter (if your path contains blanks, wrap it in between quotation marks).

1 Like

That, of course, is very true. The reason I said to stuff them all into the same directory was to prevent any possible issues. When you haven’t got df-util added to your path, it’s going to complain. When the file isn’t in the same directory as your command prompt is pointing to, it’s going to complain. If you’ve got blanks in the filename and don’t handle them appropriately, it’s going to complain.
When it’s going to complain because of either one of those issues, more questions are likely to arise here :wink:
So to keep it simple, I’d recommend to put those files into the same directory and launch your CLI from there. Once you know what you’re doing, you can start moving things around, which by then shouldn’t be a problem.

1 Like

any idea why my spark is flashing green even when i set the wifi setting using usb

i did this steps

How-to
Plug your Spark Core into your computer over USB. When the Spark Core is in Listening Mode, open a serial port over USB using the standard settings, which should be:
Baudrate: 9600Data Bits: 8Parity: noneStop Bits: 1
Once you’ve opened a serial connection, you have two commands at your disposal by hitting either w or i on the keyboard. Here’s what they do:
w: Set up your Wi-Fi SSID and passwordi: (“i” as in identify) Read out the Spark Core ID
NOTE: If you connect your Core over USB the first time, you will also need to manually claim your Core to connect it with your account. Please see the section below on claiming your Core for more details.

As to what the green flashing means, and what you might be able to do about it: http://docs.spark.io/troubleshooting/#troubleshoot-by-color-flashing-green

In your file path, there is this, which might be interesting:

C:\Users\Student>

Are you on a school network? Often, you require a special username/password to connect to those. The wifi chip on the Core isn’t capable of handling those, as is stated in the above mentioned docs.
Also, what are the settings of your accesspoint? Which type and channel are you using? 2.4GHz/5GHz, channel <11, a/b/g/n/ac?

Try to give us a much information as possible, rather than “I tried some things, and it didn’t work”. With only that information, there is very little we can do to help. Also, include any and all steps you’ve already taken. There’s no point in telling you things you might have already tried several times.

1 Like

Have you carefully read, understood and followed this

http://docs.spark.io/connect/##connecting-your-core-connect-over-usb

http://docs.spark.io/troubleshooting/

Can you post the full response of your computer when you provide the credentials over USB (but remove any confidental data)?


Darn, @Moors7 is just too quick for me :wink:

As for this

In case you’re behind a “captive portal” (search for this term on the forum) I’ve got a solution that might work for you too :wink:

1 Like

no Flashing green when i am at home
i know that i am unable to set it up in school easily so i gave up doing it in school
i am using DIR-868L (D-Link)
Mixed 802.11ac, 802.11n and 802.11a 5GHz
Channel Width 20/40/80MHz

and i did the troubleshooting

sorry i am quite new to this
it’s for my FYP. Have never touch a spark core before.