Avatar for Gordon

Gordon

Member since Sep 2013 • Last active May 2017

Most recent activity

  • in Puck.js
    Avatar for Gordon

    I use JLinkGDBServer too and my gdbinit is something like this:

    target extended-remote :4242
    file espruino_1v92.12_nrf52832.elf
    break Reset_Handler
    break HardFault_Handler
    

    If you edit boards/PUCKJS.py and rip out some of the libraries you don't want like NET and GRAPHICS, you can then build with DEBUG=1 which will help you loads :)

    It should work fine - the real gotcha is that the softdevice has a watchdog timer in it, and if you break into something with GDB, the watchdog will fire. The second you then try and continue execution the CPU will restart.

    As far as I know there's no real way around that - it's just one of the nightmares of trying to develop embedded stuff.

  • in Puck.js
    Avatar for Gordon

    Have you tried doing this: espruino.com/Puck.js#i-can-t-­reconnect-to-my-puck-js-on-mac-os

    I guess it might be that the Mac is trying to reconnect to the device even when it's in DFU mode, and that is messing things up. You see the red LED on the Puck when it's in bootloader mode?
    Do you ever see it change to the Blue LED light?

  • in Puck.js
    Avatar for Gordon

    Wow, strange - would you have installed 1v91.xyz build previously do you think? That's what I thought the problem was.

  • in General
    Avatar for Gordon

    Worth noting that you probably want to download the .min.js module rather than the .js one as it'll save a bunch of space

  • in Puck.js
    Avatar for Gordon

    Hi,

    Web IDE (all version through the website and downloaded) does not show any devices after selecting Web Bluetooth

    I'm pretty sure the downloaded Native Web IDE shouldn't offer you Web Bluetooth as an option at all - make sure you're using this one: espruino.com/Web+IDE#as-a-nat­ive-application

    I also downloaded the ST driver

    That's only needed for STM32-based devices connected via USB

    I get "Try again, and make sure your device is discoverable"

    Are you sure Puck.js is not still connected to some other device? Puck.js can only connect to one computer at a time.

    Also, have you updated Puck.js's firmware? Newer firmwares advertise more often so are more reliable to connect to. espruino.com/Puck.js#firmware­-updates

    I am starting to think that puck-js is not really compatible with 8.1

    It is - however it's possible that your PC's built in bluetooth adaptor or driver doesn't correctly support Bluetooth LE devices. Support seems to have been a bit flakey until recently.

    I am writing a C# code

    You could try using this as a base: github.com/espruino/winnus

    It's C++, but should translate quite easily to C#

    It's what I use for the Native Web IDE, which should definitely work (users have had it working fine with Windows 8.1)

  • in General
    Avatar for Gordon

    I'm just updating those docs for modules. The following works:

    function loadModule(moduleName, callback) {
      require("http").get("http://www.espruino­.com/modules/"+moduleName+".js", function(res) {
        var contents = "";
        res.on('data', function(data) { contents += data; });
        res.on('close', function() { 
          Modules.addCached(moduleName, contents); 
          if (callback) callback();
        });
      }).on('error', function(e) {
        console.log("ERROR", e);
      });
    }
    

    (but it's not synchronous)

  • in General
    Avatar for Gordon

    At the moment there's nothing built in, and adding the module loading (despite it still being in the docs) is actually very low priority.

    The problem (much like on desktop) is that the require call is synchronous but the actual HTTP GET is async, so it would be a bit tricky to combine them. And while it might be possible to hack around it on normal Espruino boards, on ESP8266 I think it would likely fail completely (because it really dislikes functions that take a long time to execute).

    However nothing stops you from writing your own async loadModule function that you can call yourself (which will work on all platforms) - it just can't be automatic. All it has to do is request the JS file from espruino.com/modules/ and then call espruino.com/Reference#l_Modu­les_addCached with it as a string.

  • in Projects
    Avatar for Gordon

    Yes, I think that's them. The model was the DO003 - looking on alibaba there are still loads for sale.

    @MaBe has actually done a great watch-mountable case for Puck.js: thingiverse.com/thing:209557­2

    With one of the dark silicone cases and a small OLED screen you could probably come up with something quite neat. I've been quite tempted to try.

    Puck.js was quite a reach for me with two separate moulded cases - I think it'd be a step too far trying to make a whole watch! Having said that I did try and talk to the watch manufacturers at the time I was hacking it - I think if I got a big enough order I could convince them to install custom firmware (or at the very least give me the encryption key for their bootloader), so that could definitely be an option.

    I think it'd still be a matter of reverse engineering though - they didn't want to give me any schematics :)

    • 79 comments
    • 5,149 views
  • in General
    Avatar for Gordon

    Ahh - good use case for it. Yes, it'd be great when comparing differences.

    It's tricky - it depends how you're used to coding. The Project feature does lots of stuff but the UI isn't that polished. A lot of people use it for storing modules locally, where it works really well and is very simple to set up.

    You can then split your project up into lots of modules that you can store and edit locally.

Actions