Avatar for user111618

user111618

Member since Apr 2020 • Last active Aug 2020
  • 2 conversations
  • 17 comments

Most recent activity

  • in ESP8266
    Avatar for user111618

    And I had searched on the web, they said i2s can generate 38khz PWM signal, but I don't know how to write the code in Espruino, so if you know how to do with this, please teach me about it, thank you very much.

  • in ESP8266
    Avatar for user111618

    Yes. I searched on the forum and use these codes:

    let rawCodes =[4400,4350,550,1600,600,500,550,1650,55­0,1600,550,550,550,550,550,1600,550,550,­550,550,550,1600,550,550,550,550,550,160­0,550,1600,600,500,550,1650,550,550,550,­1600,550,1600,600,1600,550,1600,550,550,­550,1600,600,1600,550,1600,600,500,550,5­50,550,550,550,500,600,1600,550,550,550,­500,600,1600,550,1600,600,1600,550,550,5­50,500,600,500,550,550,550,550,550,500,6­00,500,550,550,550,1600,600,1600,550,160­0,550,1650,550,1600,550].map(function(x)­ {return x/1000;});
    analogWrite(NodeMCU.D5, 0.9, {freq:38000});
    digitalPulse(NodeMCU.D5, 1, rawCodes);
    digitalPulse(NodeMCU.D5, 1, 0);
    

    And it will reboot itself during process.

  • in ESP8266
    Avatar for user111618

    Yes. Cause Espruino(ESP8266) can not generate 38KHz PWM to drive an IR LED, so I have to use Arduino to do this. But for some reason I'd like to change Arduino firmware, like when I put those MCUs into a box.

  • in ESP8266
    Avatar for user111618

    Sorry, you were misunderstood my meaning. I mean, based on Espruino, store hex data in flash and transmit data to Arduino to flash it.

  • in ESP8266
    Avatar for user111618

    I tried to use IR LED on ESP8266 but it didn't support 38k frequency, so I have to use Arduino to drive an IR LED. It will receive data from ESP8266 through soft serial, but for some reason, I want to transmit hex data to Arduino to flash it. Is anybody know how to do this?

    I know the AT firmware can set transmit transparency mode to do this, but I want to know how to flash it using Espruino, thank you.

    • 21 comments
    • 914 views
  • in ESP8266
    Avatar for user111618

    So according to this issue, I guess flash must have an amount of the abandoned data before running compact, if not, the compact function will cause data loss.

  • in ESP8266
    Avatar for user111618

    To reproduce it, you need to:
    (1).Get a string, length about 1000(I download string from WebSocket).
    (2).

    fs = require("Storage");
    fs.erase("aName");
    fs.write("aName", thatString);
    

    (3). Code in .boot0:

    if(fs.getFree()<4096) fs.compact();
    

    if the free space did less than 4096 and compact() has run and reboot itself after compact, then run fs.compact(); again, if those actions right, you will lost all data in flash.

  • in ESP8266
    Avatar for user111618

    I mean, I don't FOTA, so I would like to disable it on 01s(1mb board) and NodeMCU(12F). Now, I did it on 01s but failed on NodeMCU by using different firmware, but two firmware both added argument NO_FOTA=1.
    Are there any methods to do this on NodeMCU? Thanks.

Actions