I compile a project based on WeMos Lolin32 OLED, used library U8g2, with command line on Ubuntu, when I typed this:"arduino-cli compile -b ESP32:Arduino:lolin32.name testWeMosLolin32OLED.ino --verbose", I got this:"panic: runtime error: invalid memory address or nil pointer dereference"
and, I read a post here:
when I tried to type in this"arduino-cli compile -b ESP32:Arduino:lolin32.name:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=80 testWeMosLolin32OLED.ino --verbose", I got the same prompt, any suggestion?
Hi @MianQi. you have the FQBN of your ESP32 board wrong in the -b flag of your arduino-cli compile command.
You can learn the correct FQBN of each of the boards you have installed by running this command:
arduino-cli board listall
You can also search for a specific board with the arduino-cli board search command.
Even though it is expected for the command to fail when you use an incorrect FQBN, it is not intended for Arduino CLI to output this cryptic stack dump. That user unfriendly output was caused by a bug, which was fixed last week:
There hasn't been a new release of Arduino CLI since that fix, so the ugly output still occurs when using Arduino CLI 0.20.2, but the fix will be in the next release.
But the bug is only cosmetic and you won't encounter it once you use the correct FQBN.
I want to bypass this prompt, so I tried arduino-cli, while it was still there:
Blockquote
Pyserial is not installed for /home/mianqi/venv_arduino/bin/python. Check the README for installation instructions.
Traceback (most recent call last):
File "/home/mianqi/.arduino15/packages/esp32/tools/esptool_py/3.0.0/esptool.py", line 38, in
import serial
ModuleNotFoundError: No module named 'serial'
Blockquote
although I have changed this line - " #!/usr/bin/env python" in "esptool.py" into "!/usr/bin/env python3".
We are accustomed to having all tool dependencies installed automagically by the Arduino software when we install a boards platform (e.g., esp32:esp32). However, the creators of the ESP32 boards platform did not do that when it comes to the pyserial Python package dependency of their platform for Linux and macOS users (they do bundle it with the Windows installation).
You should be able to install the package by following these instructions:
I tried it, it seemed that just typed "python -m pip install pyserial", one would get prompt (I'm sorry I haven't made screen, when I input the instruments again, it was said"Requirement already satisfied: pyserial in...") that the target has been installed successfully, that didn't work, when you try to compile used "arduino-cli", it would still prompted that "Pyserial is not installed for /home/.../venv_arduino/bin/python.", so you should go into the folder "/home/.../venv_arduino/bin/", and ran "python -m pip install pyserial" again, then it will work. I noted this here, hope it would be useful for others would view this post.