Spark Core - Local control

hi i am new to spark core and stuff
trying to control a spark core using WLAN without network
can anyone help me?

Yes it can and there are several topics about the how to to be found via the search feature :wink:
And the firmware docs do help aswell.

Keywords to look for are “TCP”, “UDP”, “SYSTEM_MODE”, “SEMI_AUTOMATIC” & “MANUAL”.

1 Like

@Jeffery, to add to what @ScruffR said, you may want to start with the Tutorials sections which has great stuff, including what you are looking for :grinning:

2 Likes

i dont really understand some parts
first of all how do i code my spark without connecting to the network
i tried doing the Spark Core Compiling Locally but some of the sites are not working for me so i am unable to download some stuff

@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 Particle Web IDE 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.