I have a nodemcu-32s microcontroller on which I have setup a simple webserver that serves a spiffs directory. The project uses platformio to upload to the ESP32.
I am trying to serve a react app from my esp but some of the filenames of the react app build directory are too long for SPIFFS, which is limited to 32 characters.
So I was wondering, is there a way to increase this character limit? So that my react app will fit on it?
Related
so when I connect my development board (NUCLEO-f446re) to my laptop , everything is working normally , but there is only one thing that confuses me , see the next picture
windows recognize my development board as external storage device with 1.52 MB size (partition named NODE_F446RE(E:))
when I open it , the next image show what I see
there is only 2 files there , the .HTM file takes me to this link and the .TXT file has the follow content:
Version: V2J40M27
Build: May 5 2022 13:16:48
so I don't understand what does this mean ?, like what does 1.5MB storage represent in my MCU even though , the flash size of my MCU is only 512 KB which is way less than the shown storage , also what happens if I put any .exe file in that partition ?
From the web page you link (emphasis by me):
USB re-enumeration capability: three different interfaces supported on USB
Virtual Com port
Mass storage (USB Disk drive) for drag'n'drop programming
Debug port
Your board offers the option to program your application. Simply drap and drop the bin (binary) file of the application into this drive.
It is "just" a virtual drive, the software behind it does the flashing for you, if it receives a binary file.
Why the size of the drive is bigger than the available flash memory, is not clear. Perhaps to allow for necessary overhead to mimic a file system, and to have room for the files you see.
If you copy an exe file in it, I'd expect some kind of error message. Or that the file will not be stored. Experiment!
This functionality is perhaps not well documented, but is part of the "Mbed Enabled" functionality. It is a feature of the Mbed bootloader, to allow "drag'n'drop programming" via a "fake" mass storage device in order to avoid the need for special programming tools or protocols.
You can write to the device, but the "file" will not appear in the filesystem, rather the content will be used to program the on-chip flash memory.
The files on the fake drive are read-only - mbed.htm will open in a browser and take you to the Mbed sign-up/login where you can start developing using Mbed. details.txt contains details of the mbed firmware pre-loaded on the board.
At one time the Mbed on-line/in-browser IDE lacked hardware programming and debug capability, so this feature was the primary means of programming Mbed boards, and debugging was painful. I believe all that has changed now and the feature is perhaps less important in development.
https://os.mbed.com/platforms/ST-Nucleo-F446RE/
Problem
I'm looking for a way to flash an ESP32 module's memory without installing the whole IDF software suite.
Why
Because I want to integrate ESP32 onto a custom board along with a low-performance ARM-powered CPU which runs a tiny Linux distro (based on Debian), and I want to flash ESP32 from this tiny Linux distro.
I know I could use the bootloader, but who will upload the initial bootloader? I don't want to do extra steps, so my idea is to embed the ESP32 module onto my custom board, and let the Linux to flash it from factory-state (when it's flash is empty, ie. no preloaded bootloader). Or is the serial bootloader always preinstalled on all ESP32 modules (like on ESP-WROOM-32)?
Why I don't want to use IDF? Because I don't want to build or debug anything, I just want to flash myprogram.bin onto ESP32. Also, as the board is low-performance, it would take ages to download everything for running IDF.
Current state
The ESP32 module is now visible via UART (RX,TX,GND), and if I held low the GPIO0, it runs the bootloader (my current module is embedded onto a NodeMCU - but there is no USB connected, this is raw UART!):
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
Could I expect the same behavior (controlling GPIO0 for running the bootloader) for all ESP32 modules, or this works just because guys at NodeMCU preprogrammed already some bootloader onto it?
I'm looking for a way to flash this ESP32 preferrably without any python script.
The ESP32 has a first-stage bootloader in ROM capable of writing to Flash - that's what's printing your output. You can talk to it if you know the protocol - this is implemented by the Python scripts in ESP IDF. If you don't want to use the official implementation because it's too heavy, you'll have to write your own implementation of this protocol which scratches your specific itch. Fortunately it's more or less documented and you can likely reverse engineer any missing knowledge from official Python scripts.
Actually Espressif also provides a nice and small binary for flashing ESPs:
https://github.com/espressif/esp-serial-flasher
Serial flasher component provides portable library for flashing Espressif SoCs (ESP32, ESP32-S2, ESP8266) from other host microcontroller. Espressif SoCs are normally programmed via serial interface (UART). Port layer for given host microcontroller has to be implemented, if not available.
One more (but very important) addition:
You have to modify this repo to make it work correctly, and also you might have to upload not just your binary, but also bootloader and partition_table.
I am attempting to use a ESP-32 dev kit to control WS2812 LED stripes. Discovered there is some firmware called NodeMCU for these dev kits which uses LUA scripts from what I can tell. There is an extension called PlatformIO for VS Code. I had used this to program a Arduino board to flash an LED.
I was wondering if it is possible to use PlatformIO to build the NodeMCU firmware and the LUA scripts then using PlatformIO to download everything to the ESP-32 dev kit. Is that possible?
I am thinking this can't be done since there are only two Framework selections, "Arduino" and "ESP-IDF", when I create a project which doesn't list NodeMCU.
Thanks
With ESP-IDF you would write C-code directly against the SDK. This can be done in Platform IO. This has its advantages but the major downside of course is that a development roundtrip takes some time. The complete build & install (flashing binary) cycle is run for every bit you turn in your source code.
With NodeMCU you build & install the firmware once and then only transfer the Lua files that changed. The downside here is that you need separate tools for separate tasks. See https://nodemcu.readthedocs.io/en/dev-esp32/ for details.
Build the firmware, either on Linux dev env, on a Linux VM (e.g. on Windows) or with Docker (quite simple, by yours truly).
Flash the firmware. Use esptool.py or the self-contained standalone GUI tool NodeMCU PyFlasher (by yours truly).
Upload Lua code from host to device. Use ESPlorer (very basic editor), NodeMCU Tool or the ChiliPeppr ESP32 Web IDE.
Evening community.
I'm in the process of developing a windows based application which heavily revolves around mobiles being connected to a machine via USB, Currently. The communication between android using googles ADB drivers works without a problem (currently, that is). The problem is getting said application to integrate well with IOS users.
What the application does I'm bascially reinventing the wheel of stock control for a client, who wants a completely customized application based around their current mobile barcode scanner which scans and saves the scanned items to a file name created with the date & Time in a text format. This application is both on IOS and Android devices.
What i'm looking to do, is have their current machine automatically map the connected device to a drive letter to allow easier browsing of the device through the application & Pull the necessary file and save locally to then make other changes as needed..
So, the overall question. Is, that without having a jailbroken/rooted mobile device to allow Mass Storage, is it possible to have a Windows XP based machine to automatically map connected IOS and Android devices to a drive letter? There will be only one device connected at one time
In genymotion settings->storage there is only the internal storage, no SD card.
Is there a way to have a SD card also?
There's already some emulation of SD card (external) storage in Genymotion that might work for you, depending on what you're trying to do. Although Settings->Storage doesn't show it separately as External Storage like you might expect, Genymotion does emulate external storage. The size of files stored there will be reflected in the totals shown under Internal Storage by Settings-Storage.
Running in Genymotion, an app using Environment.getExternalStorageDirectory().getPath() or .getAbsolutePath() will get back /storage/emulated/<userId>, where userId=0 if the app is running as Owner, and 10, 11, 12, etc. if the app is running as another user or restricted/managed profile. The Android framework actually maps this for you to /mnt/shell/emulated/<userId>, which is why you won't find /storage/emulated/<userId> if you use a shell to poke around.
The paths /sdcard and /mnt/sdcard are symlinks to /storage/emulated/legacy, which is basically the Owner's storage. Don't use these in your apps, since they might not exist everywhere and/or your app might not have access to them if not running as Owner. They are just there to support legacy hardcoded apps.
Not being sure what you're trying to do, it's probably also worth mentioning that Genymotion now supports VirtualBox shared folders which will appear under /mnt/shared inside your VM. Check their Google+ post for instructions.