Trouble with Pixl+mukti

Posted on
  • And after playing with the badge extensively, it doesn't execute the code official badge.js code any more. Although some variables are set, see left-hand window log below.
    The code is at:
    https://github.com/dbovey/espruino/blob/­master/Badge_simple.js
    It is just the badge.js code with minor modifications.
    Running onInit()...
    Uncaught SyntaxError: Got ?[255] expected EOF
    at line 1 col 4808
    ...?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255]...

                                                                                                                                                                                                                                                                                                                                                                                                     ^
    

    at line 1 col 1
    ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255]...

                                                                                                                                                                                                                                                                                                                                                                       ^
    

    in function called from system

    NAME
    =[
    "Hello",
    "World"
    ]
    cityscape
    ={ width: 128, height: 16, bpp: 1,
    buffer: new Uint8Array([0, 0, 0, 0, 0, ... 255, 255, 255, 255, 255]).buffer
    }

  • Sat 2019.10.05

    @DBovey would you mind posting the link to the original official badge.js code please so that we may follow along with that source which originally worked.

    ref Writing an effective forum post


    What are the results of process.env

    When viewing your uploaded code in the WebIDE, are there any red error indicators on the Right-Hand side editor window? It appears the code file may have a typo or missing trailing line of code terminator.



    Could this - Cube Badge be the source?

    Post #1 comment L56 indicates onInit() called at start up. There isn't a reference to that function. Would it make more sense to manually save() after all edits have been performed, and change L71 to call onInit()?

  • Just to clarify, you have this badge, right?

    First thing to try would be to reset(1) to remove everything from flash, possibly you had too much in memory, or remains of a previous experiment mess up something. And do some basic sanity check - do the basics work?

    Or try the Returning to Standard instructions on the docs page.

  • Sorry @AkosLukacs for my incomplete post :-(
    > Just to clarify, you have this badge, right?
    @AkosLukacs Yes the pixl multicoloUr from the espruino shop

    > First thing to try would be to reset(1) to remove everything from flash, possibly you had too much in memory, or remains of a previous experiment mess up something.
    reset(1) says it erases the flash, but does not solve
    > And do some basic sanity check - do the basics work?
    entering this on left hand side and to the RH side as a JS file:
    var l;setInterval("digitalWrite(LED1,l=!l);"­,200);
    blinks the LED

    > Or try the Returning to Standard instructions on the docs page.
    I reflashed the espruino v2.04 code anew and then erased the flash using the BTN1 manipulation. (maybe should I have done that in reverse?)
    Did not solve.
    Thanks for your help!

  • *> @DBovey would you mind posting the link to the original official badge.js code please so that we may follow along with that source which originally worked.

    Writing an effective forum post*
    

    Thanks for the advice, I'm a noob in the forums etc and maker universe

    @Robin I took badge.js from git, downloaded to my pc, changed NAME variable and recopied to https://github.com/dbovey/espruino/blob/­master/Badge_original.js but cannot for the universe's sake find where it was originally on git or somewhere else (it was between 2 and 3AM)...
    (I'm really new to all the git stuff, I will have to ask to my colleague to get an understanding of the whys and hows of git. Bit more used to svn but I'm basically a HW guy)
    What are the results of process.env
    process.env
    ={
    VERSION: "2v04",
    GIT_COMMIT: "3956264e",
    BOARD: "PIXLJS",
    FLASH: 524288, RAM: 65536,
    SERIAL: "88eb467e-a9e672fe",
    CONSOLE: "Bluetooth",
    MODULES: "Flash,Storage,hea" ... "el,graphical_menu",
    EXPTR: 536882408 }

    Could this - Cube Badge be the source?
    no
    I did a dump() and the result is interesting:

    dump();
    Graphics.prototype.setFont8x16 = function () {this.setFontCustom(a,32,b,16)};
    var NAME = [
    "First Last",
    "Organisation"
    ];
    var cityscape = { "width": 128, "height": 16, "bpp": 1,
    "buffer": new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 2, 0, 0, 32, 0, 0, 4, 0, 0, 0, 0, 0, 252, 0, 128, 0, 7, 0, 0, 112, 0, 0, 4, 0, 0, 0, 0, 0, 252, 0, 128, 0, 7, 0, 0, 248, 0, 0, 12, 0, 0, 0, 0, 0, 252, 0, 128, 0, 7, 0, 0, 248, 0, 0, 12, 0, 0, 0, 7, 0, 252, 0, 128, 0, 7, 0, 0, 248, 0, 16, 12, 0, 0, 0, 7, 8, 252, 1, 192, 3, 199, 0, 0, 248, 0, 56, 12, 0, 0, 0, 7, 28, 252, 1, 192, 3, 199, 62, 0, 249, 224, 124, 12, 1, 224, 0, 7, 62, 255, 195, 224, 3, 199, 62, 0, 249, 224, 254, 13, 249, 224, 24, 31, 62, 255, 195, 224, 3, 199, 62, 0, 255, 224, 254, 13, 249, 224, 126, 31, 62, 255, 199, 247, 195, 199, 62, 62, 255, 224, 254, 13, 249, 225, 255, 159, 62, 255, 199, 247, 255, 199, 62, 62, 255, 248, 255, 205, 249, 227, 255, 223, 62, 255, 199, 255, 255, 199, 62, 62, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]).buffer
    };
    var ctlogo = { "width": 31, "height": 15, "bpp": 1,
    "buffer": new Uint8Array([7, 224, 15, 254, 48, 48, 0, 0, 143, 0, 63, 250, 97, 128, 5, 5, 0, 0, 10, 18, 0, 0, 20, 40, 0, 0, 40, 80, 0, 0, 80, 160, 0, 0, 161, 32, 0, 1, 65, 64, 0, 2, 130, 97, 128, 5, 2, 60, 0, 10, 3, 3, 24, 20, 1, 248, 48, 40, 0]).buffer
    };
    var n = 0;
    function draw() {?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255]}
    function onInit() {?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255] ?[255]}
    =undefined

    I opened the badge_original with notepad++ and I cannot see the issue at function draw() at L41 of the code. the issue is exactly the same in my badge_simple.js which has just a couple of graphical changes to center the displayed NAME.

  • Update: Problem partially solved! The "save" code at the end was the culprit, I commented it out and it seems to store the code on flash. Does the IDE have a setting for that?
    BUT: after saving, the BT link is gone. I cannot connect any more to the Pixl-multi, unless I erase the project code from it. Actually if I switch the device on (with the application code) while trying to connect, the communication link is visible for a couple seconds, then no more.

  • Does the IDE have a setting for that?

    If you look under Settings -> Communications -> save on send then you can choose how code is sent to the device.

    after saving, the BT link is gone

    That was part of the idea of the badge code so that other people can't hijack your badge :) The code that does it is down the bottom: https://github.com/dbovey/espruino/blob/­master/Badge_simple.js#L60

    Basically if you hold down a button for the first few seconds after boot (or if you're already connected) then the connection will stay up.

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

Trouble with Pixl+mukti

Posted by Avatar for DBovey @DBovey

Actions