1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Solved Unable to connect to printer in MC or Arduino

Discussion in 'Troubleshooting' started by Tinino, Aug 2, 2017.

  1. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Hello. I attempted to update my firmware through multiple versions of arduino and it seems that somewhere along the line I messed something up. The printer still connects to my computer through USB and under Device Manager the device shows up as being connected through COM4, however in matter control and arduino it states the port is already in use. To the best of my knowledge, that's incorrect...it isn't already in use by anything, I've gone as far as uninstalling all versions of Arduino I had on my computer including all the libraries, I've closed any software that could be running in the background, and restarted my computer as well as the printer countless times, I've also tried switching to different USB cables with no success. I've tried connecting with a few versions of Arduino (New, old, middle of the road). I'm honestly at a loss on this one. I'm not sure if perhaps the board got fried, I don't think so. I popped open the back and the arduino has a yellow light, when I plug/unplug the USB cable a green light comes on quickly on the Mega 2560, as stated above it still shows up in my device manager, but the port is getting noise, or it's just being tempermental/doesn't want to connect anymore. At this point it's not as simple as just 'factory resetting' with stock firmware because I can't do that because it doesn't connect.

    I'm not sure if there's an error log I can provide or any other details, I'll try to be as specific as possible for you so it's not a pain to help me. If there's anyone out there who's more seasoned than I am that could shed some light on this, or make any recommendations on how to force a connection or force a reset of the board itself that'd be awesome. Thanks a ton to anyone willing to take the time to read this and help me out.
     
  2. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,757
    Likes Received:
    2,339
    an error log from arduino would be a good start as well as exactly what printer model you have (you have to be exact) and what firmware your using.
     
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,915
    Likes Received:
    7,338
    It is remotely possible that it is a bad Arduino (or one with a bad bootloader). Get the details @Geof mentioned and we can go from there (even out of warranty the Arduino Mega is a cheap board).
     
    #3 mark tomlinson, Aug 2, 2017
    Last edited: Aug 2, 2017
  4. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Sounds good. Thank you both for the speedy replies. I've gotta get to work soon so I'll post a reply this evening when I get an opportunity with the requested information. Thanks again!
     
    Geof likes this.
  5. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Code:
    Sketch uses 134,142 bytes (51%) of program storage space. Maximum is 258,048 bytes.
    Global variables use 4,443 bytes (54%) of dynamic memory, leaving 3,749 bytes for local variables. Maximum is 8,192 bytes.
    avrdude: ser_open(): can't open device "\\.\COM4": Access is denied.
    
    
    avrdude: ser_drain(): read error: The handle is invalid.
    
    
    processing.app.debug.RunnerException
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:125)
        at processing.app.Sketch.upload(Sketch.java:1719)
        at processing.app.Sketch.exportApplet(Sketch.java:1625)
        at processing.app.Sketch.exportApplet(Sketch.java:1597)
        at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
        at java.lang.Thread.run(Unknown Source)
    Caused by: processing.app.debug.RunnerException: Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
        at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:111)
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:123)
        ... 5 more
    
    Code:
    Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    Sketch uses 134,142 bytes (51%) of program storage space. Maximum is 258,048 bytes.
    
    Global variables use 4,443 bytes (54%) of dynamic memory, leaving 3,749 bytes for local variables. Maximum is 8,192 bytes.
    
    avrdude: ser_open(): can't open device "\\.\COM4": Access is denied.
    
    
    avrdude: ser_drain(): read error: The handle is invalid.
    
    
    processing.app.debug.RunnerException
    
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:125)
    
        at processing.app.Sketch.upload(Sketch.java:1719)
    
        at processing.app.Sketch.exportApplet(Sketch.java:1625)
    
        at processing.app.Sketch.exportApplet(Sketch.java:1597)
    
        at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
    
        at java.lang.Thread.run(Unknown Source)
    
    Caused by: processing.app.debug.RunnerException: Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
    
        at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:111)
    
        at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:123)
    
        ... 5 more
    
    processing.app.SerialException: Error opening serial port 'COM4'.
    
        at processing.app.Serial.<init>(Serial.java:145)
    
        at processing.app.Serial.<init>(Serial.java:90)
    
        at processing.app.SerialMonitor.open(SerialMonitor.java:93)
    
        at processing.app.Editor.handleSerial(Editor.java:2542)
    
        at processing.app.Editor$17.actionPerformed(Editor.java:686)
    
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    
        at javax.swing.AbstractButton.doClick(Unknown Source)
    
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
    
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
    
        at java.awt.Component.processMouseEvent(Unknown Source)
    
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
    
        at java.awt.Component.processEvent(Unknown Source)
    
        at java.awt.Container.processEvent(Unknown Source)
    
        at java.awt.Component.dispatchEventImpl(Unknown Source)
    
        at java.awt.Container.dispatchEventImpl(Unknown Source)
    
        at java.awt.Component.dispatchEvent(Unknown Source)
    
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    
        at java.awt.Container.dispatchEventImpl(Unknown Source)
    
        at java.awt.Window.dispatchEventImpl(Unknown Source)
    
        at java.awt.Component.dispatchEvent(Unknown Source)
    
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    
        at java.awt.EventQueue.access$200(Unknown Source)
    
        at java.awt.EventQueue$3.run(Unknown Source)
    
        at java.awt.EventQueue$3.run(Unknown Source)
    
        at java.security.AccessController.doPrivileged(Native Method)
    
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    
        at java.awt.EventQueue$4.run(Unknown Source)
    
        at java.awt.EventQueue$4.run(Unknown Source)
    
        at java.security.AccessController.doPrivileged(Native Method)
    
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
    
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    
        at java.awt.EventDispatchThread.run(Unknown Source)
    
    Caused by: jssc.SerialPortException: Port name - COM4; Method name - openPort(); Exception type - Port busy.
    
        at jssc.SerialPort.openPort(SerialPort.java:164)
    
        at processing.app.Serial.<init>(Serial.java:141)
    
        ... 42 more
    
      This report would have more information with
      "Show verbose output during compilation"
      enabled in File > Preferences.
    
    
    Printer Model: Robo 3D R1+
    Firmware Version: Stock Release v2.0


    I hope this helps and again thank you guys for taking the time out of your day to read through these logs which I don't fully understand. I hope it yields the information you are looking for and hopefully gives some results on what I need to do here to get up and going.

    Thank you!
     
  6. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @Tinino reinstall the latest version of the Arduino IDE from http://arduino.cc and make sure you install the USB drivers too.
     
    Geof likes this.
  7. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,757
    Likes Received:
    2,339
    Yep thats where I would start. With the new arduino and drivers installed you need to select the correct com port, ensure you have the amega 2560 selected as the board and try again (ensure your standard release 2.0 is R1+ and not a R1 standard release, there is a difference )
     
  8. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,915
    Likes Received:
    7,338
    https://forum.arduino.cc/index.php?topic=351518.0

    https://forum.arduino.cc/index.php?topic=358363.0


    Either you have the wrong board type chosen or the wrong COM port or a bad driver loaded or...
    A bad Arduino :)

    If you had another Arduino Mega you could try then you could rule out the last one. I am leaning towards a bad card, but check the installation of everything as suggested (even in those threads that is a suggestion that works).
     
    Geof likes this.
  9. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Thank you all for the replies. I'll give it a shot this evening and see if I can get some results. Worst case I'll just buy a new board, mega 2560's are pretty cheap, I just hate to replace things when I don't have to.
     
    Geof likes this.
  10. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    This sounds a little familiar from here and here.
     
  11. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Steps taken in an attempt to resolve:

    1. Viewed all links posted in this thread
    2. Read over all solutions offered
    3. Found a solution which made the most sense/seemed tailored and relatively guided to the proper info needed
    4. Downloaded Windows device drivers for Arduino UNO from: (Link Omitted)
    5. Drivers were already installed however I considered the possibility of a bad driver, so I uninstalled and then proceeded to reinstall
    6. Uninstalled old versions of Arduino IDE
    7. Installed Arduino 1.8.3 IDE via the windows installer (Current/Most Recent version as of today 8/3/2017)
    8. Loaded the ROBO3DR1PLUSV2.ini file into arduino (I made sure this was the R1+ version, not the standard R1), file was downloaded from: (Link Omitted)
    9. Selected Arduino/Genuino MEGA 1280/2560 in Arduino 1.8.3 IDE
    10. Selected the MEGA 2560 processor
    11. Selected COM4 (Port listed under ports in Device Manager and the one that shows up in Arduino 1.8.3 IDE)
    12. Left the programmer the same (AVRISP MkII)
    13. Verified the file after loading in Arduino 1.8.3 IDE
    14. Received the following error message:
    15. [[[To be determined]]]
    Code:
    Arduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:2564:0: warning: "X_MAX_PIN" redefined
    
    #define X_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:445:0: note: this is the location of the previous definition
    
         #define X_MAX_PIN           2
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:2565:0: warning: "Y_MAX_PIN" redefined
    
    #define Y_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:451:0: note: this is the location of the previous definition
    
         #define Y_MAX_PIN          15
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:2566:0: warning: "Z_MAX_PIN" redefined
    
    #define Z_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\BlinkM.cpp:5:
    
    sketch\pins.h:457:0: note: this is the location of the previous definition
    
         #define Z_MAX_PIN          19
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:2564:0: warning: "X_MAX_PIN" redefined
    
    #define X_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:445:0: note: this is the location of the previous definition
    
         #define X_MAX_PIN           2
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:2565:0: warning: "Y_MAX_PIN" redefined
    
    #define Y_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:451:0: note: this is the location of the previous definition
    
         #define Y_MAX_PIN          15
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:2566:0: warning: "Z_MAX_PIN" redefined
    
    #define Z_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\ConfigurationStore.cpp:1:
    
    sketch\pins.h:457:0: note: this is the location of the previous definition
    
         #define Z_MAX_PIN          19
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:2564:0: warning: "X_MAX_PIN" redefined
    
    #define X_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:445:0: note: this is the location of the previous definition
    
         #define X_MAX_PIN           2
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:2565:0: warning: "Y_MAX_PIN" redefined
    
    #define Y_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:451:0: note: this is the location of the previous definition
    
         #define Y_MAX_PIN          15
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:2566:0: warning: "Z_MAX_PIN" redefined
    
    #define Z_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\MarlinSerial.cpp:23:
    
    sketch\pins.h:457:0: note: this is the location of the previous definition
    
         #define Z_MAX_PIN          19
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:2564:0: warning: "X_MAX_PIN" redefined
    
    #define X_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:445:0: note: this is the location of the previous definition
    
         #define X_MAX_PIN           2
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:2565:0: warning: "Y_MAX_PIN" redefined
    
    #define Y_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:451:0: note: this is the location of the previous definition
    
         #define Y_MAX_PIN          15
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:2566:0: warning: "Z_MAX_PIN" redefined
    
    #define Z_MAX_PIN          -1
    
    ^
    
    In file included from sketch\Marlin.h:23:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    sketch\pins.h:457:0: note: this is the location of the previous definition
    
         #define Z_MAX_PIN          19
    
    ^
    
    sketch\Marlin_main.cpp:2192:36: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
    
             LCD_MESSAGEPGM(MACHINE_NAME" "MSG_OFF".");
    
                                        ^
    
    In file included from sketch\SdFile.h:27:0,
    
                     from sketch\cardreader.h:8,
    
                     from sketch\Marlin_main.cpp:44:
    
    SdBaseFile.h:38: error: using typedef-name 'fpos_t' after 'struct'
    
    struct fpos_t {
    
            ^
    
    In file included from sketch\Marlin.h:10:0,
    
                     from sketch\Marlin_main.cpp:30:
    
    c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdio.h:950:33: note: 'fpos_t' has a previous declaration here
    
    __extension__ typedef long long fpos_t;
    
                                     ^
    
    sketch\Marlin_main.cpp: In function 'void loop()':
    
    sketch\Marlin_main.cpp:588:49: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    
                      card.openFile("robo~1.gco",true);
    
                                                     ^
    
    sketch\Marlin_main.cpp: In function 'void set_bed_level_equation_lsq(double*)':
    
    sketch\Marlin_main.cpp:884:36: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
    
         planeNormal.debug("planeNormal");
    
                                        ^
    
    exit status 1
    using typedef-name 'fpos_t' after 'struct'
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    

    I do recall reading somewhere about fpos_t no longer working and to change to FatPos_t and that may correct the issue, however I am not going to do that at this time and leave it to you folks who are better versed at this to analyze the error and make a recommendation. Thank you all again for taking the time to reply and help me with this.
     
  12. Geof

    Geof Volunteer Moderator
    Staff Member

    Joined:
    Nov 9, 2015
    Messages:
    6,757
    Likes Received:
    2,339
    that is the issue. There is a thread (sound like you read) on how to fix this.
     
    Tinino likes this.
  13. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,915
    Likes Received:
    7,338
    Yep, that problem is because the newer Arduino compiler has gotten stricter on the language format (it was actually wrong before and now it is exposing a bug). If you make that 2 line change you should be fine. If you run into issues I can post the corrected files for you (there are two).
     
    Tinino likes this.
  14. OutsourcedGuru

    OutsourcedGuru Active Member

    Joined:
    Jun 3, 2017
    Messages:
    752
    Likes Received:
    141
    Here's the one about the C++ error: github
    (Needs a single space before MSG)

    Code:
    LCD_MESSAGEPGM(MACHINE_NAME" " MSG_OFF".");
     
    Tinino likes this.
  15. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    @OutsourcedGuru not applicable, the error is as stated by @mark tomlinson using an outdated construct so a simple two line edit will fix this.

    All the duplicate defines are warnings and can be ignored, the only error stopping compilation is the constant error. Maybe you meant that answer for a different thread.
     
    Tinino likes this.
  16. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    I did actually check out that thread, I was reading through some old threads a few days ago and passed over it, interestingly enough. I went through the file and replaced any and all instance of fpos_t that I could find with FatPos_t. I'm pretty sure maybe I missed one somewhere because when I verify the file it's still giving me some errors. @mark tomlinson Would it be any trouble for you to post or direct me to where I can find the repaired firmware for IDE v1.8.3?

    Thank you all again for the help and your replies it's really appreciated.
     
    Geof likes this.
  17. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,915
    Likes Received:
    7,338
    Attached.

    Those two are all the editing needed.
     

    Attached Files:

    Geof likes this.
  18. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    Oh you're quick. Alright I am gonna give this a shot real quick *rolls out of bed*. I'll get back to you on this in a few minutes.
     
    Geof likes this.
  19. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,915
    Likes Received:
    7,338
    Clearly I had those already staged for someone else who previously had this problem :)
     
    Geof and Tinino like this.
  20. Tinino

    Tinino New Member

    Joined:
    Jul 31, 2017
    Messages:
    11
    Likes Received:
    5
    (I am sorry in advance that I am so much trouble hahaha, one thing after another here). I feel like I'm making progress however now I am getting this error upon verifying the file. It does appear it is able to connect to the COM port now, I think reinstalling the broken drivers for the Arduino UNO fixed the issue, however along with the original fpos_t error I was getting an error from what looks like watchdog.cpp and marlin.h from #define Y_MAX_PIN, X_MAX_PIN, and Z_MAX_PIN. It states they are redefined, I cannot seem to tell if this is an error or if this is normal for the compiler. Here's the error:
     

Share This Page