I was recently introduced to Spark Core – a diminutive Arduino clone with integrated WiFi and extensive cloud support.
These are some observations I made while porting some Arduino 433Mhz RF code to it.
If one for some reason lacks WiFi (the integrated on-chip antenna offers quite good coverage) user code will in general never execute. The core will try for-ever to connect to the Spark Cloud while blinking a rainbow of confusing colors. The remedy is either to setup WiFi immediately (and give up on the thought of using the core in an un-connected none Internet-of-things setting) or use a recent addition to the Spark API:
The semi part of the system mode will make the core refrain from attempting to connect the cloud.
Spark Core ships with “special” bootstrap firmware, named tinker, that is factory-installed on all cores. If one, like me, skips the “newbie”-only step-by-step guide and immediately flashes over this firmware with something of ones own creation it’s no longer possible to get the core into the “Listening mode” required to set it up with credentials to the local WiFi network. How-ever it’s easy to reflash with tinker.
The core’s singular color status LED is a train wreck. It’s both in many cases the (only?) key to unlock what the core really is up to and, at the same time, painfully hard to decipher. I mean – what’s the difference between pulsing and “breathing”? Can you differentiate between light blue and cyan in a well lit room?
When porting Arduino code I stumbled on some interesting incompatibilities:
- The Ardunio binary literal syntax, e.g. B01010101, is unsupported. It’s recommended to use gcc syntax, e.g 0b01010101, instead.
- The Spark Core has a 32 bit CPU while much Arduino code tends to be 16 bit, this can cause problems with code that does bitwise operations (a perennial C language favourite).
- When the Core is connected to the cloud one can expect some latency outside of the main loop function (that’s where WiFi system code is run). This can cause problems with timing-sensitive Arduino code.
- Debugging by means of logging through the serial interface can be tricky – serial communcation appears to be seriously asynchronous even when data is explicitly flushed.
Spark Cores are quite cool and small. 🙂