-
-
Hey - success ! I was wrong about the GPS settings not sticking across a Power Off /On.
I had not used my GPS for a while so got fooled by the extra time it takes when it has completely lost track of satellites. So I think I have a working gpssetup App !
At the moment I have an ON/OFF - just because I need a way of turning the GPS Power off BUT I can easily do that through any App. Shall I take the ON/OFF option out to do a pull request ?
One question I have is that I want to display a message while the GPS is powered on , setup and then powered off. At the moment I just get a blank screen. Here is the code snippet.
'< Back': ()=>{ exitSetup(); } }; return E.showMenu(mainmenu); } function exitSetup() { log_debug("exitSetup()"); if (settings_changed) { log_debug(settings); g.clear(); g.setFontAlign(0,0); g.setColor(3); g.setFontVector(25); g.drawString("Configuring GPS",120,120); wait(500); setupGPS(); wait(500); } load(); } loadSettings(); showMainMenu();
I am showing the back end of the menu setup. When you select Exit setupGPS() is called picking up the settings you have selected. Problem is I never see the message "Setting Up GSP". Do I need to trigger the call to setupGPS() through an interval timer say 10 ms after the call to g.drawString("Configuring GPS",120,120);
-
Updated to 2.08.167 - but still not seeing the "searching for GPS" message. Do see the word BLUETOOTH in bottom left of screen around about the time I have got used to seeing the message. Would "checking GPS time" be a better message during bootup. My understanding is that it is checking the GPS clock.
-
-
-
Battery went flat. Recharged but on power up date was set to 20548 as the year. Tried a BTN1+BTN2 reset but noticed I did not see the 'Searching for GPS' message. Decided to start up the GPS using my app, got a GPS and could see the time was correct on the GPS fixes so assumed that the time was now stored in the GPS. Did another reset. No 'Searching for GPS' message and clock still incorrect. Search for a way to set the Bangle Date/Time manually but could not find the button on the launcher. Then installed GPSTime and got a fix. Pressed SET () and reset GPS. On start up: no 'Searching for GPS' message BUT clock was now set, which will have been set by action (). Hope that makes sense. I'm up an running again. Happy to stay on 2.08.160.
-
I would like to produce a widget icon with similar properities to the Bluetooth widget ICON. Its not clear how this icon is contructed. What size is it in terms of pixels when downloaded from icons8.com. The outline of the icon can change color by using set color. I have tried all 3 of the attached icons from icon8 and none of them will display. They all end up black on black. I am wondering what it is that has to be done with the png file from icon8 in order to make the color change when using setcolor() ?
This one is 32x32.
-
Installed GPS Time from App Loader. The app came up with the correct time as if GPS had remembered the fix from before, so I was able to set the time from that without waiting for a fix. On rebooting v2.0.160 I only see a message that says bluetooth in the bottom right hand corner around the time it would have said 'Searching for GPS'.
-
Help! My battery went flat. Once I got some charge back into the battery it came up with Thursday 7 Oct 20548 as the date. Managed to get a fix for the GPS and rebooted but am not seeing the 'Searching for GPS' message. Am on 2.0.8.160 firmware. I seem to remember there was a way to set the time from the App Loader but cant find it.
-
Few further developments / tests.
1) Config not surving across power on/off: I built a 2nd version of the gps face for multiclock. I setup GPS for PMSOO mode with 120/6 second values. The GPS then powers off. However when it powers back on through a simple Bangle.setGPSPower() the settings dont seem to have stuck. I deleted the gpsservice widget in case of complications. This is the bit that I did not / but now have tested. The UBX-CFG-SAVE() seems to work if it is within the same session of the GPS being on. IE without out it, the GPS continues to run through a 1 sec high power cycle. So probably more work to do on the GPS config to ensure the setup survives a power cycle.
2) gpssetup App code: I have the code for a gpssetup App, I will post it here. Would you want it as a pull request yet or shall I hang on until I have either succeeded to make the config survive or I am out of things to try ?
3) Going to try a tiny widget to show GPS Power status - a bit like the BLE widget turns blue on connection. It will use getGPSPower() so wont work for others unless they have 208.160 firmware or above.
-
I have written the code for the gpssetup App. But am finding that on exit of the settings menu (caling load()) the GPS power is turned back off. I installed firmware 2.08.160 so I can see if the GPS is on or not.
I will try the solution for the above.
However I am not yet convinced switching the GPS on / off all the time is a great idea. Imagine a collection of apps that work with the GPS, a waypoint setter, a route follower, a waypoint finder, a position display with lat/lon or grid ref, a route logger etc. With a handheld GPS you can switch between all of these screens without the GPS being turned off and on. If the GPS is powered off it then has to go through the satellite aquisition process again and that can take 30 seconds to 5 minutes depending on how long the GPS has been off.
Does Bangle.setGPSPower(1) do nothing if the power is already on ?
-
Hi @Gordon - I tried out v2.08.160 last night to try the Bangle.getGPSPower();
However I am now having trouble getting the standard launcher to work.
All I get is a blank screen on BTN2.
When using the tapelauncher I get the following.
The watch can still connect to the IDE but the launch capabilities are broken.____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v08.160 (c) 2019 G.Williams Uncaught Error: Backreferences not supported at line 1 col 20 var sf=STOR.list(/\1$/).map(s=>s.slice(0,-1));var sffilter=f=>!sf.in... ^ in function "get_pruned_file_list" called from line 13 col 28 files=get_pruned_file_list(); ^
-
-
-
-
-
@Gordon - I'm working on a gpssetup app to replace the gpsservice widget. I am thinking I will need to have an ON/OFF setting so that I can manually switch on the GPS when needed for watch faces like osref.face and gps.face etc. Once it is possible to determine the power status of the GPS through a call to Bangle.getGPSPower() then that wont be necessary as each App will be able to decide if it needs to power it on or not. I noticed that you supressed switch off of GPS in the gpsservice widget if the widget thinks its already off etc.
-
Would it be possible to add Bangle.getGPSPower() and Bangle.getHRMPower() in v2.09 of the firmware.
These would be useful for ensuring that the right decision is made in Apps.For example
if (Bangle.getGPSPower() == false) { // only need to turn on the GPS if it is switched off Bangle.setGPSPower(true); } Bangle.on('GPS', print);
-
-
Its nothing todo with the icon.js. It seems to be down to the fact that I created a sub folder called tapelaucher but I called the id tapelauch. However when I have set the id to tapelauncher and pushed code up I still get the wrong url being generated for the README etc. You can see this in the screenshot below. Its like there is some sort of delay between pushing to github and the launcher being able to see your files.
-
I think this is something to do with the icon.js file. I'm a bit confused about how this works. When I create an icon.js file the image wont draw and the code crashes. I am using 4 bit pallet as in the video. The only way I can get a tapelaunch.img file onto the watch is by uploading the PNG file downloaded from icon8 and letting the image converter kick in from the IDE (as per the tutorial). But then I don't get the code that the image converter generates ? The terminology is a bit confusing around ImageStrings and ImageObjects. Both options produce strings.
So uploading the icon.js file used by the dtlaucher as tapelauncher.img does not work. When I go through the upload route I get an actual image file.
Why does this icon.js for dtlaucher work.
require("heatshrink").decompress(atob("mEwwhC/AH4ATxAAQC+2N7vd7AX/C/6/7a/4X/a/4X/C/4X/C/4Xfl3iC6vu9wXtI653WAH4A/ABg"))
And this icon.js not work ?
require("heatshrink").decompress(atob("AH4A/ACXd7vQC6vUpoBBDaQXEDaQXIDZwXMAIQZHC4R6BAAIZJDAwXIDY4XHAAodJ7oXMDpQXSAAiRHhoWN7zFLDY/e9ve9zeMhvQCIIBFC5ARIC5oVNC5EOCpwABC4vuCZYXPCIwXOCJAAFC5gAJ8AXFCpwuHgDjCFqQXC6lN6gbFf5gXEAInd6AXVDYndhoXKBoIbMC5QZLC44AFDpIXNDpQXdhoYMAAbwIC6oZQbxhOKC5gbKC6BUGC6oA/AHgA=="));
Why does the image converter allow icon files to be created that won't work with the watch ?
When I select use compression Y, transparency Yes, 4 bit Mac Pallet, I get two options:
// image object gives you var img = { width : 48, height : 48, bpp : 4, transparent : 0, buffer : require("heatshrink").decompress(atob("AH4A/ACXd7vQC6vUpoBBDaQXEDaQXIDZwXMAIQZHC4R6BAAIZJDAwXIDY4XHAAodJ7oXMDpQXSAAiRHhoWN7zFLDY/e9ve9zeMhvQCIIBFC5ARIC5oVNC5EOCpwABC4vuCZYXPCIwXOCJAAFC5gAJ8AXFCpwuHgDjCFqQXC6lN6gbFf5gXEAInd6AXVDYndhoXKBoIbMC5QZLC44AFDpIXNDpQXdhoYMAAbwIC6oZQbxhOKC5gbKC6BUGC6oA/AHgA==")) } // image string gives you var img = require("heatshrink").decompress(atob("mEwwhC/AH4AT7vd6AXV6lNAIIbSC4gbSC5AbOC5gBCDI4XCPQIABDJIYGC5AbHC44AFDpPdC5gdKC6QAESI8NCxveYpYbH73t73ubxkN6ARBAIoXICJAXNCpoXIhwVOAAIXF9wTLC54RGC5wRIAAoXMABPgC4oVOFw8AcYQtSC4XUpvUDYr/MC4gBE7vQC6obE7sNC5QNBDZgXKDJYXHAAodJC5odKC7sNDBgADeBAXVDKDeMJxQXMDZQXQKgwXVAH4A8A=="))
In a previous post you advised to use imageobject on 2.08 firmware. But that does not seem to work.
-
Noticed I sometimes get problems when I create a new app, push to my repro then try and deploy to my watch. See screenshot below: 1) App icon does not display, 2) clicking upload fails with a 404, 3) clicking on Read More says that the README.md file is not present. Yet all these files are present in my github repository.
https://github.com/hughbarney/BangleApps/tree/master/apps/tapelauncher
I have developed a little widget that works like the bluetooth widget to show the power status of the GPS.
This uses Bangle.isGPSOn() which is in the leading edge formware v2.08.167
I wont check in until that firmware is generally available.
One thing I have found is that when I switch to a multiclock face that switches the GPS On; the widget does not repond and display the status until the LCD has powered off, or I change to a different clock face. To get round this I am poking the widget using.
Code of widget below: