Shop OBEX P1 Docs P2 Docs Learn Events
A Propeller-WebTool Framework for Compiled Languages? - Page 12 — Parallax Forums

A Propeller-WebTool Framework for Compiled Languages?

191012141521

Comments

  • Heater.Heater. Posts: 21,230
    edited 2014-02-12 22:51
    Thank's Cluso.

    Problem is the pesky loader protocol the Prop uses. It's not a nice simple network friendly protocol.

    I'm not sure what others are up to regarding this problem. For me, I will be looking at programming Props via the normal serial Protocol from the Web page as is possible with Chrome Apps.
  • jazzedjazzed Posts: 11,803
    edited 2014-02-12 23:37
    David Betz has a loader that can be used with the Digi XBee S6B Wifi module. At the moment it is limited to small programs because of some packet issues in the S6B. What I like about it is that theoretically up to 28KB or so of program space can be loaded - some buffer space is needed for packet data.

    As it is barring a breakthrough with Digi, chopping the binary into several packet chunks might be a way to go. I guess a question in that respect is: "can we use javascript to break a binary down into smaller packets?"

    Another alternative is to just write a file to SD card or upper EEPROM and boot from that.
  • Heater.Heater. Posts: 21,230
    edited 2014-02-13 00:13
    Jazzed,
    can we use javascript to break a binary down into smaller packets?
    Yep.

    There is no problem dicing and slicing arrays of bytes in JS. Despite the fact that JS uses floats for all it's numbers modern JS has the concept of "typed arrays". Any old blob of data is an "ArrayBuffer" and such a buffer can be used as the underlying buffer for typed arrays : UInt8Array, UInt16Array and so on.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays

    On the other hand if we already have such a loader written in C it can be adapted to dice it's packets and that code can be converted to JS with Enscripten.

    How we actually talk to a wifi module from the browser is beyond me just now.
  • jazzedjazzed Posts: 11,803
    edited 2014-02-13 01:05
    Heater. wrote: »
    How we actually talk to a wifi module from the browser is beyond me just now.
    The loader is an HTML server.

    IIRC, Mozilla has some special binary packing not found in other browsers. ASCII-HEX is ok too, but that means more work for the loader.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-13 12:28
    So I took @Heater.'s advice and restart the webworker every time I need to run OpenSpin.

    Now it compiles without errors. :-)

    The editor will locate Library files and load them, then rerun OpenSpin.

    If you open a filename ending with '/' (aka directory) the editor will fetch the html and extract the filenames. The server providing the files need to have directory browsing enabled to do that.

    you can compile to binary or eeprom.

    I added the MIT license to the editor.

    Enjoy!

    Mike
  • jazzedjazzed Posts: 11,803
    edited 2014-02-13 13:22
    Sounds great.

    Any chance we will ever be able to run this from a localhost directory without a web server?

    Thanks.
    msrobots wrote: »
    So I took @Heater.'s advice and restart the webworker every time I need to run OpenSpin.

    Now it compiles without errors. :-)

    The editor will locate Library files and load them, then rerun OpenSpin.

    If you open a filename ending with '/' (aka directory) the editor will fetch the html and extract the filenames. The server providing the files need to have directory browsing enabled to do that.

    you can compile to binary or eeprom.

    I added the MIT license to the editor.

    Enjoy!

    Mike
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-13 13:30
    You can already.

    Just unzip to your local hard drive and open Editor8.htm In your Browser.

    Saving and loading requires a webserver for the files to be loaded (GET) or saved (PUT).

    So if you type http://parallax.msrobots.net/Library/_Demos/4x4 keypad Reader DEMO.spin into the textbox and hit load (GET) you can open the file.
    Then hit compile and see the wonders...

    Enjoy!

    Mike
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-13 15:19
    If you are OK with a Windows only solution you can use the 'Scripting.FileSystemObject' to access files local to the Browsers computer. But this will not work on Linux/Mac.

    For security reasons JavaScript in the Browser does not have access to the local FileSystem of the computer the browser runs on.

    If you do not want to setup a local server then you could use a spinneret with the msrobots branch of the firmware as File Server for the Editor...

    Enjoy

    Mike
  • jazzedjazzed Posts: 11,803
    edited 2014-02-13 15:29
    I tried loading files saved on Google Drive. No joy.

    Looks like we may need to use a localhost simple server for regular folks or use some kind of a cloud account.

    Did you try the empty line regex to color those blank lines? I.E. RegExp("^$");

    That alert message is a wee bit annoying :) Seems it should only popup if there is an error. No big deal for now I guess.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-13 17:00
    The server providing the files has to support cross origin requests if the editor is not loaded from the same domain.

    Yes about the alert thing. It is just there for debugging to show me if it came to an end or just hung.

    I have not really a handle on RegEx, just modifying Phil's code. Tried your suggestion different ways. Did not work.

    Here the current spin.js function, the tokenizer for spin. Maybe somebody understand this better than me.
     CodeMirror.defineMode("spin", function() {
       
      function qwRegExp() {
       var args = Array.prototype.slice.call(arguments);
       var qw = args.join(' ').replace(/([\^\$\.\+\-\?\=\!\:\\\/\(\)\[\]\{\}\*\|])/g, '\\$1');
       return new RegExp("^((" + qw.split(/\s+/).join(")|(") + "))\\b", "i");
      }
      
      function qmRegExp() {
       var args = Array.prototype.slice.call(arguments);
       var qm = args.join(' ').replace(/([\^\$\.\+\-\?\=\!\:\\\/\(\)\[\]\{\}\*\|])/g, '\\$1');
       return new RegExp("^((" + qm.split(/\s+/).join(")|(") + "))", "i");
      }
      
      function qsRegExp() {
       var args = Array.prototype.slice.call(arguments);
       var qs = args.join(' ').replace(/([\^\$\.\+\-\?\=\!\:\\\/\(\)\[\]\{\}\*\|])/g, '\\$1');
       return new RegExp("^[" + qs.replace(/\s/g, '') + "]", "i");
      }
     
         var lex = {
          singleOperators: '= + - * / ~ ? & | ^ ! < > @ # :',
          doubleOperators: ':= -- ++ ** // #> <# ^^ || ~~ ~> |< >| << >> <- -> >< == <> =< => += -= *= /= &= |= ^= <= >=',
             tripleOperators: '//= >>= <<= **=',
          wordOperators: 'and or not',
          sectionHeaders: 'con dat obj pri pub var',
          dataTypes: 'byte word long',
          spinKeywords: 'abort bytefill bytemove case chipver cognew constant else elseif'
           + ' from if longfill longmove lookdown lookdownz lookup lookupz next other quit repeat result'
           + ' return spr strcomp string strsize until wordfill wordmove _clkfreq _clkmode _free _stack'
           + ' _xinfreq',
          commonKeywords: 'cnt cogid coginit cogstop ctra ctrb dira dirb false float frqa'
           + ' frqb ina inb lockclr locknew lockret lockset outa outb par phsa phsb pi round true trunc'
           + ' vcfg vscl waitcnt waitpeq waitpne waitvid while xinput xtal1 xtal2 xtal3 pll1x pll2x pll4x'
           + ' pll8x pll16x posx negx pi rcfast rcslow',
          pasmKeywords: 'abs absneg add addabs adds addsx addx andn call clkset cmp'
           + ' cmps cmpsub cmpsx cmpx cnt cogid coginit cogstop djnz enc fit hubop if_a if_ae'
           + ' if_always if_b if_be if_c if_c_and_nz if_c_and_z if_c_eq_z if_c_ne_z if_c_or_nz'
           + ' if_c_or_z if_e if_nc if_nc_and_nz if_nc_and_z if_nc_or_nz if_nc_or_z if_ne if_never'
           + ' if_nz if_nz_and_c if_nz_and_nc if_nz_or_c if_nz_or_nc if_z if_z_and_c if_z_and_nc'
           + ' if_z_eq_c if_z_ne_c if_z_or_c if_z_or_nc ina inb jmp jmpret max maxs min mins mov'
           + ' movd movi movs mul muls muxc muxnc muxnz muxz neg negc negnc negnz negz nop nr'
           + ' org  rcl rcr rdbyte rdlong rdword res ret rev rol ror sar shl shr sub subabs subs'
           + ' subsx subx sumc sumnc sumnz sumz test tjnz tjz true vcfg vscl wc wr wrbyte wrlong'
           + ' wrword wz xor'
         }
      var identifiers = new RegExp("^[_:A-Za-z][_A-Za-z0-9]*");
      var singleOperators = qsRegExp(lex.singleOperators);
      var doubleOperators = qmRegExp(lex.doubleOperators);
      var tripleOperators = qmRegExp(lex.tripleOperators);
      var wordOperators = qwRegExp(lex.wordOperators);
      var sectionHeaders = qwRegExp(lex.sectionHeaders);
      var spinKeywords = qwRegExp(lex.spinKeywords, lex.commonKeywords, lex.dataTypes);
      var spinErrors = qwRegExp(lex.pasmKeywords);
      var pasmKeywords = qwRegExp(lex.pasmKeywords, lex.commonKeywords, lex.dataTypes, 'and or');
      var pasmErrors = qwRegExp(lex.spinKeywords);
      var keywords = spinKeywords;
      var errors = spinErrors;
      
      // tokenizers
      function tokenLexer(stream, state) {
       var matched;
    //   if (stream.match(/^\$/)) { 
    //       return 'normal';
    //   }
       if (stream.match(/^\{\{/)) {
        state.superComment++;
        return 'doccomment';
       }
       if (stream.match(/^\}\}/)) {
        if (state.superComment) {
         state.superComment--;
         return 'doccomment';
        } else {
         return 'error';
        }
       }
       if (state.superComment) {
        if (state.bold) {
         if (stream.match(/^\W/)) {
          state.bold = false;
          return 'doccomment'
         } else {
          stream.next();
          return 'boldcomment'
         }
        }
        if (stream.match(/^`/)) {
         state.bold = true;
        } else {
         stream.next();
        }
        return 'doccomment';
       }
       if (stream.match(/^\{/)) {
        state.nestedComment++;
        return 'codecomment';
       }
       if (stream.match(/^\}/)) {
        if (state.nestedComment) {
         state.nestedComment--;
         return 'codecomment';
        } else {
         return 'error';
        }
       }
       if (state.nestedComment) {
        stream.next();
        return 'codecomment';
       }
       if (stream.match(/^"/)) {
        if (!(stream.skipTo('"') && stream.next())) {
         stream.skipToEnd();
        }
        return 'string';
       }
       if (stream.match(/^''/)) {
        stream.skipToEnd();
         return 'doccomment';
       }
       if (stream.match(/^'/)) {
        stream.skipToEnd();
         return 'codecomment';
       }
       if (stream.match(sectionHeaders, false)) {
        var sol = stream.sol();
        matched = stream.match(sectionHeaders);
        if (!sol) {
         state.section = 'con';
         state.alternatebg = '-1';
         return 'error';
        }
        var newsection = matched[0].toLowerCase(); 
        if (state.section == newsection)
        {
            if (state.alternatebg === '-1') {
                state.alternatebg = '-2';
            } else{
                state.alternatebg = '-1';
            }
        } else {
               state.alternatebg = '-1';
        }    
        state.section = newsection;
        return 'keyword';
       }
       if (state.section === 'dat') {
        if (stream.match(/^\$(?=(\W|$))/i)) return 'keyword';
        keywords = pasmKeywords; errors = pasmErrors;
       } else {
        keywords = spinKeywords; errors = spinErrors;
       }
       if (stream.match(keywords)) {
        return 'keyword';
       }
       if (stream.match(errors)) {
        return 'error';
             }
       if (stream.match(wordOperators)) {
        return 'operator';
       }
             if (stream.match(/^[+-\.]*[$%\d]/, false)) {
              stream.match(/^[+-]?\d[\d_]*(\.\d[\d_]*(e[\+\-]?\d[\d_]*)?)?/i) 
              || stream.match(/^[+-]?\$[\da-f][\da-f_]*/i)
              || stream.match(/^[+-]?%[01][01_]*/)
              || stream.match(/^[+-]?%%[0-3][0-3_]*/)
                    if (stream.match(/^,+/)) {
                       // this ensures that , is not returned as a number or error. (@Heater.)
                       return 'keyword'     // I think keyword will do (@MSrobots)
                    } else if (stream.match(/^[\da-f$%\._]+/)) {
                        return 'error';
                    } else {
                        return 'number';
                    }
       }
       if (stream.match(tripleOperators) || stream.match(doubleOperators) || stream.match(singleOperators)) {
        return 'operator';
       }
       stream.match(identifiers) || stream.next(); 
       return 'normal';
      }
      
      return {
       startState: function(base) {
        return {
          nestedComment: 0,
          superComment: 0,
          bold: false,
          section: 'con',
          alternatebg: '-1' // this will be used to alternate BG colors in sections
         };
       },
       
       token: function(stream, state) {
        if (stream.eatSpace()) state.bold = false;
        var type = tokenLexer(stream, state);
        // now prefix type with section ... Example: 'normal' becomes 'dat-normal'
        // and add style for line background to it. Note: the style used will NOT be prefixed by 'line-background'.
        // Now depending on section and alternatebg this will select a style like 'cm-bg-dat-1' or 'cm-bg-dat-2' as
        // style for the background of the complete line depending on section.
        return state.section + '-' + type + ' line-background-cm-bg-' + state.section + state.alternatebg; 
       },
       
       fold: "indent" 
      };
     });
     
     CodeMirror.defineMIME("text/x-spin", "spin");
    
    

    if you scroll down to function function tokenLexer(stream, state) you will see that I just intend to return 'normal' if empty line found...

    I have commented out my last try.


    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-02-20 11:50
    I had to change my free host name for the openspin.js web IDE experiment, the old host name has been broken for some days now:

    http://the.linuxd.org:3000
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 02:17
    So I finally found out what the problem is with those empty background lines in CodeMirror.

    The tokenizer can not put a style there because it does not get empty lines. So I needed to do a small change in the CodeMirror.js.

    Editor9 can now display a correct spin mode with background colors !!

    I also changed the foreground colors accordingly - looks almost like the PropTool now.

    Since I was deep in CSS and JavaScript anyways I decided to restyle the Editor to look more like the PropTool.

    I also added some goodies ...

    - you can now upload a local file from your computer into a new Editor Tab. This will take care of encoding.
    - you can even drag and drop a file into the Editor Tab. This will not take care of the encoding, so sometimes not successful.
    - you can download any open Editor tab to your local file system.
    - you can compile any open Editor Tab to binary or eeprom.
    - objects used by the main spin file will be loaded from the parallax library (currently at http://parallax.msrobots.net/Library/) if there or need to be opened in a own tab to be successful compiled.
    - this uses a search path. first the open Tabs, then the same place the file you want to compile comes from then same server /Library/ then http://parallax.msrobots.net/Library.
    - you can download the result file (aka xxx.binary or xxx.eeprom) to your local file system.

    I was also able to gain some space in my spinneret firmware and included Mike G's variation of Chips PropLoader.
    If I get this working (tomorrow?) I MAY be able to program another Propeller from the spinneret..

    What I would like to know is what the status of that WIFI loader is, mentioned here a while ago.
    In some other thread I read that there is now a solution to load full 32kb.
    And it was supposed to be some sort of webserver/webservice?
    Any description available?

    It would be nice if I could integrate access that loader into the editor. I have a binary/eeprom file as array and may be able to send that in chunks to the loader...

    I have attached the current version of the editor.

    If you use IE you can run it from your local file system. Chrome does not allow this for security reasons. (there is some commandline switch - google)

    Else you need to run this from some webserver. Remember: This is just html and JavaScript....

    Maybe @Heater. can update the editor on his website, or allow me to do it... - I see Editor5.htm already gone... so I can't update...

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-02-23 03:06
    msrobots,
    The tokenizer can not put a style there because it does not get empty lines
    Ha ha. That would do it. sounds like a great piece of detective work on your part.

    I was wanting to put Editor5 back up on my server but too many things got in the way. Hopefully I can get your latest version up soon. I'm itching to see how it looks.

    Any chance of having your code Mirror and Spin mode stuff as normal separate js files as per the CodeMirror distribution?
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 03:21
    yes. I was fighting regEx with no avail. Wrong place.

    I also met your codepage/encoding problems. But seem to have found a way around. At least everything compiles without :bit problem.

    MAY post spin.js spin.css and codemirror.js as separate files tomorrow. But you can extract them by yourself out of editor9. just open in itself and start folding it together until you see what you need...

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-02-23 03:38
    msrobots,

    I can hack the thing out again. But what I'm thinking is that your CodeMirror tweaks should be fed back to the CodeMirror authors. That way it's possible that CodeMirror could one day support Spin out of the box. That would be best done my creating a patch against the original pristine CodeMirror sources.

    That's great news re: the ":bit" problem. What on Earth was that? I'll have to study what you have done.
  • fridafrida Posts: 155
    edited 2014-02-23 05:33
    - you can download the result file (aka xxx.binary or xxx.eeprom) to your local file system.

    Yes, but I only get 0 bytes in the files. what to do?
  • jazzedjazzed Posts: 11,803
    edited 2014-02-23 08:57
    Congrats on your progress!
    msrobots wrote: »
    What I would like to know is what the status of that WIFI loader is, mentioned here a while ago. In some other thread I read that there is now a solution to load full 32kb. And it was supposed to be some sort of webserver/webservice? Any description available?
    There are 2 projects that I know of. David Betz has a framework for loading programs with the Propeller running a server, but it is limited at the moment. Jeff Martin was able to use a "Transparent Serial Mode" Wifi connection working using the Propeller's native load protocol to load RAM from an iPhone. There are still challenges, so Jeff's solution is still a work in progress.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 12:26
    @Frida
    Yes, but I only get 0 bytes in the files. what to do?

    not sure about this. But you are right. downloaded 28 bytes neu9.binary. size 28 bytes. size on disk 0 bytes.

    If you open the binary file in proptool you will see it has 28 bytes. (windows again?)

    try the same with eeprom file and size on disk is OK.

    try the same with bigger spin file as binary and size on disk also OK.

    windows again?

    Enjoy!

    Mike
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-23 12:59
    jazzed wrote: »
    Congrats on your progress!

    There are 2 projects that I know of. David Betz has a framework for loading programs with the Propeller running a server, but it is limited at the moment. Jeff Martin was able to use a "Transparent Serial Mode" Wifi connection working using the Propeller's native load protocol to load RAM from an iPhone. There are still challenges, so Jeff's solution is still a work in progress.
    The problem is that the Xbee has a limited input buffer so you have to pace data being sent to it to avoid overflowing the buffer. This can be done if you're using a hand-crafted program running on the sending device. I think Jeff is probably using a TechBasic program. Steve and I were trying to use HTTP initiated from a browser and that makes pacing the data harder.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 16:05
    Well I do have the data In a browser already. Inside of a javascript arraybuffer.

    I can send chunks of any size in any pace. How do you do it now? Any source as example?

    This would be very nice.

    Enjoy!

    Mike
  • David BetzDavid Betz Posts: 14,516
    edited 2014-02-23 16:22
    msrobots wrote: »
    Well I do have the data In a browser already. Inside of a javascript arraybuffer.

    I can send chunks of any size in any pace. How do you do it now? Any source as example?

    This would be very nice.

    Enjoy!

    Mike
    I haven't been able to find out exactly how they did it in the "Open Propeller Project #1" thread. They haven't replied to my questions in their thread or through email. I'm particularly wondering how they are able to fill all 32k of hub memory. I suspect they are running some PASM code in a COG that listens to data from the Xbee and writes it directly to hub memory.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 17:00
    So IE can open the Editor from the local file system, but chrome doesn't. Not allowed to load webworker from local file system.

    But there is a commandline switch for chrome: --allow-file-access-from-files

    You need to close all chrome windows and start chrome from commandline with chrome --allow-file-access-from-files

    Then Chrome will run the Editor (and its webworker) from local file system without webserver.

    Funny thing is that now all XMLhttp GET requests also work on local files. This is even better then what IE does.

    now you can open a file with GET using the local filename. And while compiling the Editor finds all needed files...

    I need to play with this a bit. This allows to use the editor complete offline without webserver if you provide the Parallax Library at /Library/. Interesting at least.
    But cumbersome to handle by now. And just runs on Chrome like that.

    IE runs the Editor from local but can NOT use XMLhttp GET for local files.

    If the Editor is run off a webserver IE and Chrome both work w/o problems. (and w/o command line switch).

    Any tests on linux/mac/phones? (I own none of them..)

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-02-23 17:05
    msrobots,
    Any tests on linux/mac/phones? (I own none of them..)
    No luck with my Android phone. But it is an old original Samsung Galaxy.

    On Friday I got a friend of mine to run openspin on his iPhone. Worked just fine. Pretty quickly to.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-23 22:32
    Hi Heater.

    first of all - the :bit thing. It is all a problem of encoding.
    your ab2str and str2ab are perfectly fine for transport between webworker and main process. But you hardcoded utf-16. Fine between webworker and main process.
    alas you can not assume that all data looks like this.

    -when loading a Editor with a GET request using XMLhttp I do NOT do anything about encoding, just something like: editors[current].setValue(xhr.responseText);
    -when uploading a file to the Editor the same. I do NOT enforce any encoding. just something like: reader.readAsText(files)
    -when loading a needed file (GET) to put it into the webworker file system I do the same as loading into the editor. NOTHING. Do not touch encoding.

    I tried. For hours.
    readAsText(files,'UTF-8') or 16, Unicode, whatever - just leave it alone. Somebody Else Problem. Honestly. Let JavaScript handle this by itself.

    As long as you do NOT enforce any encoding everything works fine.

    Funny.

    As always it is all your fault. You complained in some other thread that we have not the skills in html,css and javascript to pull this off.

    Hm. Moment. Its Jazzed's fault, because he challenged you, somehow... and you tricked me into it...

    whatever - I have some more goodies soon...

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-02-23 23:43
    msrobots,
    Thanks for the explanation of how you don't mess with encoding and it all comes out right.

    There is only one problem: In my latest version I don't mess with encoding either!

    Like you I decided to go back to basics and remove all that string to binary and vs versa stuff. And any encoding specifications. Just to see what happened.

    I suspect there is a need for the server to specify an encoding in an http header when it delivers the file. Which I don't think mine does.

    Yes: Let's blame Jazzed. (He's not here just now:)) It was his challenge in the first place.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-02-24 12:49
    Well the http header are a good guess.

    My windows webserverer deliveres them and the spinneret also. I guess the Filesystem provides this for a file upload also.

    Maybe you need to add headers to your node.server...

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-03-02 09:25
    msrobots,

    I just put my openspin effort back up on line http://the.linuxd.org:3000/

    I took the liberty of linking to your Editor9.htm from that page. They are both running off the same little node.js server now.

    That front page has fullDuplexSerial4port.spin loaded into the editor. As you know when we compile that it fails with that unkown ":bit" symbol error.

    BUT when I load fullDuplexSerial4port.spin into Editor9 things go very weird.

    The editor is loaded with fullDuplexSerial4port.spin but when I hit compile the green screen appears and the things goes into and endless loop! Like so:
    2014-03-02 19:11:38 . execute Openspin -b fullDuplexSerial4port.spin...
    2014-03-02 19:11:39 w Worker started - consoleID: 1
    2014-03-02 19:11:40 w OpenSpin run time env. created.
    2014-03-02 19:11:40 . init_openspin_done - now adding files...
    2014-03-02 19:11:40 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:40 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:40 w Running openspin main
    2014-03-02 19:11:40 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-02 19:11:40 + Compiled on Feb 21 2014
    2014-03-02 19:11:40 + Compiling...
    2014-03-02 19:11:40 + fullDuplexSerial4port.spin
    2014-03-02 19:11:41 + fullDuplexSerial4port.spin : error : Can not find/open file.
    2014-03-02 19:11:41 w Finished openspin main.
    2014-03-02 19:11:41 . call_openspin_done - now retrieving result...
    2014-03-02 19:11:41 . Missing file: fullDuplexSerial4port.spin
    2014-03-02 19:11:41 . Try to GET /project/fullDuplexSerial4port.spin - Result: OK
    2014-03-02 19:11:41 . Worker terminated itself correctly.
    2014-03-02 19:11:41 . execute Openspin -b fullDuplexSerial4port.spin...
    2014-03-02 19:11:42 w Worker started - consoleID: 1
    2014-03-02 19:11:43 w OpenSpin run time env. created.
    2014-03-02 19:11:43 . init_openspin_done - now adding files...
    2014-03-02 19:11:43 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:43 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:43 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:43 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:43 w Running openspin main
    2014-03-02 19:11:44 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-02 19:11:44 + Compiled on Feb 21 2014
    2014-03-02 19:11:44 + Compiling...
    2014-03-02 19:11:44 + fullDuplexSerial4port.spin
    2014-03-02 19:11:44 + fullDuplexSerial4port.spin : error : Can not find/open file.
    2014-03-02 19:11:44 w Finished openspin main.
    2014-03-02 19:11:44 . call_openspin_done - now retrieving result...
    2014-03-02 19:11:45 . Missing file: fullDuplexSerial4port.spin
    2014-03-02 19:11:45 . Try to GET /project/fullDuplexSerial4port.spin - Result: OK
    2014-03-02 19:11:45 . Worker terminated itself correctly.
    2014-03-02 19:11:45 . execute Openspin -b fullDuplexSerial4port.spin...
    2014-03-02 19:11:45 w Worker started - consoleID: 1
    2014-03-02 19:11:46 w OpenSpin run time env. created.
    2014-03-02 19:11:46 . init_openspin_done - now adding files...
    2014-03-02 19:11:46 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:47 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:47 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:47 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:47 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:47 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:48 w Running openspin main
    2014-03-02 19:11:48 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-02 19:11:48 + Compiled on Feb 21 2014
    2014-03-02 19:11:48 + Compiling...
    2014-03-02 19:11:48 + fullDuplexSerial4port.spin
    2014-03-02 19:11:48 + fullDuplexSerial4port.spin : error : Can not find/open file.
    2014-03-02 19:11:48 w Finished openspin main.
    2014-03-02 19:11:48 . call_openspin_done - now retrieving result...
    2014-03-02 19:11:48 . Missing file: fullDuplexSerial4port.spin
    2014-03-02 19:11:49 . Try to GET /project/fullDuplexSerial4port.spin - Result: OK
    2014-03-02 19:11:49 . Worker terminated itself correctly.
    2014-03-02 19:11:49 . execute Openspin -b fullDuplexSerial4port.spin...
    2014-03-02 19:11:49 w Worker started - consoleID: 1
    2014-03-02 19:11:50 w OpenSpin run time env. created.
    2014-03-02 19:11:50 . init_openspin_done - now adding files...
    2014-03-02 19:11:51 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:51 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:51 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:51 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:52 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:52 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:52 w Writing fullDuplexSerial4port.spin to MemFS.
    2014-03-02 19:11:52 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-02 19:11:52 w Running openspin main
    2014-03-02 19:11:52 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-02 19:11:52 + Compiled on Feb 21 2014
    2014-03-02 19:11:53 + Compiling...
    2014-03-02 19:11:53 + fullDuplexSerial4port.spin
    2014-03-02 19:11:53 + fullDuplexSerial4port.spin : error : Can not find/open file.
    2014-03-02 19:11:53 w Finished openspin main.
    2014-03-02 19:11:53 . call_openspin_done - now retrieving result...
    2014-03-02 19:11:53 . Missing file: fullDuplexSerial4port.spin
    2014-03-02 19:11:53 . Try to GET /project/fullDuplexSerial4port.spin - Result: OK
    2014-03-02 19:11:53 . Worker terminated itself correctly.
    2014-03-02 19:11:53 . execute Openspin -b fullDuplexSerial4port.spin...
    2014-03-02 19:11:54 w Worker started - consoleID: 1
    2014-03-02 19:11:55 w OpenSpin run time env. created.
    

    Now admittedly I had to make a couple of little changes to get Editor9 to play with my server.

    Basically spin files are served up from "/project" or "/library" urls. So I fixed up the Editor9 ajax requests to fetch files from there. As far as I can tell it does actually get the files correctly.

    If I load the little "test.spin" Editor9 compiles it just fine. You can try it. test.spin is in the /project/ url and it includes a subobject from "/library/".

    You should be able to create new files and upload them to that server with your PUT menu items. But I have write protected the files: dataIO4port.spin demo1_FDS4port.spin demo2_FDS4port.spin fullDuplexSerial4port.spin temp1.spin and test.spin on there so you need to use different names for anything new.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-03-02 16:57
    I had some time this weekend to work on the editor.

    It has now some more features of PropTool. You can list all Library files and all Demo Files, open and compile them.

    @Heater. Not sure about this problem you have. It looks like it is not able to write the file to MemFS.

    I attached Editor10 and will install the editor for testing on my website.

    And here a link to a working Editor10 http://parallax.msrobots.net/Editor10.htm

    Enjoy!

    Mike
  • Heater.Heater. Posts: 21,230
    edited 2014-03-02 18:32
    msronots,

    Cool.

    If I paste fullduplexSerial4Port into Edito10 there is the same problem with "RangeError: Maximum call stack size exceeded";
    2014-03-03 04:22:12 . execute Openspin -b noname1.spin...
    2014-03-03 04:22:17 w Worker started - consoleID: 2
    2014-03-03 04:22:18 w OpenSpin run time env. created.
    2014-03-03 04:22:18 . init_openspin_done - now adding files...
    2014-03-03 04:22:18 w Writing noname1.spin to MemFS.
    2014-03-03 04:22:18 w Exception put_file: RangeError: Maximum call stack size exceeded
    2014-03-03 04:22:18 w Running openspin main
    2014-03-03 04:22:18 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-03 04:22:18 + Compiled on Feb 11 2014
    2014-03-03 04:22:19 + Compiling...
    2014-03-03 04:22:19 + noname1.spin
    2014-03-03 04:22:19 + noname1.spin : error : Can not find/open file.
    2014-03-03 04:22:19 w Finished openspin main.
    2014-03-03 04:22:19 . call_openspin_done - now retrieving result...
    2014-03-03 04:22:19 . Missing file: noname1.spin
    2014-03-03 04:22:19 . Try to GET noname1.spin - Result: Not Found
    2014-03-03 04:22:19 . Try to GET Library/noname1.spin - Result: Not Found
    2014-03-03 04:22:19 . Try to GET http://www.parallax.msrobots.net/Library/noname1.spin - Result: Not Found
    2014-03-03 04:22:20 w Reading noname1.binary from MemFS.
    2014-03-03 04:22:20 w No such file.
    2014-03-03 04:22:20 . Result file size 0 bytes.
    2014-03-03 04:22:20 . Worker terminated itself correctly.
    

    The only time I ever see that error in JS is when I have goofed up and made recursive calls that run to deeply. I can't see how that can happen here.

    If I brutally delete half the code then it loads to the worker OK so it seems to be a file size issue.

    Sadly I don't have much time to play with this until next weekend.
  • msrobotsmsrobots Posts: 3,709
    edited 2014-03-02 19:00
    Hm.

    I just did the same and pasted FullDuplexSerial4portPlus.spin into the editor10 on my website. Compiles w/o issue.

    Is your file corrupt?
    2014-03-02 18:56:15 . execute Openspin -b noname0.spin...
    2014-03-02 18:56:16 w Worker started - consoleID: 1
    2014-03-02 18:56:16 w OpenSpin run time env. created.
    2014-03-02 18:56:17 . init_openspin_done - now adding files...
    2014-03-02 18:56:17 w Writing noname0.spin to MemFS.
    2014-03-02 18:56:17 w Running openspin main
    2014-03-02 18:56:17 + Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    2014-03-02 18:56:18 + Compiled on Feb 11 2014
    2014-03-02 18:56:18 + Compiling...
    2014-03-02 18:56:18 + noname0.spin
    2014-03-02 18:56:29 + Done.
    2014-03-02 18:56:29 + Program size is 2804 bytes
    2014-03-02 18:56:30 w Finished openspin main.
    2014-03-02 18:56:30 . call_openspin_done - now retrieving result...
    2014-03-02 18:56:30 w Reading noname0.binary from MemFS.
    2014-03-02 18:56:30 . Result file size 2804 bytes.
    2014-03-02 18:56:31 . Worker terminated itself correctly.
    
    Enjoy!

    Mike
Sign In or Register to comment.