• Sun 2020.03.29

    Fresh start. Power on MDBT42Q. Start WebIDE. Same code file where I left off.

    This is starting to appear to be a parsing issue, or when data chunks are sent to the MDBT42Q, they are not being received as they were sent. Now a new error appears:

    Uncaught SyntaxError: Got UNFINISHED STRING expected EOF
     at line 934 col 27
      console.log( "    " );  " );
    

    dump() shows that line L7 is there, fifth inside the help() function:

    function h() {help();}
    function help() {
      console.log( "    " );
      console.log( "    " );
      console.log( "Tutorial PPI - Programmable Peripheral Interconnect" );
      console.log( "    for the MDBT42Q Breakout board" );
      console.log( "    " );  " );
      console.log( "Single letter command line helper functions" );
      console.log( "    " );
      console.log( "    " );
      console.log( "  h()         help " );
    



    If one inspects around L730 in the source file, it can be seen the correct syntax is present. The dump is showing that [console.log( " ] is missing L8 from what was originally there.

    function h() { help(); }
    function help() {
      console.log( "    " );
      console.log( "    " );
      console.log( "Tutorial PPI - Programmable Peripheral Interconnect" );
      console.log( "    for the MDBT42Q Breakout board" );
      console.log( "    " );
      console.log( "    " );
      console.log( "Single letter command line helper functions" );
      console.log( "    " );
    

    When I attempt to view the console output:

    WebIDE :: Settings >> Console

    BT> Sending "\n// External button "
    BT> Sending "press sends one puls"
    BT> Sending "e\u001b\nswbp();\u001b\n\u001b\n\u001b\­n\u001b\n\u001b\n"
    BT> Sending "  // Sync flag with "
    BT> Sending "pin state\u001b\n  dp();\u001b\n"
    BT> Sending "  sync();\u001b\n  \u001b\n}\n\u0010\u001b["
    



    I note that data is sent by the WebIDE in small chunks. Presumeably the device sends back similar manageable small chunks in response to the dump() request. I've tried to capture the outbound file, but just not quick enough to open the console output, before it is pushed off the top.

    As we (viewers) see the errors within the WebIDE, and this device is wireless, it might be that Espruino running on the device detects an issue in memory, and then reports that to the WebIDE. This would mean that memory on the device is corrupt, and not a translation issue sending chars to the WebIDE that might become corrupt within the WebIDE memory space, during the transfer process.

    Does Espruino perform a checksum test on each line of chars that are sent over BT to validate what is received is what was sent? If yes, then this is more likely a parsing/re-assembly issue.

About

Avatar for Robin @Robin started