od behaviour with myLoader

Posted on
  • 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


    1 Attachment

    • Screenshot 2021-01-29 at 20.52.30.png
  • 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("m­EwwhC/AH4ATxAAQC+2N7vd7AX/C/6/7a/4X/a/4X­/C/4X/C/4Xfl3iC6vu9wXtI653WAH4A/ABg"))
    

    And this icon.js not work ?

    require("heatshrink").decompress(atob("A­H4A/ACXd7vQC6vUpoBBDaQXEDaQXIDZwXMAIQZHC­4R6BAAIZJDAwXIDY4XHAAodJ7oXMDpQXSAAiRHho­WN7zFLDY/e9ve9zeMhvQCIIBFC5ARIC5oVNC5EOC­pwABC4vuCZYXPCIwXOCJAAFC5gAJ8AXFCpwuHgDj­CFqQXC6lN6gbFf5gXEAInd6AXVDYndhoXKBoIbMC­5QZLC44AFDpIXNDpQXdhoYMAAbwIC6oZQbxhOKC5­gbKC6BUGC6oA/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("A­H4A/ACXd7vQC6vUpoBBDaQXEDaQXIDZwXMAIQZHC­4R6BAAIZJDAwXIDY4XHAAodJ7oXMDpQXSAAiRHho­WN7zFLDY/e9ve9zeMhvQCIIBFC5ARIC5oVNC5EOC­pwABC4vuCZYXPCIwXOCJAAFC5gAJ8AXFCpwuHgDj­CFqQXC6lN6gbFf5gXEAInd6AXVDYndhoXKBoIbMC­5QZLC44AFDpIXNDpQXdhoYMAAbwIC6oZQbxhOKC5­gbKC6BUGC6oA/AHgA=="))
    }
    
    // image string gives you
    var img = require("heatshrink").decompress(atob("m­EwwhC/AH4AT7vd6AXV6lNAIIbSC4gbSC5AbOC5gB­CDI4XCPQIABDJIYGC5AbHC44AFDpPdC5gdKC6QAE­SI8NCxveYpYbH73t73ubxkN6ARBAIoXICJAXNCpo­XIhwVOAAIXF9wTLC54RGC5wRIAAoXMABPgC4oVOF­w8AcYQtSC4XUpvUDYr/MC4gBE7vQC6obE7sNC5QN­BDZgXKDJYXHAAodJC5odKC7sNDBgADeBAXVDKDeM­JxQXMDZQXQKgwXVAH4A8A=="))
    
    

    In a previous post you advised to use imageobject on 2.08 firmware. But that does not seem to work.

  • 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.


    1 Attachment

    • Screenshot 2021-01-29 at 23.44.10.png
  • And 5 minutes later it works. Lesson learned -App ID must be the same as sourcefolder name.


    1 Attachment

    • Screenshot 2021-01-29 at 23.52.51.png
  • Glad you got it sorted! If you're developing locally there's a file called bin/sanitycheck.js that you can run on your PC, which does some quick checks for potential problems.

    Why does this icon.js for dtlaucher work.... And this icon.js not work ?

    You've got a semi-colon at the end of it - that's all :) Remove that and i bet it'll work - the image needs to be a JS expression (not a statement).

    "compression Y, transparency Yes, 4 bit Mac Pallet, Image String" is absolutely fine for Bangle.js

    But you're right - this will have no effect on how it displays in the App Loader - just whether the icon uploads correctly to Bangle.js or not.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

od behaviour with myLoader

Posted by Avatar for HughB @HughB

Actions