I've never seen an error 13313 before! If you can get something simple that reproduces it then I'll see what I can do to fix it though.
For the order of setAdvertising/setServices and sleep/wake - it shouldn't matter. If they're set up when in sleep, it should just apply when you wake. Internally, if the device is 'awake', setAdvertising actually calls sleep, sets up advertising, then calls wake - so it should be fine either way.
© Espruino, powered by microcosm.
Report a problem