Avatar for ptone


Member since Dec 2017 • Last active Jan 2018
  • 3 conversations

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for ptone

    I wanted to use the ECDH in that lib to establish a shared key that could then be used with AES, and probably the ECDSA to sign a JWT token.

    For now it is all moot as I'm using NUS and JSON for data during prototyping, and that means the full memory of the SW is available to anything that connects to that service, but just trying to think ahead a little on the security patterns.

    Thanks for those other links - it actually looks like a relatively easy port.


  • in Puck.js, Pixl.js and MDBT42
    Avatar for ptone

    I'm not having much luck with the CLI over BLE

    Connecting to 'c8:71:9f:36:a5:ee'
    * No list of built-in modules found. If you get 'Module not found' *
    * messages for built-in modules you may want to connect to a board *
    * with '-p devicePath' or use '--board BOARDNAME'                  *
    Module neopixel not found

    I'm setting puckjs in the jobfile

    I've actually noticed this not found warning in the web ide - but scripts seem to work, so I've not paid much attention

    The file seems to write - but leaves the device in a semi-broken state.

    The file doesn't actually run - and subsequent attempts to connect via the web ide connect ok, but the repl is broken, sometimes I get this in the repl:

    >Uncaught Error: String too big to convert to float
     at line 1 col 547

    I'm thinking of hooking an FTDI USB-serial adapter to see how much of this is specific to BLE

  • in Puck.js, Pixl.js and MDBT42
    Avatar for ptone

    Has anyone tried wrapping

    Into an Espruino library?

    This Nordic page implies the Puck's processor should handle it:

    It looks like this is the approach to wrapping it:

  • in Puck.js, Pixl.js and MDBT42
    Avatar for ptone

    Thank you both - I tried to look at the nrf52 datasheet which has register tables, and the scant examples of the peek API - but I wasn't able to get them put together. How does one sort out what peek address to use for a given output pin?

    And FWIW - my approach of using auto [x = digitalRead(5); digitalWrite(5,x)]seems to "work" without any visible blink in the LED - not sure what is actually happening at the microsecond or less level. Wonder if espruino is somehow doing both in essentially one step?

  • in Puck.js, Pixl.js and MDBT42
    Avatar for ptone

    While I can maintain the state of the LED in the JS impl - I would like to be able to just read the register for the digital pin connected to an LED

    Arduino seems to support reading from and OUT pin

    But this does not work the same/expected way in Espruino:

    pinMode(5, 'output')

    I can sort of get what I want by using pin auto mode and making sure that every read writes back itself like this:

    var x;
    x = digitalRead(5); digitalWrite(5,x)

    But I was thinking there should be a way I should just be able to read the state?

    I'm guessing I could use peek* functions to get at the register directly? But that seems very un-espruino like from a dev-ux POV

    Any ideas on the right solution here?