Use a rs485 communication module

Posted on
Page
of 2
Prev
/ 2
  • and yes @Gordon, it's a long text and it is exactly why i work with Espruino,

    . more ram
    . a better api for string manipulation (than arduino) = js,
    . a small form factor!
    . easy to program

    :)

  • :) The custom font is slower because Espruino has to unpack it from RAM - in Espruino things sometimes aren't stored in one block of memory to work around fragmentation - so for every access it has to check.

    When using the built-in font it's using very specific, fast code to access flash.

    Did you try the new firmware I linked? That should be a lot faster.

    Actually thinking about it, it seems that atob doesn't create a flat string when it could do.

    You might get faster rendering by doing:

    var font = E.toString(atob("AAAAAPoAwADAAFhw2HDQAGS­S/5JMAGCW+DzSDAxSolIMEsAAPEKBAIFCPABIMOA­wSAAQEHwQEAABBgAQEBAQAAIAAwwwwAB8ipKifAB­A/gBChoqSYgCEkrLSjAAYKEj+CADkoqKinAA8UpK­SDACAgI6wwABskpKSbABgkpKUeAAiAAEmABAoRAA­oKCgoKABEKBAAQIqQYAA8WqW9RDgOOMg4DgD+kpK­SbAB8goKCRAD+goJEOAD+kpKCAP6QkIAAfIKCklw­A/hAQEP4A/gAMAgIC/AD+EChEggD+AgICAP5AIED­+AP7AMAz+AHyCgoJ8AP6QkJBgAHyChoN8AP6QmJR­iAGSSkpJMAICA/oCAAPwCAgL8AOAYBhjgAPAOMA7­wAMYoECjGAMAgHiDAAI6SosIA/4EAwDAMAwCB/wB­AgEAAAQEBAQEBEn6SggQABCoqHgD+IiIcABwiIhQ­AHCIi/gAcKioYACB+oIAAGCUlPgD+ICAeAL4AAQG­+AP4IFCIA/AIAPiAeIB4APiAgHgAcIiIcAD8kJBg­AGCQkPwA+ECAgABIqKiQAIPwiADwCAjwAIBgGGCA­AOAYIBjgAIhQIFCIAIRkGGCAAJioyIgAQboEA5wC­BbhAAQIDAQIAAPFqlpUI8cPh8+HAAcDhwACBg/mA­gAAgM/gwIABA4fBAQABAQfDgQAHxERER8AHxE9CR­cAHxUbFR8AP58OBAAEDh8/gACAAIAAgB8fHx8fAD­+/gD+/gACilIiAgACIlKKA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BgY­GBgYGBgQEBAQGBgYGBgYGBgYGBgYGBgYFBQUFBQU­FBgYGBQUFBAQEBAYGBQUFBQUGBgUFBQUGBQY="))­;
    
      Graphics.prototype.setFontDennis8 = function() {
        this.setFontCustom(font, 32, widths, 8);
      };
    

    So basically Dennis8, but with E.toString around atob. I'd be interested to see what difference that makes?

    I'll make a note to improve atob - there's no reason it shouldn't use flat strings, which would be a lot faster and more efficient

  • @Gordon

    timing test

      t = getTime();
      g.setFontDennis8();
      g.drawString(texte,compteur,0);
      console.log("Draw took ",getTime()-t);
    

    1v92 FIRMWARE
    with custom font like setFontDennis8 : 0,244
    with custom font simplified : 0,239
    with custom font like setFontDennis8 + E.toString() : 0,154
    with custom font simplifed + E.toString() : 0,155

    1v92 CUSTOM FIRMWARE
    with custom font like setFontDennis8 : 0,106
    with custom font simplified : 0,106
    with custom font like setFontDennis8+ E.toString(atob) + : 0,094
    with custom font simplified + E.toString(): 0,094

    therefor best result with:
    . custom firmware
    . E.toString()
    . nothing more with simplified font (only usefull char design)

  • An other issue with the standart 1v92 firmware.
    with the quick setInterval() or serial1.write()
    i'm unable to upload code... upload stall at a point (variable). Have to unplug and plug pico board (1.4b) in bootloader mode and reinstall firmware.

    with your custom firmware it always upload to board
    huge update for me : plug/unplug usb board crash my old macbook Pro (17 mid 2009) -> 1 time/4 unplug :/

    thanks

    é.

  • Great! That's a definite improvement - and I'll see about trying to build the E.toString into atob.

    Very strange about your crash during upload though - I don't know what would have changed. If you're not doing 'save on send' then absolutely everything you do when you upload should get erased just by unplugging and replugging.

  • The crash is not an espruino issue, it's an usb issue, it produce too sometime with arduino...
    Last week i have to update firmware and install my code on 8 Picos.... I've got crashs (with automatic reboot and message) 4 time 😗. For simple and repetitive task, reboot had made it long and stressfull.

    For the upload problem, i don't know, i've discovered the reset() instruction and it seems to resolve the problem (when code use short setInterval()). You're probably right, i just change my process for upload with in first step, a reset(). Have to check

  • The Web IDE should do a reset() automatically before the upload (unless it was turned off in the options?), so I doubt that's you problem.

    However if you have a very short setInterval outside of a function then that would take effect immediately and could keep the Pico too busy to properly process new data?

  • Wow - this looks great!

    found some cheaper flip dots https://hannio.org/en/?s=FlipDot&post_ty­pe=product

    5x7 FlipDot controller + 5x 1x7 FlipDots for 40€ plus shipping

    to bad no controller on stock :(

  • I've bought it...😎
    I'm in vacation til mid august...
    I'll try when back home

  • Controller back in stock !!!

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

Use a rs485 communication module

Posted by Avatar for Mrbbp @Mrbbp

Actions