I’m working on a project that I think might be able to take advantage of Spark Core, but I’d like confirmation from the experts. Essentially, what I want is a WiFi / TCP-IP enabled Arduino. My application precludes the use of the Cloud features. Here’s the idea:
I’m building an experimental avionics system based on an embedded Linux platform. The Linux server creates a WiFi network using a set prefix followed by the MAC address as the SSID. (Example: “OrionEFIS-xxxxxxxxxx”) I would like to build a number of Spark-based sensors that send data to the Linux system over WiFi. Here’s what I would like to happen:
- Spark boots up with WLAN on and cloud off
- If Spark finds a known network, it attempts to connect to that network
- If Spark does not have any network settings, or if none of the previously connected networks can be found:
a. Spark scans for networks
b. Spark attempts to connect to first network it finds with an SSID starting with “OrionEFIS-”
- Once connected to WiFi, the Spark connects with the Linux system via TCPClient
- Once connected via TCP, begin sending sensor data (received over UART or SPI) to the Linux system
The connection state would be presented to the user through color and cadence indications from a multi-color LED (can I control the built-in LED?). A button would allow the user to delete the store SSID and put the device back into seek / connect mode.
Can the Spark start up and run my code without a WiFi / Cloud connection? It looks like the answer is “yes, but…” I would need to create a separate routine that prevents the default behavior (connect to WLAN, connect to cloud)
Can the WiFi component / stack on the Spark scan for available networks and pass that data to my application? This post makes it look possible.
Can my code update the WiFi configuration for the Spark, adding a newly discovered network to the list? Can’t readily find an answer to this one. The Smart Config process and the CLI appear to be able to do this, but there isn’t any mention of use code altering the configuration.
Can my code receive callbacks indicating connection, connection timeout, connection failure, etc? If not, can you poll for it in the loop() function? Didn’t see anything on this in the forums.
Can my code read / delete known networks from the CC3000’s configuration?
Any answers, pointers or suggestions you might have would be greatly appreciated.