Git Product home page Git Product logo

Comments (13)

utzig avatar utzig commented on June 12, 2024 3

Have you looked at supporting WebUSB, Web Serial and/or WebHID? That would expand the utility of this library to devices that don't have BT connectivity.

Haha, I didn't know "Web Serial" was a thing, I might take a look at that one.

from mcumgr-web.

boogie avatar boogie commented on June 12, 2024 2

Contact me if you would like to add USB functionality. I'm very interested in implementing it, but I need your help about setting up a development environment for it.

from mcumgr-web.

devanlai avatar devanlai commented on June 12, 2024 1

I decided to finally take a stab at building something with WebSerial. I've cobbled together a proof-of-concept branch for the mcumgr SMP over console transport on my branch here (demo page). I only have an mcuboot device to test with, but listing images and uploading seem to work okay.

I believe I'm handling the mcumgr serial framing correctly, but I'm pretty sure my first stab at the WebSerial portion could use some refinement.

from mcumgr-web.

devanlai avatar devanlai commented on June 12, 2024 1

I guess I didn't mash things up the right way, but it turns out no modifications to the Zephyr examples were really needed.

The right sequence of commands to build and flash an mcuboot-compatible image for the ESP32 with a multiplexed command shell / mcumgr SMP pipe is:

west build -b esp32 -- -DOVERLAY_CONFIG="overlay-shell.conf"
west sign -t imgtool -- --key path\to\your\mcuboot\signing-key\root-rsa-2048.pem
west flash

That image will respond to echo commands without any modifications. With the tweak to send an empty map instead of an empty payload in the image state command, it responds as expected. I was able to upload an image, mark it for test, manually reset to install it (maybe the mcumgr reset command would have sufficed; I got impatient) and confirm it after it swapped the slots.

from mcumgr-web.

beriberikix avatar beriberikix commented on June 12, 2024

Yup, and it works pretty well! CC @reillyeon

from mcumgr-web.

boogie avatar boogie commented on June 12, 2024

That would be awesome to add. I don't have a device I can test it with, but I'm ready to help.

from mcumgr-web.

beriberikix avatar beriberikix commented on June 12, 2024

So cool! I tested it with a known-good MCUBoot image and device (ESP32, docs here.) Uploading never started. Is there anything I can capture to help troubleshoot?
Screen Shot 2022-02-26 at 5 01 37 PM

from mcumgr-web.

beriberikix avatar beriberikix commented on June 12, 2024

Nothing noteworthy in chrome://device-log.
Screen Shot 2022-02-26 at 5 10 10 PM

from mcumgr-web.

devanlai avatar devanlai commented on June 12, 2024

Hmm, no obvious errors / unexpected exceptions. My guess would be that either the device never responded for some reason, or else the first upload message never got sent for some reason.

from mcumgr-web.

beriberikix avatar beriberikix commented on June 12, 2024

Actually, this might be user error. What device were you using? Espressif devices are "special."

from mcumgr-web.

devanlai avatar devanlai commented on June 12, 2024

I'm testing on a non-mainline device with the mcuboot single-slot serial recovery mode, which uses a subset of the normal mcumgr commands. I'm sure it's possible to enable the mcumgr shell/console transport in normal application builds, I just haven't quite figured out the right configuration yet.

from mcumgr-web.

devanlai avatar devanlai commented on June 12, 2024

From some further testing with a frankenstein mashup of the shell sample and the smp_svr sample, I can get an ESP32 to at least respond with MGMT_ERR_ENOTSUP (8) if I change the image status / list command to encode an empty map instead of a null payload (to closer match what the mcumgr cli does), but no luck getting non-error responses to even the echo command, either with the mcumgr cli or with webserial.

I'll have to do some further poking tomorrow and probably switch to some hardware that I can connect to with the debugger to see why it's always failing to handle the commands even though I'm pretty sure the config is correct.

from mcumgr-web.

boogie avatar boogie commented on June 12, 2024

Wow, I really glad about your contribution. I won't be able to test it short term, but tell me if you think it's "ready", and we can merge it.

from mcumgr-web.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.