Avatar for lenxu

lenxu

Member since Jun 2024 • Last active Sep 2024
  • 1 conversations
  • 9 comments

Most recent activity

  • in ESP32
    Avatar for lenxu

    hi,

    Thank you for your reply, I succeeded! I studied the logic of dot matrix generation for fonts, mapped it accordingly, and compiled it into the Espruino project. By calling my own methods, I rendered it using a bitmap of the fonts. use API: g.drawImage

  • in ESP32
    Avatar for lenxu

    Dear Community Members,

    Greetings to you all! I am very grateful for the continuous help and support from the community.

    I am currently facing a dilemma that has troubled me for quite some time. I have a 128x64 pixel OLED display screen, and when attempting to render Japanese, Korean, and Chinese characters, I found that they cannot be displayed correctly. After some research, I consulted the relevant information on the Espruino official website: Fonts - Espruino, and understood that Espruino only supports ISO8859-1 and ISO10646-1/Unicode for character encoding.

    I also discovered that Bangle.js seems to have support for Unicode and UTF-8 encoding, as discussed in this thread: Notification language | Espruino. The post mentions that font libraries can be installed using

    g.setFontPBF(require("Storage").read("font.pbf"));.
    

    However, I encountered storage space limitations on the ESP32, as it only has 1MB of available space. To address this, I tried using an SD card and stored the font file (in pbf format) on it. But when I attempted to read the file with

    fs.readFileSync("font.pbf")
    

    , it caused a memory overflow, and the g.setFontPBF function does not support pipeline transmission either.

    As a result, I am currently unsure how to load pbf or bdf font files into the ESP32 to render Japanese, Korean, and Chinese characters. I am eager to receive assistance—whether there are any examples or documentation that could guide me through rendering these characters on the ESP32.

    My proficiency in English is not high, and if there is any ambiguity in my expression, I ask for your understanding.

    Lastly, I would like to express my love and appreciation for the Espruino community.

  • in ESP32
    Avatar for lenxu

    @Gordon It's truly wonderful, and I sincerely appreciate your kindness.

  • in ESP32
    Avatar for lenxu

    Additionally, I've encountered an issue when using the fs module. Specifically, when I call the fs.appendFileSync(filename, data); method and I repeatedly execute this code block within a setInterval function, I'm experiencing issues with missing or inconsistent file writes. Could you please assist me in resolving this when you have the time?

    function downloadData(filename) {
      require('http').get("http://xxx.com/pic/"+filename, function(res) {
        var i = 0;
        res.on('data', function(data) {
          i+=1;
          console.log('download:' + filename + " chunk =>" + i + '...');
          fs.appendFileSync(filename, data);
        });
        res.on('close', function(data) {
          console.log("Connection closed");
          console.log(fs.readdirSync());
        });
      });
    }
    
  • in ESP32
    Avatar for lenxu

    I finally solved this problem by using an external pull-up resistor at the physical level, and the software should be written like this.

     setWatch(callback, pin, {
            edge: (-1),
            repeat: true,
            debounce: 50
      });
    
  • in ESP32
    Avatar for lenxu

    I solved this problem because I was using a 360° servo, and its principle is different from that of a 180° servo. Therefore, the library is different. For a 360° servo, it should be written like this.

    function servo_360 (pin, speed) {
      if ( 0.5 <= speed <= 2.5) {
          console.log(speed);
          analogWrite(pin, speed / 50.0, {freq:20});
      } else {
          analogWrite(pin, 0, {freq:20}); // stop
      }
    }
    
  • in ESP32
    Avatar for lenxu

    Hello everyone, I've also encountered this dilemma. But my solution is to use the additional partitioning method from http://www.espruino.com/Reference#l_E_flashFatFS. By accessing https://www.espruino.com/ESP32#flash-map-and-access and using fs.writeFileSync to resolve the issue, but the problem is that this method makes the storage unusable. I hope to be able to use the additional flash memory together with the storage.

  • in ESP32
    Avatar for lenxu

    I've encountered the same riddle, but it seems my superpower of solving it is still in the mail.

  • in ESP32
    Avatar for lenxu

    I'm experiencing the same problem that we've encountered in the past.

    Guru Meditation Error: Core 0 panic'ed (LoadStoreError). Exception was unhandled.
    Core 0 register dump:
    PC : 0x40096496 PS : 0x00060033 A0 : 0x80095afc A1 : 0x3ffbed30
    A2 : 0x40086144 A3 : 0x0000cdcd A4 : 0x00060023 A5 : 0x00000001
    A6 : 0xb33fffff A7 : 0x00000036 A8 : 0x0000abab A9 : 0x0000cdcd
    A10 : 0x00000002 A11 : 0x3ffea490 A12 : 0x00000000 A13 : 0x3ffea480
    A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000012 EXCCAUSE: 0x00000003
    EXCVADDR: 0x40086144 LBEG : 0x400924b4 LEND : 0x400924d0 LCOUNT : 0x00000000
    Core 0 was running in ISR context:
    EPC1 : 0x40096496 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x00000000
    ELF file SHA256: 0000000000000000
    Backtrace: 0x40096493:0x3ffbed30 0x40095af9:0x3ffbed60 0x400819a6:0x3ffbed90 0x4008593a:0x3ffbedb0 0x40085835:0x3ffbede0 0x40085d29:0x3ffbee00 0x400860f5:0x3ffbee30 0x40126507:0x3ffea460 0x40134634:0x3ffea480

Actions