Avatar for gdanov

gdanov

Member since May 2021 • Last active May 2021
  • 2 conversations
  • 9 comments

Most recent activity

    • 19 comments
    • 792 views
  • in ESP32
    Avatar for gdanov

    Thanks. I've been re-thinking how to structure the code I intend to do (modules included) and am moving in the direction where very little state will be persisted via save(), if any.

  • in ESP32
    Avatar for gdanov

    Hi,
    I'm software professional with very big experience. I know when my code is crap and I know how to learn new stuff. This is why I may appear stubborn, but I really know best how to approach new stuff.

    Uploading my messy experimental code without explaining my workflow would've wasted other ppl's time. You and the community missed nothing, I guarantee you that.

    I'm sorry but I don't really understand what's your request to me. As for my question re stability — It's fair question, in some respects the esp32 port is not complete so I had to know what to expect. I am also very suspicious of the heltec board.

    As a good citizen I always like to help when I can. This is why after asking a question I do my best to follow up, as you can see above.

    So, one more follow-up: the biggest challenge and source of grief for me was the combination of how save() works and how the web ide works. Let me elaborate:

    • Clojure is my favorite environment and espruino's REPL is the closest I've ever seen to clojure's REPL. As usual similarity can hide very subtle traps and this happened here
    • espruiono's save() and boot process is unlike anything I've ever used. It took me one evening of experimenting to finally grasp how the different pieces fit together. The "saving code..." page has it very well laid out, but I needed some practice to really grok it. This page must be front & central, it's extremely important information. The difference when code is evaluated and when global state is restored is key
    • I quickly ditched the web ide to use my emacs + espruino cli. This is, I beleive another trap — the very powerful save & boot capabilities gave me lots of rope to hang myself. Also, using the espruino cli requires you understand what you're doing (which I did not). The web ide has pretty straightforward flow, but "graduating" to espruino cli is deceivingly simple (and wrong in my case)






  • in ESP32
    Avatar for gdanov

    Thanks, once again!

    I had two major problems:

    • the infamous brownout detector. Solved with capacitor
    • total mess w.r.t. dev process and flashing code. Spent good deal of time on the "saving code..." page but still not 100% confident I'm doing it right. I obviously had hot mess of setInterval handlers.

    It's big progress because now the probe works for hours without any issues.

  • in ESP32
    Avatar for gdanov

    Thanks for the debugging hints. I knew none of this. Where should I look for more debugging hints?

    setInterval is called once from the main context. These are my timers in normal situation:

    global["\xFF"].timers
    =[
      undefined,
      undefined,
      undefined,
      { time: 140550, interval: 300000,
        callback: function (undefined) { ... }
       },
      { time: 1342468, interval: 3000000,
        callback: function (undefined) { ... }
       }
     ]
    

    this is memory (again under normal conditions)

    { free: 1563, usage: 737, total: 2300, history: 23,
      gc: 538, gctime: 2.717, blocksize: 16 }
    

    I'll definitelly incorporate your and @AkosLukacs hints into the error handling and debugging when it crashes again.

  • in ESP32
    Avatar for gdanov

    Thanks a lot for the feedback.
    I'm using DS18B20 and I knew the resolution/conversion time relationship. I use 9 or 10 bit resolution and I read registers then request new resolution without waiting in order to keep the event loop free.
    How much self-heating do you think I'm causing? It's measuring temperatures in the 90-110 range and couple degrees offset (as long as it's constant) is not an issue.

  • in ESP32
    Avatar for gdanov

    every request is sent to fixed url. only the payload string varies. not sure where the bug could be

  • in ESP32
    Avatar for gdanov

    so, I left it connected via tcp and this is what seems relevant:

    ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.
    New interpreter error: CALLBACK,MEMORY
    ERROR: Ctrl-C while processing interval - removing it.
    Execution Interrupted during event processing.
    

    I get some exceptions in the http put ("Uncaught InternalError: Unable to create socket" included) but it looks like both setInterval handlers are cancelled? the one reading temperature did not throw visible exceptions.

  • in ESP32
    Avatar for gdanov

    Hi,
    I'm using my heltec esp32 as simple temperature monitoring device:

    1. via setInterval I sample my one wire sensors and generate strings (influx line format) that I push into array. Sampling is done every 300ms
    2. again via setInterval I push the collected strings to influx via http post. This happens every 5 secs.

    What's weird is that every 10-15 minutes I get error from influx because I'm sending corrupt strings. The errors are small — here & there one character is wrong.

    Also, the device works for few hours and then stops sending data. Haven't been able to catch this moment and see tho logs yet.

    How stable/dependable is espruino? Can I rely on it to control heaters and pumps (planned next step)?

  • in ESP32
    Avatar for gdanov

    Hi,
    According to the board reference here only pin 35/36 are available.

    However after toying with the code from this comment I pick up signal on the mentioned pins.

    What's the official situation? Is the documentation out-of-date or am I lucky?

    Thanks

Actions