Avatar for DrAzzy


Member since Feb 2014 • Last active Sep 2019

I'm Spence Konde aka Dr. Azzy

I live and work in the People's Republic of Cambridge, near Boston, MA. I test the web gateway and web development framework for a database software firm for my day job, and sell PCBs and do electronics stuff on the side. I also own pinball machines, with all the maintenance that entails, and have made modifications to them as well.

In addition to Espruino, I do a lot of work with the Arduino platform and maintain a core that supports almost all ATTiny microcontrollers for the Arduino IDE.

I'm not a real doctor (I'd be happy to write you a prescription - but it'll be on the back of a cocktail napkin, and it'll be for a cocktail);

In a past life when I played Ragnarok Online, I wrote the AzzyAI homunculus and mercenary AI, which was used by thousands of players worldwide (ie, I'm that Azzy)

Most recent activity

  • in ESP8266
    Avatar for DrAzzy

    Looks like a straightforward I2C device, creating a module for it shouldn't be particularly hard.

  • in ESP8266
    Avatar for DrAzzy

    use response.writeHead() and write out the CORS header that way.

    I do it in this code - https://github.com/SpenceKonde/AzzyProje­cts/blob/master/Animate/Version9.js

  • in ESP32
    Avatar for DrAzzy

    My experience was that the ESP8266 (the one I do a lot of LED control with) was that this was very slow indeed. That's why I have only 10 pingpong lights on each of my strings....

    I would very much like to see some speed optimizations for the ESP8266 and ESP32 boards - they are... painfully slow.

  • in ESP8266
    Avatar for DrAzzy

    I found that I had to wait a few seconds after startup to do the createServer() call - try putting that in a 5 second timeout.

  • in JavaScript
    Avatar for DrAzzy

    I know I used to know how to do this, but I've been in Arduino land a lot lately, and now this is puzzling me... I am sure there's a right way.

    I have serial data coming in. Each message will consist of a number of characters terminated with a newline.
    What I do on Arduino is load the characters one at a time into the incoming message buffer, and if the character is a newline, instead of doing that, I send the buffer off for processing.

    But on Espruino, I might get multiple characters at once - which means I could get the end of one message and the start of the next. What's the smart way to handle this? I'm sure it's a common thing that people have done, and settled on the obvious solution.

    Is there really no better way than using one of the substring functions to cut one character at a time off of the incoming data, and then apply the arduino-style logic? This seems uglier than I'd expect for Espruino.

    My initial reaction is that handling serial data on Espruino is much harder than in Arduino land, where you can just pick off a character at a time and easily process it - but I suspect I'm thinking about it wrong.


  • in General
    Avatar for DrAzzy

    Wow. It seems like everyone's using MQTT. It looks absurdly complicated - mqtt.org's documentation looks nigh impenetrable. Where do you guys go to get an understanding of the most relevant parts of it for IoT and how to implement it?

  • in General
    Avatar for DrAzzy

    The question is how to pass commands to the Espruino, and receive info from it, over the internet... without exposing the Espruino to incoming connections.

    Here's what I've done:
    Espruino receives commands by http requests over the LAN - these can either return data or do things.

    For getting data, there are a number of php scripts (one for each data-getting-request on the Espruino) which, if the request comes from the correct IP address, will take a base64-encoded string (the response from the Espruino), decode it, and store it with apc_store(). And there are an equal number of php scripts that return that data (in the same format as the Espruino returns it, so I can use the same page inside the LAN and outside, by using different URLs depending on window.location.hostname).

    For sending commands, there's one php script that stores a command (this would be the url that would be requested from within the LAN to affect the desired result - again to allow the same page to easily work both inside and outside the LAN) via apc, and another which gets and clears this list.

    Finally, a raspberry pi within the lan has cronjobs that call python scripts, which get data from the Espruino, base64 encode it, and pass it to the php scripts on the outside webserver, and one that grabs the command list, and if not empty, makes the requests that are specified.

    It appears to work, as long as I avoid making two requests to the Espruino simultaneously....