[HN Gopher] Microdot: A Web Framework for Microcontrollers
       ___________________________________________________________________
        
       Microdot: A Web Framework for Microcontrollers
        
       Author : jandeboevrie
       Score  : 28 points
       Date   : 2024-02-02 05:45 UTC (1 days ago)
        
 (HTM) web link (lwn.net)
 (TXT) w3m dump (lwn.net)
        
       | synergy20 wrote:
       | Micropython is using python 3.4 and it does take more storage
       | space than compiled language when you pull in its modules etc.
       | 
       | I would think Lua or even C based web framework for MCU and
       | restricted embedded boards will be a lot more resource efficient.
       | 
       | Typically you can just run a few cgi scripts with bootstrap as
       | the UI and jquery as the javascript, but a simple MVC will be
       | really cool.
        
         | kaycebasques wrote:
         | So the entire Microdot web framework is also intended to run
         | on-device? I didn't grok that on my first readthrough
        
       | kaycebasques wrote:
       | Looks great. Not sure how apples-to-apples this comparison is [1]
       | but my team has a similar product, pw_web, a Node.js lib that
       | lets you communicate with embedded devices over RPC:
       | https://pigweed.dev/pw_web/
       | 
       | I'm curious to hear what other similar products are out there
       | that others are using?
       | 
       | Edit: Sounds like Microdot runs the entire web framework
       | completely on-device? My initial understanding was wrong in that
       | case; it's an apples-to-oranges comparison
       | 
       | [1] It seems like Microdot handles more of the stack and is
       | probably more hobbyist-friendly based on the fact that it targets
       | MicroPython. Or maybe it's just better all-around; I haven't
       | tried MicroPython so I can't compare.
        
       | thomasqbrady wrote:
       | Looked in several places, but I can't figure out exactly what
       | sort of microcontroller they aim to support... are we talking
       | ATmega? ESP32? ARM Cortex M? All of those?
        
       | chrsw wrote:
       | Interesting. Is there a similar micro- or nano- web framework
       | like this but in C?
        
       | voakbasda wrote:
       | I hate to be that guy, but I've been writing embedded systems
       | using microcontrollers for decades. The movement to put Python on
       | them makes me cringe.
       | 
       | I understand making them more approachable for developers at a
       | higher level, but the resulting solutions need an order of
       | magnitude more resources to accomplish the same tasks when
       | compared to writing an equivalent system in C.
       | 
       | Assuming these kinds of tools are being used temporarily for
       | proof-of-concept, I think that it is a great fit; however, we all
       | know that there's nothing more permanent than a temporary
       | solution.
        
         | jstanley wrote:
         | I'm personally not interested in MicroPython either, but...
         | 
         | > the resulting solutions need an order of magnitude more
         | resources to accomplish the same tasks when compared to writing
         | an equivalent system in C.
         | 
         | I mean, yeah... but that's true when you're writing Python code
         | on a normal computer as well. It's not really an argument
         | against writing Python except in cases where you're actually
         | running into resource constraints.
         | 
         | If you can get the resources you need in a microcontroller you
         | can afford, and you prefer programming in Python... why not?
        
         | e63f67dd-065b wrote:
         | Doesn't this depend highly on whether that resource usage is
         | worth the tradeoff of developer productivity? Python devs are
         | much more plentiful and easier to hire, and if you now need a
         | $1 microcontroller instead of a $0.5, and you're selling 100k
         | units, that's a $50k cost.
         | 
         | It really depends here. The lower the volume, tighter the
         | iteration time, etc the more sense it makes. I know oil rigs,
         | for example, have a bunch of rpis running on them, because the
         | manufacturer is selling a $100k box and any amount of time
         | spent shaving $10 off the BOM is really not worth it at all.
        
       ___________________________________________________________________
       (page generated 2024-02-03 23:00 UTC)