Arduino Mega 2560 "Failed to Send Command to Seriel Port"

Hello Everyone,


This is my first post on this forum so my apologies in advanced if the format isn't 100% correct. About 5 weeks ago I started a college course titled "CEIS101 Intro to tech and Info Systems".

I've sailed through the class but I ran into one error with my Ardunio Mega 2560. We were given a PDF (It is attached) and are shown a diagram on how to assemble the "smart home system". After putting it together I am supposed to connect the system to my computer and run a series of code that is also given to us and attached in the PDF.
When connecting the Arduino and running the code, it throws me a series of error messages that are attached at the bottom of the page that essentially say "Failed to send command to seriel port". I'm extremely new to the Arduino and I'm not quite sure if this is a coding error or a hardware error with my project.

I was hoping someone on here can point me in the right direction. Thanks so much in advance.


Error Messages I received:
Arduino: 1.8.13 (Mac OS X), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 4182 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 232 bytes (2%) of dynamic memory, leaving 7960 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't open device "/dev/cu.usbmodem14301": No such file or directory
ioctl("TIOCMGET"): Inappropriate ioctl for device
ioctl("TIOCMGET"): Inappropriate ioctl for device
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: Bad file descriptor
avrdude: stk500_send(): failed to send command to serial port
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
the selected serial port avrdude: stk500v2_getsync(): timeout communicating with programmer
does not exist or your board is not connected


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

http://www.mediafire.com/folder/uz85ftxtyevdq/Arduino_Project
Last edited on
OK, so where are the two attachments?
http://www.mediafire.com/folder/uz85ftxtyevdq/Arduino_Project

Inside is the project, sorry about that.
Last edited on
This is probably a key message:

avrdude: ser_open(): can't open device "/dev/cu.usbmodem14301": No such file or directory


You need to track down why the device is not found.

Does your development board have a usbmodem?

Yes, it is a USB Type B that is connected to the device it self that is adapted into a USB Type C that connects to my computer.

Here is a link to the PDF of the project I was assigned.
Inside is every line of code that is "supposed" to be working.

http://www.mediafire.com/folder/uz85ftxtyevdq/Arduino_Project
Last edited on
The problem is not the with the PC but with the embedded processor. For some reason the "driver" for the hardware is not being found.

Are you sure that "/dev/cu.usbmodem14301" is actually correct? Could there be a typo on that line? Perhaps try "/dev/cu/usbmodem14301".

I just ran the program on my PC instead of my Mac and the error seems to be solved. Thank you so much for your help. The issue appears that my Mac was not picking up from the right location on my computer. When running the code on my PC the error completely went away.
Topic archived. No new replies allowed.