-
-
Hi Gordon, Thanks for the quick reply. I eventually worked it out. I want to get some data in real time from a Bangle app onto the android screen.
In Droidscript
// Connect to Bangle puck = app.CreatePuckJS(); puck.SetOnReceive( readResponse ); // Callback to capture console output from app. puck.Scan("Bangle");
The callback function something like :
function readResponse(data) { if ( data.substring(0,1) != '{' ) return; // ignore non JSON d = JSON.parse(data); // Do something with the data in array d }
In the Bangle app the dat array is sent as a JSON string :
function btSend(dat) { // console.log(JSON.stringify(dat)); // transmit the data Bluetooth.println(JSON.stringify(dat)); // transmit the data }
It will all be published in the 'GPS Adventure Sports II' Bangle app soon.
-
-
-
... just noticed that the gesture that wakes the screen keeps the display constantly on when doing activities that involve raising and lowering your arms and hands. Working on stuff on a bench and general activity around the house seems to keep the screen on. Even typing this on the keyboard keeps enabling the screen.
Not generally noticed this happening in right way up mode.
M -
@Gordon Brilliant. You are a magician.
That certainly seems to make it usable for me. Last touch is to turn around the watch strap. I only use the default clock and the GPS Adv Sports app at this stage.
Just some comments to consider.
- It doesn't look like BTN4 and BTN5 are swapped. Not an immediate problem for me.
- Now 'BTN3' (standard BTN1 )to turn on and initial boot screen is 'upside down'. To be expected.
- Original standard BTN3 long press to exit app back to watch has not changed. I guess that is something deeper in the OS and not affected by the javscript BTN swap code.
- Swipe is not something I use.
- A full 'lefty' firmware version would be great! I would be happy to help if I could. Having said that I am not expecting you to spend time on something that only 10% of the population might use.
- I can activate the screen by rolling my wrist away from me. A little odd and inconvenient but doable for hands free turn on from power save mode. Absolutely essential while sailing as seldom have the other hand free to touch a button.
In short I think I have enough to use it in lefty mode but there are some things that could be polished.
I really appreciate the help so far.
Regards
Mike - It doesn't look like BTN4 and BTN5 are swapped. Not an immediate problem for me.
-
-
Great, thanks. Really helpful starting point tip.
A quick play has revealed :
- Screen is flipped as expected.
- Screen/graphics refreshes in apps seem rather slow. Refreshes line by line from the top ( as flipped ).
- Gesture to turn on clock from power saving no longer works. Presumably rotation of wrist is now opposite to what is programmed.
It is sort of usable.
Cheers
M - Screen is flipped as expected.
-
@Gordon I guess custom firmware would be the ideal approach. I can appreciate that this would incur ongoing maintenance effort on your part.
As a first step I don't see the button order as being an issue. It is easy enough to learn and adapt to which button is which. The core thing to start with is to rotate the screen. Is that possible with Javascript?
-
-
Hi All,
It would be really nice to be able to rotate the display 180 degrees so that the Bangle.js can be worn on the right wrist with the buttons correctly oriented and easy to access. At present it is a real pain for left handers having the buttons facing up your forearm. When wearing long sleeves and, in particular, wet weather and sailing gear they become inaccessible.
Is this feasible? If so, how?
Thanks
Mike -
All credit to Wouter Bulten for a light weight javascript kalman filter : https://github.com/wouterbulten/kalmanjs
Included the library and :
var spdFilter = new KalmanFilter({R: 0.01, Q: 2});
var altFilter = new KalmanFilter({R: 0.01, Q: 2});Use the two filters to smooth the speed and alt values of each successive fix :
// Smooth data
if ( lf.smoothed !== 1 ) { lf.speed = spdFilter.filter(lf.speed); lf.alt = altFilter.filter(lf.alt); lf.smoothed = 1; }
I haven't tried it on the lat/lon position values as the app is not about position as such so would be interested in the results of that. Alt was varying by as much as 10-15 m when stationary but with this filtering is now stabilising within 1-2m of known altitude references. Good enough for what I need.
-
Currently testing an updated version of speedalt (GPS Adv Sports) app that I have included a Kalman filter in for both the alt and speed readings. Massive improvement in reading stability and has completely stopped readings jumping around with each gps fix. Alt will now stabilise on a surprisingly accurate figure within 60 seconds or so.
-
-
That looks elegant and simple. How about some control over the timing settings as parameters? Something like :
try { require("gps-settings").setLowPower(update,search); } catch (e) { // GPS settings not installed }
And a way of reading current state ? ( eg. whether on/off, mode and current settings )
-
-
Sounds good but I am not using the widget in a static way so I hope I can still dynamically change mode as needed. Will there be an API to allow me to dynamically change the GPS mode?
My speedalt app functions like a watch face in that it obeys the screen off timeouts etc. You can flick the screen on for 10 secs for a look with a wrist movement etc. While the screen is on it uses the current widget call to switch to SuperE mode and when the screen goes off it switches to PMOO mode. Worked really well over a two day hike plus 4 hours of driving on a single charge last weekend. ( Actually drops to PMOO mode 15 secs after the screen is turned off allowing a little time to restore the screen if you want to keep viewing it )
Alternatively, perhaps make that behavior one of the baked-in options in your settings app?
-
@Gordon, Thanks for the quick answer a couple of days ago. Sorry about the delay, I have 'been bush' field testing the Bangle.JS
If I follow what you are saying :
- A GPS app can call the GPS Low Power Service widget to set a power mode and power on the GPS.
- The GPS Low Power Service powers on the GPS in the requested mode.
- The GPS app exits and the GPS is automatically powered off.
- The GPS Low Power service continues to run with a widget icon indicating the GPS is on but the GPS is actually off.
Is that right?
Thanks, Mike.
- A GPS app can call the GPS Low Power Service widget to set a power mode and power on the GPS.
-
Thanks for the tip. Updated the example above.