Avatar for oesterle

oesterle

Member since Nov 2014 • Last active Mar 2017
  • 4 conversations
  • 45 comments

Creative Technologist, based in the San Francisco Bay Area, open to travel

Connect with me on LinkedIn
Follow me on Twitter

Most recent activity

  • in Puck.js
    Avatar for oesterle

    Oooh… nice.

    Puck.js. Now available in Space Gray.

  • in JavaScript
    Avatar for oesterle

    That code looks a lot cleaner, @countxerox!

    Thanks for that advice @oesterle. I've had a go and I think it's improved but I can't close the wifi connection. wifi.disconnect() isn't recognized.

    Well, at least it's perfectly OK to call wifi.connect() even when already connected according to the docs. And, your callback is called.

    I wonder why wifi.disconnect() isn't working? @Gordon, any idea?

  • in Puck.js
    Avatar for oesterle

    @Gordon, can you show us some video of these, or at least the black one, and original white, with the LEDs on?

  • in JavaScript
    Avatar for oesterle

    Right now, everything lives inside onInit(). Can you reorganize your code into separate task-focused functions? That may relieve memory issues, and also make your code more reusable on other projects.

    I'd try to make onInit() focused on just the setup you need to do on power on.

    You also have a long-lived nest of multiple callback functions. I'd pull the connection and sending out into a separate function that's called every 2 minutes. In that function, I'd also turn off Wi-Fi when done sending. This is good practice for IoT sensors that you intend to battery power, also.

    Finally, you'll still probably have rare occasions where connection or sending fails, but these should be less frequent.

  • in Pico / Wifi / Original Espruino
    Avatar for oesterle

    Can you post your source?

    Serial defaults to 9600 baud. I'd first try setting up Serial at 57600 or 115200 baud, like Serial1.setup(57600, {rx:B7,tx:B6}); (where B7 and B6 are the pins you're using).

    Serial1.pipe() might be another option, but I haven't played with that.

    Next, sending chunks on an interval would probably work, but isn't the most efficient or robust, since you are depending on the receiving Pico always being ready on time for the next chunk. Which it might not always: sometimes it may have another task on its plate.

    A somewhat more robust, brute force method, is to do your own chunking. Instead of waiting a fixed interval between chunks, you send a chunk, then wait for the receiving device to send you an acknowledgment. Then you send the next chunk, etc. Before all this, you send something like sending 152\n, where 152 is the number of chunks you plan on sending. That way receiver knows when it's done. (Serial1.pipe() probably does exactly this, internally.)

  • in Puck.js
    Avatar for oesterle

    Awesome, @Gordon! Is there a way to guess which CI builds contain something emerging like this? (I certainly don't want to create another documentation task. :-D )

  • in General
    Avatar for oesterle

    @user75010, If you are just talking test, you can instrument your C code with something like a very lightweight serial command line. For example, CmdMessenger is an Arduino C++ library that enables you to exercise compiled C(++) functions (with or without arguments) via serial connection. CmdMessenger on GitHub

  • in Puck.js
    Avatar for oesterle

    Is the build not finding protobuf (Google Protocol Buffers)?

    pkg_resources.DistributionNotFound: protobuf
    
  • in Projects
    Avatar for oesterle

    Nice, thanks! How does the hue work? Blue->red rainbow colors?

    Yep.

    t.hexToColor = (hexChar)=> {
        var hue = parseInt(hexChar,16) / 16;
        var rgb = hueToRGB(hue);
        return rgb;
      };
    

    The colors are a nice "visual hash" of the Puck address.

    It's annoying that I don't have control of the Web Bluetooth device listing, because then I could put the 4 colors next to each Puck in the list!

    It would still be useful to find a way to put the address of the currently connected Puck in the IDE. Puck address colors would be very cool. When working with multiple Pucks (I got your 5-pack on Kickstarter), I lose track of which one is connected in the IDE.

Actions