NodeMCU version unknown - nodemcu

I'm new with NodeMCU firmware use. I have a Amica ESP-12E (v2?) dev kit connected to a DHT22 which I program using the Arduino IDE. All is setup and working fine.
My problem came when I wanted to update NodeMCU firmware. Since I don't really know what came pre installed from China, I downloaded ESPlorer to try to determine NodeMCU version. I get the following "error" when I reset the dev board:
Communication with MCU..Got answer! Communication with MCU established.
AutoDetect firmware...
Can't autodetect firmware, because proper answer not received (may be unknown firmware).
Please, reset module or continue.
{{a long string of weird characters that I can't copy and paste appear here}}
At this point I'm totally clueless about what version of firmware I have. Is there a way to obtain NodeMCU firmware version by software via Arduino IDE code, ESPlorer GUI or something similar?
On the other hand, is there a really easy way to compile/download latest NodeMCU firmware BIN file? Even one with all the modules active will be fine for me now, I'm just trying to understand and test things.

You seem to be confusing two very different platforms. I leave out some details as not to confuse you any further.
Arduino: you use Arduino programming in the Arduino IDE then build and install a binary to your device whenever the application changes. No NodeMCU firmware needed!
NodeMCU: you flash the NodeMCU firmware once (e.g. using esptool.py) and then upload Lua code (e.g. using ESPlorer) whenever the application changes. This is more lightweight than the Arduino platform.
On the other hand, is there a really easy way to compile/download
latest NodeMCU firmware BIN file?
Yes, have a look at the NodeMCU documentation at http://nodemcu.readthedocs.io/en/latest/en/build/. The easiest is to use the cloud builder at https://nodemcu-build.com/. I currently suggest to build from the dev branch because flashing is easier with it.

As pointed out you have several options for firmware and you'll need to make a choice as to which suits you going forward. If you are going to stick with the Nodemcu LUA firmware you can determine the version by typing:
print(node.info())
at the command line prompt.
There are alternatives to using ESPlorer e.g. Putty or Coolterm that will give you the raw output from the device with no interpretation. So if you have the correct serial port settings and the device plugged into the USB port it will show the banner when you reset giving an indication of the origin and version of the installed firmware.

In ESPlorer, there is an option under settings which if unchecked will stop looking checking for the version of the code.
For whatever reason, ESPlorer is not designed to read nodemcu version.
The error message throws you off, could lead you to think, there is an error.
At best, the above error can be ignored. It has no impact at all. In background, init.lua is up and running.

Related

Native USB debugging on ESP32 in PlatformIO without ESP-IDF toolchain?

I have a custom ESP32-S2-based circuit board with USB-C which does not have a USB-serial converter IC like a common dev board might. On this board, USB(-) is on GPIO19, and USB(+) is on GPIO20. USB works great for powering the board and for uploading firmware.
The board works well and I have access to good old-fashioned serial console via a USB-to-logic level serial interface, but it would be nice to be able to get serial out to USB along with the firmware upload (like a dev board).
I’m using PlatformIO in Visual Studio Code, and writing with arduino-esp32 rather than ESP-IDF.
I understand by these instructions from Espressif that when using ESP-IDF I can configure log output to go to USB CDC rather than UART, and this has been done successfully on my custom board. But I would like to be able to do this without having to switch over to ESP-IDF.
I’m presuming that one of the partitions that PlatformIO is building for me is this configuration with some nice common sense defaults, but I can’t see how I might alter those defaults to do what I’m looking for.
Any thoughts or pointers?

Raspberry Pi Pico on Windows?

Is it possible to work at Raspberry Pi Pico using Windows 10? My question specified is: do I have to install any Linux distro, for example Raspbian, to be able to work at it? Do I also need to use SD card to work with it?
Just want to receive feedback, cause I'm confused and also kinda new to embedded systems
I may share my experience so far, I'm not an expert and this list does not claim to be complete at all.
The pi pico can be programmed by using
Picomite Basic (found here: https://geoffg.net/picomite.html) which doesnt need anything installed on the PC except a terminal program (I am using Tera Term)
MicroPython (never used it myself, afaik Thonny - found here: https://thonny.org/ is the preferred IDE )
C/C++/ASM This is what I am using, the SDK is available for Windows, Linux and Raspbian (MacOS maybe too?), an excellent guide on how to install it and how to use it is found here: https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf
Arduino The Pico can even be used as an arduino device too, a good point to start is here: https://github.com/earlephilhower/arduino-pico
Keep in mind, that the interpreted languages (basic and python) are easier to handle (no big SDK or framework need to be installed on the PC, copying code to the pico is a relative easy step) but at a cost of speed. If you need a lot of cpu power, compiled languages are by far the better choice
To answer your questions, yes, no, and no. You should be able to get going on Windows 10 with just the raspberry pi pico and a micro USB to USB cable.
I got started with mine this weekend - seeing the on-board LED blink finally made me so happy.
The official getting started guide pointed me at this script for getting started on Windows.
It set up docs, examples, visual studio code, and more for me. Between its README and chapter 9 of the getting started guide ("Building on MS Windows"), I was able to get my little light blinking :)
Good luck to you on your embedded journey!
As an alternative, an in addition to #Tommylee2k's helpful insights, you can develop and run Python software for a Pico with absolutely no software needing to be installed on a Windows PC.
At its most basic level, you press the BOOTSEL switch and insert the Pico's USB cable into your PC, and the few MB of space on the Pico appear in your Windows File Explorer as a USB disk drive.
You then write your microPython software using any text editor you prefer. All these general purpose modules are available. And all these Pico-specific modules are available.
You then copy (drag and drop) your Python script to the Pico disk drive and save it as main.py.
The Pico will then run that script on every subsequent power-up. Of course you can re-attach the Pico to your PC and edit the file at a later date.
That is adequate and simple enough. If you want a REPL and friendly editor and console logging and other developer-friendly features, you can install Thonny for free and code more effectively but it is not actually absolutely necessary. It's a bit like driving a car without ABS, without an automatic gearbox and without aircon - it can get you from A to B without problems but there are easier and more comfortable methods.

Flashing ESP32's memory without installing the whole IDF?

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.

M300 OSDK - drone version not obtained

Since I cannot get the manifold 2 in my region, I created a cable according to https://forum.dji.com/forum.php?mod=viewthread&tid=219723.
The cable is connected via FTDI converter directly to the drone's OSDK port.
when connected to a serial terminal application I get data from the drone
Terminal
When I try to debug the flightcontrol-sample in Linux, I get the following:
LinuxOutput
Data is also received in Linux using 'screen' command.
testing the cable for 'loopback' works fine.
I have changed the port baud rate to several options (230400 & 921600) to no avail.
the ACM cable is connected through an additional USB port to the drone's port directly.
Am I missing some HW components in my setup?
I have entered all the relevant Linux commands to get the required permissions as advised in
https://developer.dji.com/onboard-sdk/documentation/quickstart/development-environment.html
&
https://developer.dji.com/onboard-sdk/documentation/quickstart/run-the-sample.html
Am I missing something in that department?
The final goal is to use STM32 as FC, but testing is easier using the Linux environment.
Any additional things I can test?
Are there other working setup designs I can try?
Thanks for your help.
i got M300 osdk connection up at Apr 2020.
So far not many issues. There are many tricks and rules that you need to follows e.g osdk adapter board usb type C seam side face inside. make sure osdk adapter board is powered up by checking the output supply voltage. 3.3V FTDI. and make sure it is pull up properly by checking voltage as well
After you check through the hardware.
the software has many tricks as well. for M300 only osdk/osdkros 4.0 and above can drive. The new userconfig.txt format changed and you have to change accordingly. and you can go through my checklist which I posted on DJI forum https://forum.dji.com/forum.php?mod=viewthread&tid=216529
If you really still have a problem. do provide photos on your connection, the terminal output for the error message.
As Dr. Yuan suggested, have a look at the UserConfig.txt file. Depending on which OSDK version you are using, it has a different format.
In my case, using osdk 3.9 configuring it this way solved my issues:
app_id : xxx (number)
app_key : xxx (number)
device : /dev/ttyUSB0
baudrate : 230400
Also check your FTDI cable, it once burned out for me and it was the reason for this error too. You should try a new one just in case.
I use the OSDK with a raspberry pi, in case you are using this kind of linux environment, I suggest you check the configuration files (cmdline.txt and config.txt) doing sudo nano /boot/cmdline.txt and same for config.txt.
my configuration for cmdline.txt is:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
And for config.txt just add this at the end:
enable_uart=1
init_uart_clock=64000000
start_x=1
I hope these can help and that I am not too late.

Can I create NodeMCU projects within VS Code using the PlatformIO extension?

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.

Resources