Bricked the messages system?

Posted on
  • I tired to make a messagesUI replacement app. So I uninstalled Messages UI, then installed my app. Now I get the error message:

    Device connection failed, Error: Dependency type 'module' not supported
    

    Whenever I try to install the apps "messages" or "Message UI". I did a reset to factory, but still I have this error.
    The code I uploaded was:
    ===boot.js===

    Bangle.on("message", (type, msg) => require("xxlmessage").listener(type, msg));
    

    ===messagexxl.js===

    var drawTimeout; // = undefined;
    var xpos = 2*g.getWidth();
    var loopCount=0;
    
    // schedule a draw for the next 30 FPS
    function queueDraw() {
        if (drawTimeout) {clearTimeout(drawTimeout);}
        drawTimeout = setTimeout(function() {
            drawTimeout = undefined;
            draw();
        }, 32 - (Date.now() % 32));
    }
    
    function drawBackground() {
        g.setBgColor(0,0,0);
        g.setColor(1,1,1);
        g.clear();
    }
    
    function stop(){
        if (drawTimeout) {clearTimeout(drawTimeout);}
        load();
    }
    
    function draw(){
        Bangle.setLocked(false); // keep the touch input active
        drawBackground();
        g.setFont('6x8:5x10');
        g.setFontAlign(-1, -1);
    
        var gw = g.getWidth();
        var text = "This is a test with a longer message to try...";
        var wtot = g.stringMetrics(text).width;
    
        g.setBgColor('#000000');
    
        g.setColor('#ffffff');
        g.drawString(text, xpos, 0);
        g.drawString(text, xpos-gw-32, g.getHeight()/2);
    
        g.reset();
        xpos -= 3;
        if(xpos < -wtot-gw*2 ) {
            ++loopCount;
            if(loopCount > 2){
                stop();
            }
            xpos=3*gw;
        }
    
    
        // widget redraw
        Bangle.drawWidgets();
        queueDraw();
    }
    
    Bangle.loadWidgets();
    
    Bangle.on("message", (type, msg) => {
        if (!msg) return;
        if(type === 'text' && msg.t !== 'remove'){
            msg.handled = true; // don't do anything else with the message
            draw();
        }
    });
    
    Bangle.on('touch', function(b,xy){
        stop();
    });
    
    Bangle.setUI("clock");
    Bangle.drawWidgets();
    

    === metadata.json ===

    {
      "id": "xxlmessage",
      "name": "XXL Message",
      "version": "0.01",
      "shortName": "XXL Msg",
      "description": "App to display large notifications from iOS and Gadgetbridge/Android",
      "icon": "app.png",
      "type": "app",
      "tags": "tool,system",
      "supports": ["BANGLEJS","BANGLEJS2"],
      "readme": "README.md",
      "screenshots": [{"url":"screenshot.png"}],
      "storage": [
        {"name":"xxlmessage.app.js","url":"xxlmessage.js"},
        {"name":"xxlmessage.boot.js","url":"boot.js"},
        {"name":"xxlmessage.img","url":"app-icon.js","evaluate":true}
      ]
    }
    
  • Changed boot.js to require 'messages':
    Bangle.on("message", (type, msg) => require("message").listener(type, msg));
    Still error.
    Deleted all apps, updated the firmware. Still can't install messages, messages ui nor android integration.

  • Is this when trying to update from your forked app loader?

    I think there's a good chance that you haven't updated the core submodule?

    You can see from https://github.com/espruino/EspruinoAppLoaderCore/blob/425c4a98aed7c4d9b640e37463b534a45a20def7/js/appinfo.js#L418 which throws the error that with the current version of the code that should never happen because there's a if (dependencyType=="module") line right above it

  • That fixed it. Thank you.

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

Bricked the messages system?

Posted by Avatar for gfric @gfric

Actions