• @MaBe I too seem to have some issues here on my d1-mini. I am trying to do IR transmit based on the instructions at the bottom of https://www.espruino.com/pronto.

    I get Uncaught InternalError: Timeout on Utility Timer message.

    It seems that the analogWrite() with 38kHz gives just too much work to do for some reason to the ESP8266. As once I turn the analogWrite() on the previously installed watch for reading the IR (on another pin) starts to be very unreliable. As soon as I did digitalRead() on the same pin the receiver became properly responsive again.

    Perhaps a combination of analogWrite()/SPI and digitalPulse() don't play well together?

    >process.env
    ={ 
      VERSION: "2v04", 
      GIT_COMMIT: "3956264e", 
      BOARD: "ESP8266_4MB", 
    ...
    >function codeToPFTimes(code) {
    :    let times = [];
    :
    :    function pushBit(c) {
    :         times.push(0.16);
    :         times.push(c === '0' ? 0.262 : 0.552);
    :    };
    :
    :    times.push(0.16);
    :    times.push(1.18); // START
    :    code.split('').forEach(pushBit);
    :    times.push(0.16);
    :    times.push(1.18); // STOP
    :    return times;
    :}
    =function (code) { ... }
    >codeToPFTimes('1000000110011111') 
    =[ 0.16, 1.18, 0.16, 0.552, 0.16,  ... 0.552, 0.16, 0.552, 0.16, 1.18 ]
    >analogWrite(No,0.95,{freq:38000});          
    
    >analogWrite(NodeMCU.D1,0.95,{freq:38000}); 
    =undefined
    >digitalPulse(NodeMCU.D2, 1, codeToPFTimes('1000000110011111')); digitalPulse(NodeMCU.D2, 1, 0); 
    Uncaught InternalError: Timeout on Utility Timer
     at line 1 col 94
    ...gitalPulse(NodeMCU.D2, 1, 0);
    
About

Avatar for opichals @opichals started