Avatar for benjaminbenben


Member since Apr 2017 • Last active Sep 2021
  • 3 conversations

Most recent activity

  • in Projects
    Avatar for benjaminbenben

    Hey @user132453! Great, I'm glad you found it!

    I'm not sure, but I think adding the definitions to the EncodeIR.cpp file seems like a good idea to me too. It seems like there was a PR that added them but couldn't be merged probonopd/MakeHex#5, so maybe they'd be up for a new one?

    You may have come across this already, but I plonked some very rough notes about wasming the code: https://github.com/benfoxall/puckmote/tr­ee/main/src/wasm (just added a diff of the cpp file that I'd left off before)

  • in Projects
    Avatar for benjaminbenben

    Hehe, I'll need to check out heatshrink.js to make me feel better about my wasm-ing!

    Ah yeah, an irdb.js could be great! I've got a tiny bit of wrapper code which splits/regexes lines and parses csv files which could be a starting point.

    The irdb.tk site is being discussed on https://github.com/probonopd/irdb/issues­/28

    It sounds like there's interest in getting it back online (and maybe migrating to GitHub pages), though sounds like they might be struggling with time. I'm sure they'd love to hear any offers of hosting or "upload to Puck.js" opportunities!

  • in Projects
    Avatar for benjaminbenben

    Thanks a lot @Robin, glad you like it!!

    @Gordon, yep I built the MakeHex wasm - was my first time using WebAssembly; don't think it's the best example of it! It pulls directly from IRDB, so any updates should appear here too. I've been in touch with the IRBD maintainers about using this approach to rebuild irdb.tk (it's been down for the last few months).

    Oh my, a configurator would be amazing. Especially being able to chain together commands - you could do all sorts of things.

    Good shout on the Try It Now link - I'll add that to the readme.

    Thanks for checking it out!

  • in Projects
    Avatar for benjaminbenben

    Project: https://benjaminbenben.com/puckmote
    Source: https://github.com/benfoxall/puckmote
    Video: https://photos.app.goo.gl/7MuC2SxdMbTUpC­8g9

    I've been hacking on a page that allows you load IR codes for a tv/projector/etc, and send them on to your Puck.

    • It's installable as a progressive web app, so you can "Save" a controller on your phone homescreen
    • pronto codes are generated on the fly using a webassembly build of MakeHex
    • Repeat presses are faster/cached because the IR codes can be quite large

    Back story - I made a remote control for my TV last year, though I thought it could be interesting/handy to let you pick devices from a list.

  • in Projects
    Avatar for benjaminbenben

    Ah yep, a promise interface for the Puck.js library eval could be sweet - and I guess it would work alongside the callback option, so wouldn't break anything. Is that another thing that I could PR? I've never contributed code to Espruino, and I'd really like to.

    I guess the slight difference with the wrapper is that I can run async tasks on the puck (like waiting for button presses/states), I'm not sure how I'd do that with Puck.eval.

    Ah, UART.js seems where my PuckSocket thing is headed. I'll take more of a look. Have you done much with the streams api? It seems a slightly odd api, but might fit pretty well.

    Ah, that function serialising is cool! The result reminds me a bit of comlink.

  • in Projects
    Avatar for benjaminbenben

    With the IDE, that's great! Thanks for the pointers, I'll have a dig and try and raise a PR. upload seems fine for my use case, I could just print "Hello from MicroChat" or something.

    TIL about the emulator - that's amazing! wow.

    With the prompt & buttons. I've been playing with a (sketchy atm) host/puck rpc wrapper. It's pretty similar to Puck.eval(…), but it lets you do async listeners and handles errors.

    It lets you write browser code like:

    await rpc('new Promise(resolve => setWatch(() => resolve(), BTN))')
    console.log('Battery level: ' + await rpc('E.getBattery()'))
    try { 
      await rpc('E.getButtery()') 
    } catch(e) {
       // Error - getButtery is not defined

    I'm still playing around, but I'm hoping that it'll make it easier to spread code between a page & microcontroller. So for chat button prompt for "light-on: yes/no" could be in react/telegram/wherever.

    The other option I explored was puck = new PuckWorker('puck-script.js'), which would feel like a web-worker, but be running on a puck. You get a nice pattern for messaging, and puck-script.js would be espruino-only code, which might make it easier for more complex usage. Though I guess it's a bit of a different usage to having longer-lived scripts running.

    Aw, his own rover sounds so much fun! (Perseverance is amazing 🤩).

    Gonna check out your bookmarklet!

  • in Projects
    Avatar for benjaminbenben

    Thanks @Gordon!! (Hope all is good!)

    Oh man, I do love a good emoji replacement. I'll have a think about that! 🤔

    For something like the robot commands, I'm wondering if there's some approach like telegram bots where you could display buttons in the chat dialog. Though maybe your son might prefer typing it!

    Ah great! I'll enable the flag and play with navigator.bluetooth.getDevices.

    With the IDE, is there a way to link to it and have it connect to a specified device? I'd love to add a button from this ui which is "open this device in the IDE". If that's not possible, is that something I could add a PR for?

    Oooooo, slacking a puck could be amazing!!

  • in Projects
    Avatar for benjaminbenben

    Bit more hacking/fixing, you can set the name of devices now too.