Avatar for HaraldK


Member since Sep 2015 • Last active Jul 2017
  • 4 conversations

Most recent activity

  • in ESP32
    Avatar for HaraldK

    Digging a bit around, this works and it's reliably working: Use espruino -o x.js MYPROGRAM.js and then upload the temporary output, which resolves all require() modules via wifi (nc ESP32IP 23 < x.js)

    That proves at least that whatever the espruino command does, seems to work. The problem might be an intermittent reset caused by the serial port.

  • in ESP32
    Avatar for HaraldK


    I got a neat ESP32 board and tested Espruino (1.92) on it. Works like a charm when using the Web IDE. Uploading via NPM espruino module works. About once in 10 times. It sends data (-v switch is very useful here), and it usually does something, but often it seems to forget everything immediately, like if there is a reset() after upload.

    E.g. I have a small program uploaded which:

    1. Sets up I2C1
    2. Loads SSD1306 library and initializes the OLED (connected via I2C)
    3. Prints text on the OLED. This works 100%. The OLED is initialized and text appears.
    4. Supposed to print more every second (via setInterval()). That does work once in about 10 times.

    In the cases where it does not work, the serial console is usually no longer working until I reset the board. In the few cases where the console is accessible, I can connect via minicom, and I see nothing being remembered of my program. Looks like a reset happened. Namely the variable g I use for the OLED is not defined anymore. No wonder it cannot write anything to the display.

    The Web IDE works. Always.

    Any idea what's causing the NPM espruino to not work as well as the Web IDE?


  • in General
    Avatar for HaraldK

    Nah, it's generally a problem and it seems to be because I'm in Japan.

  • in General
    Avatar for HaraldK

    PayPal for whatever odd reason, doesn't like donations when you (resp. me) are in Japan. So button or not, no donations from me. Instead I bought some Pucks from the Tindie store.

  • in Interfacing
    Avatar for HaraldK

    ROR is ROtate Right. ROL is ROtate Left.
    Difference to a normal shift is that in a shift all bits move one bit position. The leftmost in a shift left or rightmost in a shift right usually gets a 0.
    In a rotation the bits move in a circle: in a left shift bit 7 moves into bit 0.
    See here: https://en.wikipedia.org/wiki/Bitwise_opĀ­eration#Rotate_no_carry

  • in Electronics
    Avatar for HaraldK

    The LiPo is fine. The connectors too. The voltage (measured with a simple multimeter) is fine too.
    And I don't even have to touch anything. It reacts slightly by just nearing my hand near the LiPo.
    Which is why I think this is a capacitance thing, but I cannot explain this.

    What could make a WS2812 think that blue data should be sent to the red LED, and at high intensity (ike shifts 3 bits left)? Consistently.

  • in Electronics
    Avatar for HaraldK

    I got a nice STM32F4 Discovery board for quite a while. Recently installing Espruino (1v80) on it and having a significant amount of fun learning JavaScript. But now I got an electronical problem (unlikely Espruino, but maybe STM32 related):

    See here

    for what happens.

    Connections: STM32F4 board connecting to PC (for terminal) and a LiPo and switched regulator to the 5V input. B15 is connected via a jumper cable to Din of the WS2812 chain. GND too. Vcc of the LEDs is not using 5V as that gives me those high intensity colors I get too when I touch the LiPo. So I know that 3.3V is not sufficient to drive a 5V WS2812. Fine. No issue. I should drive it with 5V after all.

    The problem is that I'd like to understand the mechanism why when I touch the LiPo, the light intensity is reproduceable different. It's still working as sending data to the WS2812 still makes the lights move in circles. The colors change:
    Low intensity blue gets high intensity red. High intensity blue gets low intensity green.
    Low intensity red get high intensity green. High intensity red gets black.

    My understanding of R and C and transient spikes cannot explain this at all. The WS2812 is after all a digital device.

    Anyone an idea what happens?

    I know the fix is to drive the WS2812 with 5V, or drive them with 3.3V and have Vcc on the WS2812 get 3.3V (or less than 3.8V). That's not the problem. I'd like to understand why those LEDs behave odd when I touch the LiPo.