Wtf is this ESP32 shit and it's hype?

I bought one because I thought JS on a microcontroller? That's gotta be fun!

I'm a hobbiest when it comes to MCUs and I do JS as a job, so I tought I'm made for this and I know at least as much as all the kids on the internet doing it.

Nothing makes sense with this shit. You have to flash wildly compiled modules of WHATEVERTHEFUCK with fucken python development-kits which have something to do with Lua to give you some kind of node-REPL which answers you with a bunch of strangely-looking errors starting with "stdin:x:".
If this NODE-MCU shit is made for JS why is there stuff about Lua everywhere you go with this, I don't get a single thing. Now I'm sitting on about 3 different git repos of sdks or what do I know and know less than before.

Oh and there is actually not a single tutorial really targetting the esp32. it's all about that 82xx-model.

Then I start googling around a bit more - It's not even ES6, it's just some ES3/5 shit. Why would you even do this. That's actually harder to manage than classic C/C++. You get no gain with it. Fuck me.

Wtf bro.

  • 1
    Just go with PIC, it's more sane, somehow.
  • 4
    I use C++ on ESP32 (using arduino ide). I cannot imagine once you fit a JS vm on the ESP32 there would be much room for code.

    You can embed web pages on the ESP32 and in those have JS, but it would run on a browser.
  • 0
    @Demolishun explain me how people have webservers on these things
  • 2
    @nitwhiz Ye old c++ days. You get a message on the socket. You read it you return a response. No PHP fuckery just c filling a buffer and handing it back as a Http response, except you do it in c.
  • 0
    @p100sch But why would you need a firmware containing a http server module in it for that?

    But still, I'd like to see your "old cpp days" on a mcu without filesystems and sockets..
  • 1

    I used the docs to do this. I may have run this on the predecessor of the esp32, the esp8266. I do have esp32 at home. I will have to look.

    For mine I setup an access point that created its own wifi network. On there I had the "default" page it would redirect to. Then that code pretended to install viruses on your machine. So it was a trap access point that used JS to simulate activity through a browser.
  • 1
    @Demolishun oh what the fuck. so the lib "wifi" contains a whole fucken http-server? that's just wild.
  • 0
    @Demolishun BUT - I thank you very much, TIL I guess. :)
  • 1
    @nitwhiz it's literally just reading the http request over WiFi or serial or whatever into a buffer, parsing it manually, making a http response in another buffer and transmitting that buffer back. No filesystems or sockets or whatever. Raw HTTP protocol. There are probably libraries for it, and also for adding things like SSL.
  • 0
    @RememberMe sounds interesting. and definitely worth looking into a bit more. even though it probably has no real use these days.^^
  • 1
    @nitwhiz nope, this is how IoT devices work. There's nothing inherently complicated about HTTP as a protocol, it's just a bunch of text lines. There are other friendlier ones like mqtt and stuff. So you can for example use this to hit a Firebase (or other networked DB) API endpoint with sensor values for a bunch of sensors with esp32s connected to them. Then some analysis or visualization application reads the values from the DB and does something useful with it. Works quite well.
  • 0
    @nitwhiz depends.

    A very simple webserver puld be a few kbytes, but then only serve static content.

    An js engine is much larger.

    Lua is a much simple lang and its runtime is as far asI know much smaller.

    The ESP32, according to wikipedia has only 512 kbyte ram.

    You can run a webserver on that but it will have some limitations.

    A Rasberry pie often has 8 times that or more.
  • 0
    @nitwhiz someone built a webserver for the old commodore 64, which has 64 kbyte ram, and my first pc had 512 kbyte ram and 40 mbyte harddisk running msdos.

    You can easily fit a filesystem and network drivers into that memory and have room for a simple webserver.

    But you cannot install the latest windows or a full blown linux distrubution, you need a bare bones kernel with not to much bells and whistles.
  • 2
    @Voxera there are quite a few bite sized scripting engines, like this embedded js engine https://duktape.org/ or micropython. You can get a surprising amount done in 512KB RAM.

    Raspberry Pi RAM is in gigabytes, they're regular high performance computers compared to this stuff.
  • 1
    @melezorus34 Use AVR, it's an even less fucked-up µC architecture. :)
  • 0
    @shredEngineer Well, the selling point of ESP8266 and ESP32 is the built in wifi components.
  • 1
    @RememberMe yes I mixed up units ;)

    And yes I know what you can do with 512kbytes. As I said, my first pc was a 286 with 512 kb.

    Before that a spectra video 128.
  • 1
    not reading beyond "js on a microcontroller" because the idea of putting an interpreter on a mc is absolutely insane

    Just use C
  • 0
    @nitwhiz Mongoose OS.

    BUT: The best decision i made was going from ESP's and other microcontrollers to Raspberry Pi for most applications. Yes it might be really overkill for simple stuff but the improved dev experience is more than worth it for me. I can just use ssh and sshfs, and run my scripts with nodemon. Awesome. :)
  • 0
    @Demolishun Of course. I'm replying to his honourable mention of PIC microprocessors.
  • 0
    @LotsOfCaffeine Well in the end it's your typical "why not".
    I'm not really a friend of the idea either but this nodemcu thing popped up more and more often so i wanted to try it out. I don't get why it's so tiresome and still people love it so much.^^

    The ESP32 itself has fantastic capabilities and I'll just use it with C/C++.
  • 0
    @shredEngineer already done, it gets pretty boring pretty fast..^^
  • 1
    @nitwhiz the modemcu chips are great variations of the ESP8266 and now ESP32

    I've never touched the lua thing, if I'm going low level there's only really one choice for me
Add Comment