Avatar for AkosLukacs


Member since Dec 2015 • Last active Jan 2019
  • 2 conversations

Most recent activity

  • in JavaScript
    Avatar for AkosLukacs

    @allObjects Thank you for the explanation, I guess now I understand the why as well!

  • in JavaScript
    Avatar for AkosLukacs

    Thanks a lot @allObjects for confirming it!

    One thing: the module code does work on the Pixl.JS!
    If I just copy-paste the whole module code "on the right hand side", without require-ing it, it can display all the measurements on the LCD too without any problem.
    Had it running with 1 second refresh for a couple of hours, without any problems.

    I suspect the issue is indeed with the require part, so yes, @Gordon will have some fun puzzle after he comes back from his holiday :)

  • in JavaScript
    Avatar for AkosLukacs

    Thanks for the answers, I think something is wrong with the Pixl.JS!

    If I "send" this single line of code var bmeMod = require("BME680"); from the IDE, it does work on the Espruino Wifi, but does the aforementioned weirdness on the Pixl.JS

    The Pixl.JS prints New interpreter error: LOW_MEMORY,MEMORY, and memory usage is different:
    Calling process.memory() on the Pixl.js prints 2378 free, 122 usage.
    Calling process.memory() on the Espruino wifi prints 6203 free, 945 usage.

    Both running 2v00.
    On the same machine, tried a couple of times, and the Pixl.JS works fine otherwise: the BME 860 works, if I directly upload the whole module code...

  • in JavaScript
    Avatar for AkosLukacs

    So, just manually copy-pasted the module's code, renamed exports to bmeManual, and uploaded to the Pixl.JS. And it works, and the measured values feel realistic (see the screenshot).

    Edit: it does work both with the minified and non-minified code if I just copy-paste it. But doesn't work with require-ing the code. Don't know what's going on...

  • in JavaScript
    Avatar for AkosLukacs

    Thanks for the input! Really weird, tried almost exactly what you recommend before posting, but no luck.
    A screenshot is attached of the code + the REPL result to show exactly what I tried to do.
    But no luck. Looks like the require-d BME680 is just an empty object (look at the print-ed result and the autocomplete result just at the top of the highlight.

    I did import the DHT module only to verify that require does work. And it does work: dht.connect is indeed a function. but the BME680 is empty???

  • in JavaScript
    Avatar for AkosLukacs


    Tried to interface to a BME680 , but fails a rather strange way. Tried to use the example, but

    var bme = require("BME680").connectI2C(i2c);

    Errors at the .connectI2C part: Function connectI2C not found!

    If I just require in the module, like this

    var bme = require("BME680");

    I should be able to use it "on the left side", right? But can't, there is no connectI2c or connectSPI or BME680 properties on the bme variable.

    It does work if I require a DHT22. The connect function can be called from the REPL side.

    Hardware: Pixl.Js, 2v00; the BME680 is connected thru I2C on A4 and A5. (on a pimoroni breakout board)

    I2C and the module seems to work OK: Reading the module's JS code, found that there is a module Id, and I could read that Id without any problems.

    The upload of the code does take a couple of seconds, there are no errors. Looked at the module's JS code, and should work. Or at least should do something, but does nothing. As if nothing is exported...
    Anybody has any idea what might be the problem?


  • in Electronics
    Avatar for AkosLukacs

    Honestly, no idea. Theoretically you can remove the IDD measurement jumper, and connect to a different board.
    Both STM's and TI's board have an additional uC for power measurement, and maybe the protocol maybe not that well known...
    Ti's solution looks like heavily tied to their IDE (measuring function level power consumption sounds nice tho). Couldn't find more info about STM ones.

  • in ESP8266
    Avatar for AkosLukacs

    @Gordon capitalize your last line, it's simply brilliant :)

    Altho not exactly correct if you are other timezone than the UK, and want to get your local time.

  • in Electronics
    Avatar for AkosLukacs

    5V supercaps have significant internal resistance, IIRC in the 10-100Ω range. Radio transmission would most likely cause a brown out. Don't know if espruino and the radio runs at 2.5V...

    Actually a couple of uC vendors have tools for power measurements, just for inspiration:
    STM has ammeter in some newer Discovery boards: Cortex L4, Cortex L0
    Ti has Energy trace in the MSP432 Launchpad.
    Atmel has Power Debugger as a standalone tool with jtag and other debug stuff.