So I bought a cheap nodeMCU v3 to program my esp-12e module and when i try to program it, it shows the error "A fatal esptool.py error occurred: (22, 'Invalid argument')" is there a way to fix this?!
How are you connecting things and what software are you using?
Just using a usb-a to micro use cable, but for some reason the only cable that works (shows up on the computer) doesn’t fully go into the nodemcu’s micro port. also on the back it says "use 9600 bps baud rate for upload" but arduino IDE wont let me do that.
I don't really understand what you are doing, but thinking about the last part re baud rate. I took the verbose messages from the IDE and made a bash file for RPi to load file into Arduino. (Mac and RPi are the same in this respect?) See that the upload has the baud rate as a parameter.
#
# Download a file from current directory to Arduino Nano
#
# ard_load2.sh - the file to load to Ard is given as a parameter.
# given as just the filename without .ino.hex
#
# 21/10/2020 Don't delete the file after, we're using dates now.
#
str1="$1"
str2=""
if [ "$str1" == "$str2" ]; then
echo "P1 should be Arduino filename."
exit
else
echo "Arduino filename is $1"
fi
date "+%d/%m/%Y %R:%S" >> ard_load.log
prg=/home/pi/arduino-1.8.9/hardware/tools/avr/bin/avrdude
cnf=/home/pi/arduino-1.8.9/hardware/tools/avr/etc/avrdude.conf
#prt=/dev/ttyUSB0 # Nano
#prt=/dev/ttyACM0 # Uno
prt=/dev/ttyUSB0 # Nano CH340
afl="$1.ino.hex"
afd=ard_loaded.dat
#
# remove the 'finished' file
rm $afd
#
# Uno:
# $prg -C$cnf -v -patmega328p -carduino -P$prt -b115200 -D -Uflash:w:$afl:i
# Nano:
# $prg -C$cnf -v -patmega328p -carduino -P$prt -b57600 -D -Uflash:w:$afl:i
# Nano(old) for CH340
$prg -C$cnf -v -patmega328p -carduino -P$prt -b57600 -D -Uflash:w:$afl:i
# Mega:
# $prg -C$cnf -v -patmega2560 -cwiring -P$prt -b115200 -D -Uflash:w:$afl:i
#
if [ $? == 0 ]
then
echo "good"
#rm $afl
else
echo "bad"
fi
# create a file to show we've finished.
# doesn't indicate success/fail.
date "+%d/%m/%Y %R:%S" > $afd
#
1 Like
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.