Avatar for Pi

Pi

Member since Dec 2017 • Last active Aug 2018
  • 7 conversations
  • 27 comments

Newb to Espruino, Raspberry Pi, Linux and all that...

Most recent activity

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

    @Gordon thanks, your help is much appreciated. The reason I was getting results with NRF.setScanRespose was probably because I am using Google's "Nearby" (Settings->Google->Nearby on android), which is scanning for Eddystone links, but I see now that it's not exactly what I need.

    For reasons I don't understand, the above code doesn't work correctly for me (have tried it on 2 pucks). Manufacturer data are advertised properly, but I don't see the url. I am checking with nRF Connect and 0x0590 is there, very rarely 0xFEAA may pop up very shortly and disappear again. Same on Nearby, if I refresh constantly I may see it at some point, but it's gone once I refresh again. EspruinoHub on console (PuTTY) is showing feaa and the link for the puck though.

    Stringifying data is not the way to go, I know, but I start using it when I couldn't figure out how to send code to change color on a ble bulb from one puck to another, got a little confused with all the conversions among different bases. But it's kind of working, slice and parseInt ftw. I still cannot understand though how you can represent, lets say 1000 states, with 255 numbers.

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

    Thanks @Gordon. I can't make the above work, the Eddystone url doesn't show up (the manufacturer data do), and at some point I couldn't connect to the puck, EspruinoHub couldn't see it at all (took the battery out to reset it). The code below worked, not sure if is the best way, but as long as it works, all good :)

    NRF.setAdvertising([
                NRF.getAdvertisingData({},{manufacturer:­ 0x0590, manufacturerData:data}),
                NRF.setScanResponse(require("ble_eddysto­ne").get("goo.gl/B3J0Oc"))
       ], {interval:1000});
    
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Pi

    What would be the best way to advertise manufacturer data and Eddystone at the same time? I can't figure how to do something like this (obviously not working):

    var bUrl = "stackoverflow.com"; // Updated from Node-Red
      
      function updateAdv() {
        var data = [JSON.stringify(Puck.light().toFixed(3) * 1000), Math.round(E.getTemperature())];
        console.log(data);
        NRF.setAdvertising([
            {manufacturer: 0x0590, manufacturerData:data},
            require("ble_eddystone").advertise(bUrl)­
            ], {interval:1000});
      }
      updateAdv();
      setInterval(updateAdv, 5000); 
    

    Thanks.

  • in General
    Avatar for Pi

    @Gordon probably is something related to my system then, not a big deal anyway :)

  • in General
    Avatar for Pi

    I'm controlling puck through EspruinoHub on Raspberry Pi Zero W, and raspberrypi.local:1888/ide/ on Chrome (on my pc). As I said, it's probably nothing, just mentioned it because it used to take some seconds for the bar to complete (depending on the size of the code), it would fill gradually, while now it goes instantly to full and then disappears.

  • in General
    Avatar for Pi

    Something I have noticed is that the upload progress bar (right down corner) is almost instant in the new version (0.68.6), while previously it would go more slowly if I remember correctly. I'm just mentioning this because it may reflect some of the problems I'm having when uploading code (>2000 bytes), where I'd get frequent exceptions (even with code that doesn't run while uploading).

    Of course this may be related to my code or have something to do with my system, so it's more possible that this is not related to anything, just a thought. I'm controlling puck through Raspberry Pi btw.

    • 2 comments
    • 240 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for Pi

    Hi. Is there a limit to the size of code we can upload on puck? I am having problems uploading 4767 bytes (with minification around 3030 bytes) of code, usually I'd get an "Uncaught SyntaxError: Got ')'expected EOF" or something similar. From what I can tell the code itself it's not at fault, because if I delete some of it (randomly), I can upload it with no issues. I am controlling puck through Raspberry Pi and using the latest firmware and webIDE. Have tried with and without minification(s).

    The code is a bit lengthy so I am not posting it, but I can do so if needed. Thanks.

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

    Yes that will do I'd say, the only thing you may additionally need is a wall charger if you are aren't going to plug it on a computer, and a microSD card of course.

Actions