# Documentation Needs

**URL:** <https://community.particle.io/t/documentation-needs/4555>\
**Category:** General\
**Created:** [May 23, 2014, 3:41pm UTC](https://community.particle.io/t/documentation-needs/4555 "2014-05-23T15:41:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 23, 2014, 3:41pm UTC](https://community.particle.io/t/documentation-needs/4555/1 "2014-05-23T15:41:50Z")

</div>

There has been much conversation regarding updating documentation. This thread will act as an on-going list of things that need to be documented or have the documentation improved. I invite any Spark Elite or Spark employees to edit this post as needed when new documentation needs arise or are completed. All users are invited to contribute pull requests to the [official documentation repository](https://github.com/spark/docs) hosted on GitHub. Please keep replies to this topic as concise as possible. If debate is needed, please start a new thread (a la “Documentation - UDP Issues”). I think prepending new topic subjects with "Documentation - " will help everyone visually filter the list of topics. I will propose an official Documentation category the Spark Team that will eliminate the need to add "Documentation - " to the topic subject.

### To-do

- UDP issues - UDP.parsePacket() does not function as expected - no packet boundaries per se
  - more here: [http://community.spark.io/t/documentation-needs/4555/31](http://community.spark.io/t/documentation-needs/4555/31)

- Spark CLI special characters - [https://community.spark.io/t/how-to-send-hash-character-to-spark-function/4548](https://community.spark.io/t/how-to-send-hash-character-to-spark-function/4548)
- Supplemental documentation for Spark.publish() and Spark.subscribe() - [https://community.spark.io/t/publish-subscribe-semantics-documentation/4403](https://community.spark.io/t/publish-subscribe-semantics-documentation/4403)
- Toolchain installation guides
  - Windows
  - OS X
  - Ubuntu - [https://community.spark.io/t/how-to-install-the-spark-toolchain-in-ubuntu-14-04/4139](https://community.spark.io/t/how-to-install-the-spark-toolchain-in-ubuntu-14-04/4139)

- Spark CLI installation guides
  - Windows
  - OS X
  - Ubuntu - [https://community.spark.io/t/how-to-install-spark-cli-on-ubuntu-12-04/3474](https://community.spark.io/t/how-to-install-spark-cli-on-ubuntu-12-04/3474)

- Installing DFU-UTIL and driver for Core
  - Windows
  - OS X
  - Ubuntu

- Bug where delay() does NOT call SPARK\_WAN\_Loop() when the SPARK\_WLAN\_SLEEP flag is set by Spark.sleep() - [https://community.spark.io/t/can-i-turn-the-cc3000-off/3233/124](https://community.spark.io/t/can-i-turn-the-cc3000-off/3233/124)
- Access token expiration (there is already doc on this–maybe it needs to be polished)
- RAM - Why there is so little, tips and tricks to reduce usage
- Better/more visible panic code documentation (this is under troubleshooting now)
- Adding `#include "application.h"` to user code
- Cannot claim core - already claimed cores, other issues
- Cannot connect to wifi - common scenarios and solutions
- Improve documentation regarding connecting to wifi that routes through a splash page
- How to get order and/or shipping information
- Make core firmware changelog accessible/visible to members on the IDE and via documentation
- Web server code example - [https://community.spark.io/t/tiny-webserver-code/3297](https://community.spark.io/t/tiny-webserver-code/3297)
- Web client code example. Specifically POST, GET and how to buffer all of the data completely (since the TCP buffer is now 128 bytes - was 512) - [https://community.spark.io/t/making-a-get-or-post-request-from-the-core/2288](https://community.spark.io/t/making-a-get-or-post-request-from-the-core/2288)
- `itoa()`, `utoa()`, `atoi()`, etc - [https://community.spark.io/t/how-can-i-use-the-itoa-function/2487](https://community.spark.io/t/how-can-i-use-the-itoa-function/2487)
- `#include <math.h>` issues
- RSSI
- [ON-HOLD] WiFi on/off, cloud on/off (this may be getting a firmware makeover soon)
- [ON-HOLD] New Spark CLI commands (document when released)
- [ON-HOLD] Simplified local toolchain build environment - [https://community.spark.io/t/tweak-request-to-core-firmware-src-build-mk/2900/13](https://community.spark.io/t/tweak-request-to-core-firmware-src-build-mk/2900/13) (this may make it directly into the core-firmware soon)
- CFOD TI patch
- Add tone()/noTone() functions to Core Firmware documentation (make sure to add all pins tone available on) [https://community.spark.io/t/tone-function-missing/1116](https://community.spark.io/t/tone-function-missing/1116) and more info at [https://github.com/spark/core-firmware/pull/177#issuecomment-44966380](https://github.com/spark/core-firmware/pull/177#issuecomment-44966380)
- Add/expand recommendations for safe and unsafe ways of accessing the Spark Core with device ID and access\_tokens. See Dave’s comments here: [https://community.spark.io/t/putting-access-token-to-rest-inside-the-core-most-secure/5046/15](https://community.spark.io/t/putting-access-token-to-rest-inside-the-core-most-secure/5046/15)
- Add a section called MACROs to the Firmware Reference. Include all standard macros and any extra goodies that might be useful. [FYI: I added the first MACRO reference to the DOCs… arraySize(). Perhaps MACROs should be abstracted as just other random Functions that can be used? -BDub]
- Document the use of `SPARK_WLAN_Loop();` in code, how, why, when. FYI: This is how you call the entire background process that manages the connection to the Cloud. You can do this from user code, or let the user code end `loop()` and it will be called automatically. There is currently an issue logged that `Spark.process()` is not calling `SPARK_WLAN_Loop()` and should be.
- Document how `#pragma SPARK_NO_PREPROCESSOR` is used to keep the Cloud compiler from preprocessing your `*.ino` files. This `*.ino` is the default file naming in the Web IDE, but when using Spark CLI or Spark Dev you can simply name your main file `*.cpp` and no preprocessing will occur. Document what is needed in your code if you chose not to use the Preprocessor.
- **Return codes**  
Several or many or most or all of the functions described in the firmware docs have undocumented return codes. E.g. most or all of the functions in the UDP library return codes which are undocumented. A specific example: I read in the forum that UDP.write() returns -1 or -2 on error but this is undocumented. It would be nice to know what the return codes of all the functions are. Just to know that they exist, and what signifies failure and what signifies success, would be very useful. The convention in C is that functions return -1 for failure, setting the global errno to identify the error. 0 signifies success. Anyway, whatever, where there are return codes they should please be documented.

### Completed

- [@peekay123] Fix Spark.time documentation bugs
- [@wgbartley] Add `Content-length` header to TCPClient sample code
- [@wgbartley] Clarify DST and offsets for Spark.time - [https://community.spark.io/t/time-zone-and-daylight-savings-and-spark-synctime/4568/2](https://community.spark.io/t/time-zone-and-daylight-savings-and-spark-synctime/4568/2)
- [Already Documented] Spark.publish() TTL - [https://community.spark.io/t/meaning-of-ttl-parameter-in-spark-publish/4549](https://community.spark.io/t/meaning-of-ttl-parameter-in-spark-publish/4549)
- [@BDub] Onboard RGB LED control, other tips and tricks - [https://community.spark.io/t/disabling-status-led/3656](https://community.spark.io/t/disabling-status-led/3656)

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 23, 2014, 3:47pm UTC](https://community.particle.io/t/documentation-needs/4555/2 "2014-05-23T15:47:24Z")

</div>

OK, and should anyone want to add to the list but lacks the permission to edit the main, initial posting of this thread, then would it be OK if they should comment as I do here, and someone with the necessary permissions will delete same (or mark same as “included” or something) and fold the information into the first posting??? [This thread should be a wiki :-)]

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 23, 2014, 3:50pm UTC](https://community.particle.io/t/documentation-needs/4555/3 "2014-05-23T15:50:08Z")

</div>

There is a neat trick buried in this thread explaining how to turn off the status LED except for exceptions: [Disabling Status LED - General - Particle](https://community.spark.io/t/disabling-status-led/3656)

There remains undocumented (and perhaps unimplemented) the effect of the TTL param in Spark.publish()  
[Meaning of ttl parameter in Spark.publish() - Firmware - Particle](https://community.spark.io/t/meaning-of-ttl-parameter-in-spark-publish/4549) - There are other questions too: [Publish & subscribe semantics & documentation - Firmware - Particle](https://community.spark.io/t/publish-subscribe-semantics-documentation/4403)  
It has recently become clear TTL is unimplemented.

There is uncertainty as to how much of the gcc build environment one can rely on when compiling in the cloud or even locally. E.G. Is UINT\_MAX reliably the max unsigned int on the Spark Core? Which of the Posix/ANSI/Standard C functions can be used? (Unix manual ch 2) Which libc functions? (Unix manual ch 3). Which #defines can be relied on? Which #defines are additionally defined?

> **[Libraries, gcc build environment and documentation](https://community.particle.io/t/libraries-gcc-build-environment-and-documentation/4386/8)**
>
> I’ve never heard that said about wikis before and I would rather assert wikis are where information goes to thrive. Whatever, the documentation is dead where it is, or as good as. What needs to be released early and often is the documentation as...

> **[Conditionally include Spark includes #define SPARK\_CORE isn't viable, what is?](https://community.particle.io/t/conditionally-include-spark-includes-define-spark-core-isnt-viable-what-is/4228/10)**
>
> I don’t have the time to install the tool chain and build locally. I hope my comments are still appreciated. And I look forward to the new SPARK symbol being available for cloud compiles. Thanks!

Related is the definition of the language itself, and portability issues, and the fact that not even all the functions available are listed in the Spark docs:

> **[Code portability - Uno, Leonardo, SparkIO - and language definition](https://community.particle.io/t/code-portability-uno-leonardo-sparkio-and-language-definition/3747/10)**
>
> My stubborn aversion to github might now becoming apparent but that isn’t it, really not. The situation is that I cannot spend the time reading the code to work out what the docs should say. \[This is the wrong way around, in an ideal world,...

---

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 23, 2014, 4:01pm UTC](https://community.particle.io/t/documentation-needs/4555/4 "2014-05-23T16:01:13Z")

</div>

NICE!!!

Some of that stuff is way over my head. I’ll have to leave it to the smarter guys to update the to-do list with a summary that makes sense to you smart folks.

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 23, 2014, 4:02pm UTC](https://community.particle.io/t/documentation-needs/4555/5 "2014-05-23T16:02:24Z")

</div>

Here is some useful installation tips for Ubuntu 14.04. It could be split up a bit for those who don’t wat the entire tool chain, just spark-cli:

> **[How to install the spark toolchain in Ubuntu 14.04](https://community.particle.io/t/how-to-install-the-spark-toolchain-in-ubuntu-14-04/4139)**
>
> I just upgraded to Ubuntu 14.04 and had to set my spark environment back up from scratch. I thought I’d document the process and share it with anyone else attempting to get it running. Spark toolchain setup for Ubuntu 14.04 (Trusty) Make sure you...

Here are spark-cli install tips for Ubuntu 12.04

> **[How to install spark-cli on Ubuntu 12.04](https://community.particle.io/t/how-to-install-spark-cli-on-ubuntu-12-04/3474)**
>
> Do not install nodejs or npm from the standard repositories. If you have done so, or you are uncertain, first uninstall $ sudo apt-get remove nodejs npm $ sudo apt-get purge nodejs npm $ sudo apt-get autoremove Install nodejs from the Chris Lea...

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 1:05am UTC](https://community.particle.io/t/documentation-needs/4555/6 "2014-05-24T01:05:12Z")

</div>

Documentation bug:

> **[Time.zone() and daylight savings and Spark.syncTime()](https://community.particle.io/t/time-zone-and-daylight-savings/4568/2)**
>
> A documentation bug has been reported and we’re told it is fixed and so will appear soon, one hopes, in the web-available version of the docs. Time.zone() does not return a value, so there is nothing to be printed. Here is the example from the...

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 1:05am UTC](https://community.particle.io/t/documentation-needs/4555/7 "2014-05-24T01:05:37Z")

</div>

Can this topic be pinned to stay at the top? Why not?

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 1:11am UTC](https://community.particle.io/t/documentation-needs/4555/8 "2014-05-24T01:11:44Z")

</div>

It is unclear in the docs as to whether Time.zone() is reset by Spark.synctime().

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 24, 2014, 1:34am UTC](https://community.particle.io/t/documentation-needs/4555/9 "2014-05-24T01:34:33Z")

</div>

Reading the source in github, Time.zone(x) is a _set_ function–it does not return any value. It lets the programmer set the current time zone. The value is simply multiplied by 3600 and stored as an integer number of seconds.

Spark.syncTime() does not know about or change the time zone.

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 2:04am UTC](https://community.particle.io/t/documentation-needs/4555/10 "2014-05-24T02:04:49Z")

</div>

Thank you, but this isn’t clear in the docs, and needs to be made clear. There.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [May 24, 2014, 2:26am UTC](https://community.particle.io/t/documentation-needs/4555/11 "2014-05-24T02:26:30Z")

</div>

The doc is actually completely correct. It is the example that is wrong.

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 2:30am UTC](https://community.particle.io/t/documentation-needs/4555/12 "2014-05-24T02:30:54Z")

</div>

The examples are a crucial part of the docs. Much of the docs is completely mysterious or would be, without the examples. The particular example is wrong and that was previously identified by someone else but the comment is misleading about DST and creates an incorrect impression. And, futhermore, my question as to the possible interplay between timeSync and zone is a legitimate one, one that any programmer worth his salt would check the docs for, and one not settled by the docs, with or without the examples.

It all needs fixing, do you say different?

---

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 24, 2014, 3:08am UTC](https://community.particle.io/t/documentation-needs/4555/13 "2014-05-24T03:08:27Z")

</div>

I take full responsibility for messing up the time docs. I’m definitely going to double-check all of the returns more carefully!

I have a sick kiddo at home, so my free time has been spent cleaning up “yuck” and waiting for the next bout. Hopefully she’ll recover, and it’ll stay isolated to just one! Otherwise, my documentation weekend is shot. ☹

---

<div class="post-metadata">

**Author:** ![psb777](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/psb777/32/934_2.png) [@psb777](https://community.particle.io/u/psb777)\
**Post date:** [May 24, 2014, 3:58am UTC](https://community.particle.io/t/documentation-needs/4555/14 "2014-05-24T03:58:19Z")

</div>

I hope all goes well but please don’t worry about the issue of blame. Only those who do nothing don’t make mistakes. Rarely is anything correct first time.

---

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 24, 2014, 4:59am UTC](https://community.particle.io/t/documentation-needs/4555/15 "2014-05-24T04:59:59Z")

</div>

> [@psb777](#):
>
> I hope all goes well but please don't worry about the issue of blame. Only those who do nothing don't make mistakes. Rarely is anything correct first time.

I knew you were a sweetheart underneath it all! But, seriously, thank you for the kind words.

I'm going to update the to-do list, but I don't think I have the energy left to write docs tonight. You see how the last docs I wrote late at night went!

---

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 27, 2014, 5:08am UTC](https://community.particle.io/t/documentation-needs/4555/16 "2014-05-27T05:08:03Z")

</div>

Looks like @zach pushed the new [http://docs.spark.io/](http://docs.spark.io/) changes live!

---

<div class="post-metadata">

**Author:** ![zach](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zach/32/20714_2.png) [@zach](https://community.particle.io/u/zach)\
**Post date:** [May 27, 2014, 5:19am UTC](https://community.particle.io/t/documentation-needs/4555/17 "2014-05-27T05:19:46Z")

</div>

YMMV, as DNS is still propagating. But it should be live for everyone by morning!

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [May 27, 2014, 5:37am UTC](https://community.particle.io/t/documentation-needs/4555/18 "2014-05-27T05:37:10Z")

</div>

Looking good in Singapore 😃

![](https://sea2.discourse-cdn.com/flex026/uploads/particle/1441/4c6fe9255f406bff.png)

---

<div class="post-metadata">

**Author:** ![wgbartley](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/wgbartley/32/1910_2.png) [@wgbartley](https://community.particle.io/u/wgbartley)\
**Post date:** [May 27, 2014, 6:10am UTC](https://community.particle.io/t/documentation-needs/4555/19 "2014-05-27T06:10:37Z")

</div>

@Zach, Can you do the honors of the new features in the updated docs?

After you get some sleep, of course!

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [May 27, 2014, 8:05pm UTC](https://community.particle.io/t/documentation-needs/4555/20 "2014-05-27T20:05:30Z")

</div>

@zach the new documentation setup is amazing! You whipped this up this weekend? Mad skillz!

BTW I followed the setup guide and after the `npm install` part, it went ahead and downloaded like every package in existence it seems like. The package.json doesn’t seems to call for all of that, so maybe grunt and assemble just need a ton of supporting packages??

Got this running locally in a snap. Then I updated `firmware.md` to test the live update feature, and got this error which I’m unsure about:

```auto

// HERE YOU CAN SEE IS WHEN THE GRUNT SERVER COMMAND STARTED THE SERVER
Running "connect:livereload" (connect) task
Started connect web server on http://localhost:9000

Running "watch" task
Waiting...OK
>> File "src\content\firmware.md" changed.

Running "coffeelint:grunt" (coffeelint) task
>> 1 file lint free.

Running "clean:dest" (clean) task
Cleaning build...Fatal error: watch EPERM
Fatal error: watch EPERM

```

After I forced the process to end, and re-ran `grunt build` and `grunt server` it all came up just fine. Actually just restarting the server seems to pick up the changes just fine as well since they are static resources.

[Next page](https://community.particle.io/t/documentation-needs/4555.md?page=2)
