Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Daniel Ashcraft
    @dashcraft

    In btutils, there's a maximum advertisement length for uuid's set to 31 characters, i am attempting to bring over a
    sandard for ble wifi credential onboarding and their uuid's for characteristics are longer than 31 characters,
    https://github.com/improv-wifi/sdk-cpp/blob/main/src/improv.h

    Is this hard coded limit part of the underlying gap protocol?

    Peter Hoddie
    @phoddie
    I think it may be. It may also be one of those limits that got increased with a later version of BLE (BLE 5, for example).
    Don't have time to go back and review that at the moment. To come at it from another perspective, if the ESP-IDF has a way to sender larger advertisements using thee NimBLE BLE stack, then we can support that in the Moddable SDK. If it doesn't, then we are likely stuck at 31 for ESP32.
    Andy Carle
    @PrototypingAndy_twitter

    Good afternoon, @dashcraft! Could you point me to where you're seeing that 31-character limit in btutils? The limit should be 16 bytes of data, not 31 characters.

    BLE UUIDs should all be 128-bit values. The values in improv.h that you linked above look proper to me: 32 hex characters (128 bits) separated by hyphens should be fine.

    Daniel Ashcraft
    @dashcraft

    It's possible i'm using the wrong characteristics payload, completeUUID16List and serviceDataUUID16 is what i'm currently looking at in advertising data params.

    Here is the location of the default.

    gap.MAX_AD_LENGTH
    https://github.com/Moddable-OpenSource/moddable/blob/e9742b49d5132f2723d3a5fca45b65cf3818d01a/modules/network/ble/gap.js#L98
    https://github.com/Moddable-OpenSource/moddable/blob/1502614759bbee368833c600222406b1808fb972/modules/network/ble/btutils.js#L441

    Andy Carle
    @PrototypingAndy_twitter
    I believe completeUUID16List is expecting 16-bit UUIDs, as defined in the BLE spec Section 2.5.1. You have 128-bit UUIDs here, so you'll need completeUUID128List/serviceDataUUID128.
    How are you working with those functions? In the Moddable SDK, GATT UUIDs are usually processed out of GATT service JSON files, as described in the documentation. A good example of 128-bit UUIDs being used in that way is in the sensortag example. See, for instance, accelerometer.json in that project:
    {
        "service": {
            "uuid": "F000AA10-0451-4000-B000-000000000000",
            "characteristics": {
                "data": {
                    "uuid": "F000AA11-0451-4000-B000-000000000000",
                    "type": "Int8Array"
                },
                "configuration": {
                    "uuid": "F000AA12-0451-4000-B000-000000000000",
                    "type": "Uint8"
                },
                "period": {
                    "uuid": "F000AA13-0451-4000-B000-000000000000",
                    "type": "Uint8"
                }
            }
        }
    }
    Daniel Ashcraft
    @dashcraft
    I was hard coding them using the uuid function from btutils, this would likely help as well.

    I was having issues with the esp32 wroom s2's and memory. Using another service i couldn't run wifi, ble and also load a ssl cert, it would run out of memory.
    basically this issue: espressif/arduino-esp32#4523

    I was hoping i could find a configuration in moddable to avoid this issue whenever i enabled ble

    Peter Hoddie
    @phoddie
    How is the Arduino issue referenced above relevant here?
    Daniel Ashcraft
    @dashcraft
    It’s not, sorry I was providing context as to why I’m spinning up this improv ble component to begin with.
    Peter Hoddie
    @phoddie
    Not a problem I just read through that report looking for something to learn to apply here and didn't find it.
    FWIW - we have deployed commercial projects using ESP32 that use BLE to provision Wi-Fi, communicate with secure MQTT, incorporate a display driven by a Piu-ased UI, provide audio feedback tones -- all without running out of memory. It can be done, but it requires careful attention to memory use.
    Michael Kellner
    @mkellner
    image.png
    Daniel Ashcraft
    @dashcraft
    @mkellner ahh, i said the wrong thing, ESP-WROOM-32
    this is the board i'm using that has a ble component
    John M. Wargo
    @johnwargo
    Sharing this in case anyone's interested; I created a node-based CLI to simplify interaction with the Moddable SDK: https://www.npmjs.com/package/moddable-helper. Hmmm, but the readme isn't displaying.
    Peter Hoddie
    @phoddie
    Hey, @johnwargo, that looks pretty interesting. I will make some time read through the (extensive) docs and give it a try. I'm curious... did you use a particular model for the command line syntax / design or if it is something unique you created for this.
    Daniel Ashcraft
    @dashcraft
    @johnwargo any thoughts around using it for a package manager as well for moddable specific packages? It looks like it does a good job for packages included with the sdk
    John M. Wargo
    @johnwargo
    @phoddie thanks. No, not really, i just hacked away at it until i had something that worked for the way i looked at the process, then tuned it a bit. I have a fair amount of node CLI experience. In this case, i wanted more experience with commander (module)
    @dashcraft we can extend it any way we want. Im not sure what you mean, can you give an example?
    Daniel Ashcraft
    @dashcraft
    I’ve created 2 small packages, but there’s no central package management system for moddable compatible packages. Outside of having them included in the core moddable repository of course. But that is limited and bloats the initial get started time a bit.
    Daniel Ashcraft
    @dashcraft

    I need to send a array buffer back to the frontend with the value 0x01
    for some reason, this comes back is 44 or 114, sometimes 50

    Typedarrays are new to me and I just can't get this to convert correctly

    My general setup is like...
    const buffer = new ArrayBuffer(16);
    
    const view = new DataView(buffer);
    view.setInt8(1, 0x01); 
    
    return view.buffer
    Daniel Ashcraft
    @dashcraft
    i think i figured it out, there's a notifyValue argument for specific types
    Peter Hoddie
    @phoddie
    The code above looks reasonable. FWIW - the first argument to setInt8 is putting the value into the second byte of the buffer, not the first (but that may be intentional).
    Daniel Ashcraft
    @dashcraft

    What was actually happening, was i had set the wrong value in the bleservices json file, and I naively was trying to do what it had already done. I've finally got a working example of implementing improv-wifi (esphomes/hassio's new 'standard' for ble onboarding)

    This is going to be a pita to write tests for.
    https://github.com/dashcraft/improv-wifi-mod

    Peter Hoddie
    @phoddie
    Understanding what a framework does and doesn't do can sometimes be an adventure. Cool that you got it working. The code like clean and straightforward.
    It looks like you created TypeScript declarations for some of the Moddable SDK BLE APIs. Should we think about rolling those into the Moddable SDK for more general use?
    John M. Wargo
    @johnwargo
    @dashcraft so if I understand you correctly, you want have external code, not part of your Moddable 'project' and you want to be able to deploy them as well with mddbl or are you talking about copying the files into your project? I'm assuming the latter since you mentioned package manager. Hmmm, that's a really interesting idea. What I'd really like, in order for me to understand exactly what you mean, is if you'd walk me through the process you invision for this.
    8qohse
    @8qohse:matrix.org
    [m]
    He must be talking about something like pip install improv-wifi-mod or npm install express-moddable copying the external files in their project folder; and possibly making the appropriate adjustment in manifest.json?
    Daniel Ashcraft
    @dashcraft
    @johnwargo exactly what @8qohse said
    Daniel Ashcraft
    @dashcraft
    @phoddie hmmm type declaration files are low hanging fruit, i can create them and issue prs as I come across them.
    John M. Wargo
    @johnwargo
    @dashcraft OK, let me noodle on that.
    Peter Hoddie
    @phoddie
    I recall someone asked about Docker here a little while back. It looks like @meganetaaan is using that as a build option in one of his projects. https://github.com/meganetaaan/stack-chan/blob/main/firmware/README.md#optional-using-docker-image
    Frida854
    @Frida854

    When trying examples/pins/monitor/main.js an error occurs.

    Projects/moddable/modules/pins/digital/monitor/esp/modMonitor.c (165) # Break: Monitor.prototype.rises: not configured!

    In egde: there is only edge: Monitor.Falling
    by adding edge: Monitor.Falling | Monitor.Rising
    the error disappears.

    '''
    if (undefined != config.button1_pin) {
    if (config.button1_port)
    monitor1 = new Monitor({pin: config.button1_pin, port: config.button1_port, mode: Digital.InputPullUp, edge: Monitor.Falling | Monitor.Rising});
    else
    monitor1 = new Monitor({pin: config.button1_pin, mode: Digital.InputPullUp, edge: Monitor.Falling | Monitor.Rising});
    monitor1.onChanged = function() {
    trace(Button 1: state: ${this.read()}, changed ${this.rises + this.falls} times\n);
    }
    }
    '''

    Peter Hoddie
    @phoddie
    Hey, @Frida854 , thanks for the report. That looks like a mistake in the example. Your fix is just right. We'll fix that in our next push.
    Daniel Ashcraft
    @dashcraft
    Are there any performance tips for https certs? If I set a 30 second interval on sending data, works fine, but 5s and lower it will sporadically say it couldn’t load the certificate.
    Peter Hoddie
    @phoddie
    Not quite sure I understand the problem you are seeing. Can you share more about the scenario?
    Daniel Ashcraft
    @dashcraft
    Let me find some time this up coming week to repro and if I come across it again I'll share the error.
    Peter Hoddie
    @phoddie
    :thumbsup:
    bradleymeck
    @bradleymeck:matrix.org
    [m]
    Has anyone looked at getting https://github.com/espressif/esptool-js running to have a full web based deploy system for people to share apps?
    Peter Hoddie
    @phoddie
    Kind of.
    bradleymeck
    @bradleymeck:matrix.org
    [m]
    if i could figure out how to go from elf -> what it uses it should be possible to run clang from inside a browser
    absolute insanity to do so though
    Peter Hoddie
    @phoddie
    I'll sent you an email later today. Some things to discuss that aren't perfectly suited to gitter. ;)
    Daniel Ashcraft
    @dashcraft
    finally got our boards in!
    Peter Hoddie
    @phoddie
    Woo-hoo! Congrats.
    Daniel Ashcraft
    @dashcraft
    @phoddie am i correct in assuming that the platform for the esp32-wroom-32d is esp32 for the cli?