Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
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. -
p100sch14494y@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.
-
@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.. -
https://randomnerdtutorials.com/esp...
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. -
@Demolishun oh what the fuck. so the lib "wifi" contains a whole fucken http-server? that's just wild.
-
@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.
-
@RememberMe sounds interesting. and definitely worth looking into a bit more. even though it probably has no real use these days.^^
-
@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.
-
Voxera113974y@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. -
Voxera113974y@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. -
@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. -
@shredEngineer Well, the selling point of ESP8266 and ESP32 is the built in wifi components.
-
Voxera113974y@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. -
not reading beyond "js on a microcontroller" because the idea of putting an interpreter on a mc is absolutely insane
Just use C -
eval6774y@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. :) -
@Demolishun Of course. I'm replying to his honourable mention of PIC microprocessors.
-
@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++. -
@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
Related Rants
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.
rant
js
where is the js in lua
lua
esp32
nodemcu