When my original Arduino Uno R3 began to get loose I decided to replace it with a Canaduino Uno with a ch340g driver. It worked fine a year ago then I set it aside for a while. In the interim I upgraded to Linux Mint 21. And now I can't get a sketch to upload no matter what I do. The error message is avrdude: stk500_ recv () : programmer is not responding. I have gone through a step-by-step troubleshooting guide and still no luck. Has anybody else run into this problem?
You possibly have the wrong board selected. I see this every time that happens to me. If the baud is correct which I assume it is you will get terminal messages from the board even if the wrong one is selected. I use that as part of my init where it announces who it is. Helps keep track of older boards.
/dev/ttyS0 is the wrong com port. CH340 ports shows up as /dev/ttyUSBx where x starts at 0.
Dear Icebuster,
Even though I ticked off the box saying, Show all available ports, my IDE only offers me that one port. How can I get around this?
moecat
Use lsusb to see which ports are detected. For further troubleshooting you can use dmesg; you probably have to pipe it through tail; it's too long ago that I used Linux, possibly tail -f.
I tried troubleshooting why I'm getting the wrong port and ended up with an unexpected result. Please see the photo.
Seems I made a mistake yesterday in transcribing the command for the terminal. But when I redid it today I get the same outcome. I don't get a response that begins with "arduino -c" like the troubleshooting guide says I am supposed to. Can anybody tell me what's going on? Thanks for your help.
What was the new command that you issued?
Is you board recognised in the IDE? Does the port that you selected in the IDE disappear when you disconnect the board?
One possible reason of the problems might be that BRLTTY is installed. Uninstall it.
Can you post a link to the troubleshooting guide that you're following?
Note:
I'm no longer a Linux user but I'm quite sure that dmesg and lsusb are more useful than lsof. If lsusb does not show your Arduino (CH340), dmesg might reveal more about the root cause; if it does show, lsof might tell you which application is using it; if not mistaken, you will have to open e.g. the serial monitor.
You should installed either Arduino IDE 1.8.19 or 2.0. I personally use 1.8.19.
If you installed the IDE from the repos, you have an obsolete version which must be removed.
Down load the Arduino IDE from here. https://www.arduino.cc/en/software
If the board has a CH340 USB serial chip, then it is almost certainly named /dev/ttyUSB0. Genuine Arduino boards show up as ttyACM0 but most clones show up as ttyUSB0.
Use the commad 'ls -ltr /dev/tty*' to find new tty (serial) ports. Let everything scroll until it stops. The new port is at the end. This way you do not need to guess the name of new USB serial port.
If a new serial port does not appear, use the command 'lsusb' to show all USB devices. A new USB device should appear when the board is plugged in then disappear when it is unplugged. If not, you have a USB problem. For example, some USB cables do not have data wires so are only useful for charging power. Try different cables and USB ports until you find a combination that works.
The command 'dmesg' or 'sudo dmesg' is also useful. Let everything scroll unti it stops. The interesting lines are at the end so just let the lines scroll past. Whenever a USB device plugged messages should appear mentioning details of the device. If you see messages about brltty or modemmanager you consider removing them unless you are using them.
I do not use lsof to debug these kinds of problems.
Dear Icebuster,
Thank you so much! You've got me up and running.
I did download Arduino IDE 2.0 from their website to begin with.
When I ran ls- ltr/dev/tty*, I got/ dev/tty7 as a response.
When I ran lsbusb, I got Bus 003 Device 003: ID 1a86:7523.
When I ran dmesg, I got pages and pages of text. See the attached photo for what appeared at the bottom of that response.
Needless to say I couldn't make much sense of any of those responses, so I decided to go ahead and remove brltty and modem manager as you suggested. And voila, dev / ttyACM0 finally appeared as a option in the list of ports.
Again, thank you so much for solving this problem for me.
moecat
Just got a 8x8 LED Matrix to do an experiment in Arduino Project Handbook 2 and got this compilation error. See photo. I did download the sketches and libraries from the book website when I started, but they don't seem to appear in the list of libraries. I have tried several times to go through Library manager, but when I type in the missing Library it doesn't come up in the list. And when I try to go via Sketch then Add ZIP Library, that doesn't seem to work either. I get another error message saying Invalid Library. And when I go to Arduino Troubleshooting that doesn't seem to help me much either. Please help!
moecat
For future: please don't post screenshoots of errors or code. For errors
- IDE 1.8.x has a button "Copy error messages".
- In IDE2.0 you right click in the output window and next select *Copy all" from the context menu.
Next paste them here using code tags.
MaxMatrix.h: No such file or directory indicates that you did not install the MaxMatrix library or installed it incorrectly or it is incorrectly spelled (remember, Linux is case sensitive and the name of the include must exactly match the filename.
Dear sterretje
The reason for my doing it that way is that I do my Arduino experiments on an old Linux Mint desktop in my workshop, and I send my emails from a Android tablet. Of course I downloaded the sketches and libraries from the Arduino Project Handbook website, but when I try to install them in my IDE Library I get the following error message:
Error request install ZIP failed with message: 13 INTERNAL : Library install failed: Library not valid.
The thing is, the zip folder I get from their website has both sketches and libraries included in one ZIP folder. Could that be the reason for the error message? And how do I work around that? Thanks for your help.
Moecat
Possible workaround
- Unzip the zip to some directory.
- Find the directory that contains MaxMatrix.h
- Copy that directory (possibly called MaxMatrix) to the libraries directory in the sketchbook directory (not the sketch directory).
I suspect it is.
One day that will become problematic if we need to see a complete sketch or the complete error output when compiling a sketch.
Deer Sterretje,
I finally got Dictation for Gmail installed on my Linux Mint computer so now I hope to be able to do what you asked me. My first problem today was trying to get my Arduino IDE sketch back to default. But no matter how many times I hit the Undo button it doesn't seem to go back all the way. Does that mean I'll have to uninstall the IDE and reinstall it?
And now for my attempt at sending you the error message I got today.
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:110:11: error: no matching function for call to 'MaxMatrix::MaxMatrix()'
MaxMatrix m9data, load, clock, maxInUse);
^~~~~~
In file included from /home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:1:0:
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:39:5: note: candidate: MaxMatrix::MaxMatrix(byte, byte, byte, byte)
MaxMatrix(byte data, byte load, byte clock, byte num);
^~~~~~~~~
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:39:5: note: candidate expects 4 arguments, 0 provided
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate: constexpr MaxMatrix::MaxMatrix(const MaxMatrix&)
class MaxMatrix
^~~~~~~~~
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate expects 1 argument, 0 provided
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate: constexpr MaxMatrix::MaxMatrix(MaxMatrix&&)
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate expects 1 argument, 0 provided
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:110:20: error: conflicting declaration 'MaxMatrix load'
MaxMatrix m9data, load, clock, maxInUse);
^~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:106:5: note: previous declaration as 'int load'
int load = 9; // Pin connected to CS pin of MAXIM7219 module
^~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:110:27: error: conflicting declaration 'MaxMatrix clock'
MaxMatrix m9data, load, clock, maxInUse);
^~~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:107:5: note: previous declaration as 'int clock'
int clock = 10; // Pin connected to CLK pin of MAXIM7219 module
^~~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:110:43: error: expected initializer before ')' token
MaxMatrix m9data, load, clock, maxInUse);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void setup()':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:115:3: error: 'm' was not declared in this scope
m.init(); // Start module
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void loop()':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:127:3: error: 'm' was not declared in this scope
m.shiftLeft(false, true);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void printCharWithShift(char, int)':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:136:3: error: 'm' was not declared in this scope
m.writeSprite(maxInUse * 8, 0, buffer);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void printString(char*)':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:155:5: error: 'm' was not declared in this scope
m.writeSprite(col, 0, buffer);
^
exit status 1
Compilation error: no matching function for call to 'MaxMatrix::MaxMatrix()'
Most applications have a limit on the number of undo actions.
No. Assuming that you are working on an existing sketch from the zip that you did download, I suggest that you unzip the downloaded zip again to another location. You can than delete the sketch that you were working on (/_4_LED_Scrolling_Marquee) by deleting the directory /home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee
and copy the _4_LED_Scrolling_Marquee
directory from the new extracted zip to the directory /home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/
.
It could be something like this
/home/moe/
|
+-- downloaded zip
|
+-- newly extracted downloaded zip
| |
| +-- _4_LED_Scrolling_Marquee
| | |
| | +-- _4_LED_Scrolling_Marquee.ino
| +-- other example sketch
| |
| +-- and another example sketch
|
+-- Arduino
| |
| +-- libraries
| | |
| | +-- 08 Sketches and Libraries
| | | |
| | | +- sketches
| | | | |
| | | | +-- a sketch
| | | | +-- another sketch
and after the copy
/home/moe/
|
+-- downloaded zip
+-- newly extracted downloaded zip
| |
| +-- _4_LED_Scrolling_Marquee
| | |
| | +-- _4_LED_Scrolling_Marquee.ino
| +-- other example sketch
| |
| +-- and another example sketch
|
+-- Arduino
| |
| +-- libraries
| | |
| | +-- 08 Sketches and Libraries
| | | |
| | | +- sketches
| | | | |
| | | | +-- a sketch
| | | | |
| | | | +-- another sketch
| | | | |
| | | | +-- _4_LED_Scrolling_Marquee
| | | | | |
| | | | | +-- _4_LED_Scrolling_Marquee.ino
Note that I don't know how your system is organised so it's just an example based on the information in your error message.
Can you tell me where you downloaded the zip file from? So I can install it to be able to help further if needed.
This topic started with upload problems? Did you sort those out?
Deer sterretje,
In the beginning I thought I had a uploading problem but I think it was only due to the fact that I didn't bother to verify the sketch before attempting to upload it. Now it seems to be only a compilation problem. I downloaded the zip file from www.nostarch.com/arduino handbook2. I'll send you a couple of photos from my tablet to show you what does not make sense to me with the download.
Anyway I tried to follow your instructions as best I could but still ended up with an error message which I will paste below. Thanks again for being so incredibly helpful.
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:112:11: error: no matching function for call to 'MaxMatrix::MaxMatrix()'
MaxMatrix m9data, load, clock, maxInUse);
^~~~~~
In file included from /home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:1:0:
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:39:5: note: candidate: MaxMatrix::MaxMatrix(byte, byte, byte, byte)
MaxMatrix(byte data, byte load, byte clock, byte num);
^~~~~~~~~
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:39:5: note: candidate expects 4 arguments, 0 provided
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate: constexpr MaxMatrix::MaxMatrix(const MaxMatrix&)
class MaxMatrix
^~~~~~~~~
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate expects 1 argument, 0 provided
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate: constexpr MaxMatrix::MaxMatrix(MaxMatrix&&)
/home/moe/Arduino/libraries/MaxMatrix/MaxMatrix.h:27:7: note: candidate expects 1 argument, 0 provided
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:112:20: error: conflicting declaration 'MaxMatrix load'
MaxMatrix m9data, load, clock, maxInUse);
^~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:108:5: note: previous declaration as 'int load'
int load = 9; // Pin connected to CS pin of MAXIM7219 module
^~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:112:27: error: conflicting declaration 'MaxMatrix clock'
MaxMatrix m9data, load, clock, maxInUse);
^~~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:109:5: note: previous declaration as 'int clock'
int clock = 10; // Pin connected to CLK pin of MAXIM7219 module
^~~~~
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:112:43: error: expected initializer before ')' token
MaxMatrix m9data, load, clock, maxInUse);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void setup()':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:117:3: error: 'm' was not declared in this scope
m.init(); // Start module
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void loop()':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:129:3: error: 'm' was not declared in this scope
m.shiftLeft(false, true);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void printCharWithShift(char, int)':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:138:3: error: 'm' was not declared in this scope
m.writeSprite(maxInUse * 8, 0, buffer);
^
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino: In function 'void printString(char*)':
/home/moe/Arduino/libraries/08 Sketches and Libraries/sketches/_4_LED_Scrolling_Marquee/_4_LED_Scrolling_Marquee.ino:157:5: error: 'm' was not declared in this scope
m.writeSprite(col, 0, buffer);
^
exit status 1
Compilation error: no matching function for call to 'MaxMatrix::MaxMatrix()'
Notice that in the photo of the downloaded Library the Max Matrix Library does not appear but instead Max 7219. I tried substituting Max 7219 for the other but that didn't work for me. I also tried downloading just Max Matrix.h online and that also didn't work.
And in the other photo showing the sketch with all that space at the top, it doesn't look right to me. It seems that every time I try to reload the new version of the sketch I keep getting the old one back again. What's going on?
- Download Max7219 from GitHub - riyas-org/max7219: Led matrix library.
- Extract the zip to a convenient location.
- Copy the directory
MaxMatrix
from the extracted zip to the libraries directory in the sketchbook directory.
Your libraries directory should now look like the one below. The Arduino directory in below is /home/moe/Arduino
. I`ve also copied some of the sketches
\---Arduino
+---08 Sketches
| +---_1_LED_Light_Bar
| | _1_LED_Light_Bar.ino
| |
| +---_2_Light_Activated_Night_Light
| | _2_Light_Activated_Night_Light.ino
| |
| +---_3_Seven_Segment_Countdown_Timer
| | _3_Seven_Segment_Countdown_Timer.ino
| |
| \---_4_LED_Scrolling_Marquee
| _4_LED_Scrolling_Marquee.ino
|
\---libraries
| readme.txt
|
\---MaxMatrix
| keywords.txt
| MaxMatrix.cpp
| MaxMatrix.h
|
\---example
max7219test_scrol.ino
The _4_LED_Scrolling_Marquee
sketch will now compile without errors. With my setup, it throws a warning (for the MaxMatrix library) that in this case can be ignored.
Note:
The directory 08 Sketches and Libraries
has no business in /home/moe/Arduino/libraries
; I suggest that you delete it completely. When you need a library, take it from the extracted aph2_resources.zip
and copy it to /home/moe/Arduino/libraries
.
Well I suppose I'm making progress, as I was able to get past the compiling stage. But when I go to upload it I get an error message which I believe has to do with it's not recognizing the port required for my Canaduino board that uses the CH341G driver. if you go through the thread you will see how I had previously solved the problem by uninstalling brltty and modem manager. But now the problem has recurred for some strange reason. Here is the current error message.
Sketch uses 4252 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 314 bytes (15%) of dynamic memory, leaving 1734 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Failed uploading: uploading error: exit status 1