Ahh. Maybe it was due to doing require("Storage").erase("myfile\0") rather than using StorageFile?
Not sure if this is actually easier but you can do wildcards using .filter on arrays:
require("Storage").list().filter(x=>/^foo.*/.test(x)).forEach(x=>require("Storage").erase(x))
// or maybe just
require("Storage").list().filter(x=>x.startsWith("foo")).forEach(x=>require("Storage").erase(x))
look for a more offline solution.
Interesting - at least for development you could just host BangleApps locally (which is what I do) but I guess even though we could use serviceworkers to make it work offline (like espruino.com/ide does) there may be little point in that as most stuff requires an internet connection.
How are you storing the data NEMA sentences or JSON ?
I just store CSV with time,lat,lon,altitude. It's now live at https://banglejs.com/apps - if you install GPS Recorder then you can run the app and start recording - and it'll keep running even when you exit and have a watch face up.
In https://banglejs.com/apps, when you're connected you'll get a Download icon next to GPS Recorder - click it and you can then download the data as GPX or KML.
I currently only display the lat/lon of the first coordinate on the map for speed, so if there was a way to add a button that would download and view the entire track on some service (Google Maps/Mapbox/Openstreetmap) it'd be great!
minification
I think whatever we did in general would have to work even if someone edited files on GitHub itself, since realistically installing Git & Node and using the CLI is a pretty big hurdle if you're not a Node developer :)
However I'm sure at some point someone will want to use multiple files, and maybe typescript - so a dev folder might be a good plan in that case? Maybe it should just be inside apps/myapp/dev?
Also, right now you can't use modules since there's nothing there to load them in. Maybe the smartest option is to pull in the Web IDE code and then do it all dynamically.
is there a way to introduce a user selectable GPS polling rate?
Ish. You can communicate straight with the GPS and tell it to enter different modes, but it's not something I have a nice API for.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi!
Ahh. Maybe it was due to doing
require("Storage").erase("myfile\0")
rather than usingStorageFile
?Not sure if this is actually easier but you can do wildcards using
.filter
on arrays:Interesting - at least for development you could just host BangleApps locally (which is what I do) but I guess even though we could use serviceworkers to make it work offline (like
espruino.com/ide
does) there may be little point in that as most stuff requires an internet connection.I just store CSV with
time,lat,lon,altitude
. It's now live at https://banglejs.com/apps - if you installGPS Recorder
then you can run the app and start recording - and it'll keep running even when you exit and have a watch face up.In https://banglejs.com/apps, when you're connected you'll get a Download icon next to
GPS Recorder
- click it and you can then download the data as GPX or KML.I currently only display the lat/lon of the first coordinate on the map for speed, so if there was a way to add a button that would download and view the entire track on some service (Google Maps/Mapbox/Openstreetmap) it'd be great!
I think whatever we did in general would have to work even if someone edited files on GitHub itself, since realistically installing Git & Node and using the CLI is a pretty big hurdle if you're not a Node developer :)
However I'm sure at some point someone will want to use multiple files, and maybe typescript - so a dev folder might be a good plan in that case? Maybe it should just be inside
apps/myapp/dev
?Also, right now you can't use modules since there's nothing there to load them in. Maybe the smartest option is to pull in the Web IDE code and then do it all dynamically.
Ish. You can communicate straight with the GPS and tell it to enter different modes, but it's not something I have a nice API for.
I just uploaded my test code to https://github.com/espruino/BangleApps/blob/master/testing/GPS-comms.js so feel free to have a play. As I understood it, the
UBX_CFG_PMS
message enabled automatic power saving, which basically tried to do what it could to lower power consumption.