-
ESP32 Series Comparison (As of 2024)
Feature ESP32 ESP32-C3 ESP32-C5 ESP32-S3 ESP32-P4 ESP32-H2 Processor Dual-core Tensilica LX6 Single-core RISC-V Dual-core RISC-V Dual-core Xtensa LX7 Dual-core Xtensa LX7 Single-core RISC-V Frequency Up to 240 MHz Up to 160 MHz Up to 240 MHz Up to 240 MHz Up to 240 MHz Up to 96 MHz Wi-Fi 802.11 b/g/n 802.11 b/g/n 802.11 b/g/n/ac 802.11 b/g/n 802.11 b/g/n/ac No Bluetooth BT 4.2 (Classic + LE) BT 5.0 (LE) BT 5.0 (LE), BLE Mesh BT 5.0 (LE) BT 5.0 (LE), BLE Mesh BT 5.0 (LE), Thread, Zigbee Internal Memory 520 KB SRAM 400 KB SRAM 520 KB SRAM 512 KB SRAM 520 KB SRAM Similar to ESP32-C3 External Memory Up to 16 MB Flash & 8 MB SRAM Flash & External RAM Supported Up to 16 MB Flash & 8 MB SRAM Up to 16 MB Flash & 8 MB SRAM Up to 16 MB Flash & 8 MB SRAM Flash & External RAM Supported USB No Yes (USB OTG) Yes (USB OTG) Yes (USB OTG) Yes (USB OTG) No Primary Use Case General IoT applications Cost-sensitive IoT devices High-performance IoT applications Advanced applications with AI High-performance IoT applications with AI Smart home networks Key Takeaways
- ESP32: Continues as a versatile choice for a wide range of applications, offering robust memory and processing capabilities.
- ESP32-C3: Provides an efficient, cost-effective solution for simple IoT devices that require Wi-Fi, Bluetooth, and USB OTG capabilities.
- ESP32-C5: Steps up as a dual-core RISC-V processor with improved Wi-Fi and Bluetooth, ideal for high-performance IoT applications that also require USB OTG support.
- ESP32-S3: Offers advanced AI capabilities and rich I/O options, suitable for applications requiring machine learning and USB OTG support.
- ESP32-P4: Newer model with enhanced AI capabilities and superior connectivity options, including USB OTG support, designed for demanding IoT applications.
- ESP32-H2: Focuses on connectivity for smart home applications using Bluetooth 5, Thread, and Zigbee, perfect for non-Wi-Fi dependent setups.
- ESP32: Continues as a versatile choice for a wide range of applications, offering robust memory and processing capabilities.
-
-
-
I have read both Encryption threads:
https://forum.espruino.com/conversations/267841/
https://forum.espruino.com/conversations/273427/So after 7 years we just have SHA256 in crypto for ESP build in?
I was hoping to find some AES-like included solution.I went through git repo and read readme for building, but for windows there was only information: basically do it in Linux. Unfortunately not a solution I can use. I was hoping it can be done in Windows with Python :)
Could you add additional builds for ESP chips with AES, so there is one with and one without for each?
-
Hi guys :)
I found old NodeMCU Lolin v3 board and I am playing with it :)
I am wondering how to encrypt securely message on espruino and decrypt it on api.
I am looking for a way to ensure that only my device can add records to database.
I want to send only temperature and humidity so there is not much data.
I was thinking about RSA or AES or whatever can fit into this little thing.
AES would be super cool to use but require('crypto').AES doesn't seem to work after flashing with ESP8266 4MB.
Key to encrypt and decrypt message can be safely stored on the api and espruino - so that would work over unsecured networks.
I want to use HTTPS or TLS if possible, but I am just starting to look around after couple of years break from espruino project what has changed and from what I can choose from :) -
-
For a 4MB ESP8266 NodeMCU board running Espruino, your choices for secure encryption libraries are somewhat limited due to the constraints of the device, including its memory and processing power.
One of the smallest and most secure encryption libraries that could fit this criterion is TweetNaCl. TweetNaCl is a cryptography library that offers a compact implementation of the NaCl library (Networking and Cryptography library), which is well-regarded for its simplicity and high security. The TweetNaCl library has been ported to various languages and platforms, and there is a JavaScript version that could potentially be used with Espruino.
Anyone, any ideas?
XOR Cipher: For very lightweight applications, a simple XOR cipher with a pseudo-random sequence generator (like a linear feedback shift register for the sequence) could be implemented. However, this method is not recommended for securing sensitive data, as it can be relatively easily broken without proper precautions.
RC4: Another small and simple option could be RC4 (although it's now considered insecure for many applications, it might suffice for scenarios with low security requirements). You would need to be careful with its initialization and usage to avoid common pitfalls that make it vulnerable.
Simplified AES (SAES): This is a reduced, more straightforward version of AES designed for educational purposes and might serve as a basis for a custom implementation. It can demonstrate how to perform secure encryption with less complexity, though adapting it for production use requires caution to maintain security.
Found those on the net, but I am open to discussion and knowledge exchange before attempt to embed any of them.
- TweetNaCl / TweetNaCl.js - A compact, tweet-sized NaCl cryptography library, with a JavaScript version suitable for adaptation.
- micro-ecc - A small Elliptic Curve Cryptography (ECC) library for microcontrollers.
- uCryptoLib - A micro cryptographic library designed for embedded devices.
- LibHydrogen - A lightweight, secure, easy-to-use crypto library for constrained environments.
- Tiny-AES-c - A small and portable implementation of the AES algorithm, potentially adaptable for JavaScript.
- BearSSL - A secure and relatively small SSL/TLS library, with potential for lightweight implementations.
- mbedTLS (minimal configuration) - A library that can be configured to be minimalistic for embedded devices.
- wolfSSL (with --enable-smallstack or --enable-minimal options) - A small, portable, and embeddable SSL/TLS library.
- sodium-native - A low-level Node.js binding to libsodium, which might be adapted or inspire a minimal implementation.
- TinyCrypt - A small, portable, and easy-to-use library of cryptographic algorithms.
- speck.js - A JavaScript implementation of the SPECK block cipher, known for its simplicity and small size.
- microjs/crypto - A collection of micro libraries in JavaScript, including some for cryptography, which are very small.
- SJCL (Stanford JavaScript Crypto Library) - While not the smallest, it can be customized to include only necessary features.
- asmCrypto - A JavaScript cryptographic library with AssemblyScript optimization, potentially adaptable for size.
- js-nacl - A high-level cryptographic library that can be adapted or stripped down for essential functionality.
- noble - A family of compact, secure, and easy-to-use cryptographic primitives for JavaScript.
- Heatshrink - A data compression library suitable for small microcontrollers, useful for reducing data size before encryption.
- PicoCrypt - A hypothetical minimal cryptographic library designed with the smallest footprint in mind.
- CryptoJS (minimal build) - While generally larger, it can be customized to only include necessary components.
- Salty - A minimal secure encryption library for JavaScript, focusing on ease of use and small size.
- Elliptic (minimal configuration) - A lightweight implementation of elliptic curve cryptography in JavaScript.
- SOSEMANUK - A fast, software-oriented stream cipher that can potentially be adapted for JavaScript environments.
- Rabbit - A fast stream cipher that can be implemented in a compact form for JavaScript.
- Simon and Speck - Lightweight block ciphers designed for simplicity and efficiency, potentially adaptable to JavaScript.
- ChaCha - A stream cipher that offers good performance and security, with potential for a minimal JavaScript implementation.
- TweetNaCl / TweetNaCl.js - A compact, tweet-sized NaCl cryptography library, with a JavaScript version suitable for adaptation.
-
You can embed the module in your code like this (and there is no need for require anymore):
function DHT22(pin) { this.pin = pin; } DHT22.prototype.read = function (cb, n) { if (!n) n = 10; var d = ''; var ht = this; digitalWrite(ht.pin, 0); pinMode(ht.pin, 'output'); this.watch = setWatch( function (t) { d += 0 | (t.time - t.lastTime > 0.00005); }, ht.pin, { edge: 'falling', repeat: true } ); setTimeout(function () { pinMode(ht.pin, 'input_pullup'); pinMode(ht.pin); }, 1); setTimeout(function () { if (ht.watch) { ht.watch = clearWatch(ht.watch); } var cks = parseInt(d.substr(2, 8), 2) + parseInt(d.substr(10, 8), 2) + parseInt(d.substr(18, 8), 2) + parseInt(d.substr(26, 8), 2); if (cks && (cks & 0xff) == parseInt(d.substr(34, 8), 2)) { cb({ raw: d, rh: parseInt(d.substr(2, 16), 2) * 0.1, temp: parseInt(d.substr(19, 15), 2) * 0.2 * (0.5 - d[18]), }); } else { if (n > 1) setTimeout(function () { ht.read(cb, --n); }, 500); else cb({ err: true, checksumError: cks > 0, raw: d, temp: -1, rh: -1 }); } }, 50); }; const dht22 = new DHT22(NodeMCU.D5); const readDHT22Sensor = () => { digitalWrite(D2, false); dht22.read(e => { console.log( '[DHT22 sensor] ' + new Date().toString() + ' temperature: ' + e.temp.toString() + '°C, humidity: ' + e.rh.toString() + '%' ); digitalWrite(D2, true); }); }; readDHT22Sensor(); setInterval(() => readDHT22Sensor(), 1000);
-
I had similar problem:
Execution Interrupted during event processing. New interpreter error: MEMORY ERROR: Ctrl-C while processing interval - removing it. Execution Interrupted during event processing. New interpreter error: CALLBACK
I send DHT22 sensor data to backend endpoint every second using http post requests.
I think I needed 7+-20 of them to show up to cause it this to happen.Extending setInterval() from 1000 to 5000 did work.
I think the memory stores the http request until it receives callback or expires at some point, and sending too many in the same time causes CALLBACK MEMORY to run out of storage space :)
You need to find the right interval time so that the "callback memory" stack had data flow instead eventually run out of space.
http request connects to server, closes connection, waits for the response, and when it receives one, the whole thing ends and memory stack is being free from this http request, so in the meantime memory stores the request.
If you sent 50 requests and none gets response, you have 50 requests waiting for responses which causes memory run out of space to store more.
If you need the data immediately, please consider web sockets instead of http requests.
web socket opens connection and never closes it, in the meantime data flows non stop. it is used for chats but any other use when data flow is needed and considerably web socket would use less data transfer than http request is a good choice.
-
Has anyone successfully flashed NodeMCU with ESP8266 and CP2102 USB to UART bridge, with Espruino v1.99 and connected to using Espruino IDE?
I have Amica NodeMCU board.
I use esptool.py.
I installed UART driver (https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers#windows).
Chrome and native Espruino IDE sees USB to UART bridge on COM5.
I can successfully flash the board, but after flashing IDE returns:
"Unable to retrieve board information. Connection Error?"I used DIO, QIO, DOUT, QOUT, 80m, 40m, 115200, 9600, espruino 8266 v1.99 and espruino 8266 4MB v1.99 (both stable and cutting edge) in all combinations I could think of, and nothing works.
However board with CH340 on the same cable flashes and works.
This is my first board with CP2102 USB to UART bridge. Any board with CH340 chip i have work with eventually flashed and connected to Espruino IDE, whether it was DIO , QIO, DOUT...
If anyone has successfully flashed CP2102 with any previous version of Espruino, I would really appreciate the info what version of Espruino and what options, whether it was some flash loader or esptool so I could repeat steps and see if this is Espruino software, driver or the board itself.
-
-
-
Board has successfully flashed with espruino v1.99.
Ddht22 sensor works ok and returns data to console
Simple wifi.connect returns no_ap_found
Surprisingly the AP is being set, but my phone does not see it.Exactly the same code put on board with external esp8266 works.
My phone sees AP.
Dht22 sensor works.I have different boards with esp8266 (nodemcu d1, v3, v1...) this version is the only one that does not work. My friend says that he has the same problem, however we bought it on Amazon from the same seller so I cannot exclude the factory damage. I would need to buy one from some other producer.
-
-
Once a grandmaster in the noble art of Pixel-Wrangling and Font-Finessing, with a venerable 15-year reign over the kingdoms of Computer Graphics and DTP Operations, I found myself at a crossroads in the grand year of 2016. In a move that shocked the masses (or at least my cat), I hung up my virtual brushes and laid down my rulers, embarking on a quest most daring. I traded the safety of my artistic haven for the wild, untamed lands of Programming, seeking to don the mantle of a Software Engineer.
Yes, you read that right. After a decade and a half of making the digital canvas my domain, commanding armies of pixels with the ease of a seasoned general, I decided to confront the final boss: Code itself. Like a wizard choosing to forsake his magical staff for the arcane secrets of another realm, I plunged headfirst into this new adventure.
And so, here I stand (or sit, given the nature of the job), a transformed entity. I am no longer just the artist who could make your photos pop and your layouts sing but also the engineer who weaves logic and creativity into a tapestry of code. From visual maestro to software sage, my journey has been nothing short of a quest for the ages, chronicled here for your reading pleasure.
-
Did it myself, just my mistake :) Doing in in a hurry.
...fixed it ;) Thx for the review :)