Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to Arduino #28

Closed
ajn9494 opened this issue May 30, 2014 · 14 comments
Closed

Can't connect to Arduino #28

ajn9494 opened this issue May 30, 2014 · 14 comments

Comments

@ajn9494
Copy link

ajn9494 commented May 30, 2014

I'm having trouble connecting the Arduino. I'm getting a similar error that another user on the forums had with:

ArrayIndexOutOfBoundsException:1

Exception in thread "Animation Thread" java.lang.ArrayIndexOutOfBoundsException: 1
at Pwdr_GUI_V0_3.startSerial (Pwdr_GUI_V0_3.java:498)
at Pwdr_GUI_V0_3.mouseClicked (Pwdr_GUI_V0_3.java:1056)
at processing.core.PApplet.handleMouseEvent (Unknown Source)
at processing.core.PApplet.dequeueMouseEvent (Unknown Source)
at processing.core.PApplet.handleDraw (Unknown Source)
at processing.core.PApplet.run (Unknown Source)
at java.lang.Thread.run(Thread.java:662)

It seems that the person who had that same problem before, atticdweller, got past it.

When I try to compile and upload the firmware, I seems to go through. Although, the 'L' led on the Arduino keeps blinking. (To my understanding, that isn't supposed to happen. it's supposed to not blink). I'm using PwdrFirmware2_0_mk1. Processing version 1.5.1.

@ajn9494 ajn9494 closed this as completed May 30, 2014
@ajn9494 ajn9494 reopened this May 30, 2014
@ajn9494 ajn9494 changed the title Firmware error; even with Boreaz's updated files Can't connect to Arduino May 30, 2014
@Boreaz
Copy link

Boreaz commented May 31, 2014

Hi ajn9494, this bug occurs when choose incorrect arduino port. At first, the arduino program must be closed before processing starts and microcontroller must be connected, otherwise processing unable to see arduino port. Pwdr GUI, shows that the COM1 available even if arduino disconnected and this bug occurs when you clicked it. But if arduino connected, GUI now shows that COM1 and COM4 (may differ in your system) available, so currently one of them is correct arduino port, it's COM1 for me.
P.S. the blinking of the L led may be changed in arduino firmware (pin 13) in this version it's blinking when arduino standby and lights permanently when printing.

@ajn9494
Copy link
Author

ajn9494 commented Jun 2, 2014

So you're saying that after I upload the firmware, I leave the USB connected, close Arduino program, and then open and run the Processing program? That's what I've been doing, but I'm still having trouble.

I better back up a minute too. The Arudino that is currently wired to the printer has been giving me an error code when uploading the firmware.

avrdude: stk500v2_ReceiveMessage(): timeout (//for about 5 or so lines)
avrdude: stk500v2_getsync(): timeout communicating with programmer.

I saw some forums about it saying something about reprogramming the 16u2 firmware with a DFU bootloader. Not sure about all that, but figured I'd mention.

Anyway, I had a second Arduino Mega and tried with that. Not wired in, just the USB. The firmware uploaded successfully. Also, the TX and RX lights were lit as I believe they were supposed to be. (The one currently wired in didn't even give me that). I tried to open the GUI again in Processing with the same steps I described above. It still wouldn't read the Arduino and would crash the program.

And just for the record, for the wired in Arduino, the GUI will display the port its connected to COM 3, but that will be the ONLY port shown. Even though is the correct port and NOT COM 1, it crashes. For the other Arduino, its COM 4 instead of COM 3. Figured I mention that too.

@Boreaz
Copy link

Boreaz commented Jun 3, 2014

Hm, I did not pay attention before, but now decided to check. Maybe my win7 buggy, the device manager shows that the arduino is connected to COM4 but the GUI sees it as connected to COM1
device-manager
Anyway all works perfectly if I choose incorrect COM1, and crash when i choose correct COM4, maybe it specific only for my system.

And I do not understand, the RX and TX blinking when uploading firmware? Or lights when you trying to connect from GUI? On my arduino when it's standing by and GUI connected, only LEDs ON lights permanently and L blinking.

@Pwdr
Copy link
Owner

Pwdr commented Jun 3, 2014

@ajn9494 Try hardcoding your COM port in the Processing progam:

Serial.pde line 9: arduinoSerial = new Serial(this, Serial.list()[
selectPort], 9600);

Change selectPort with your COM port (e.g. COM3)

@micheal That's a weird bug, probably related to Windows.

On Tue, Jun 3, 2014 at 8:07 AM, Michael notifications@github.com wrote:

Hm, I did not pay attention before, but now decided to check. Maybe my
win7 buggy, the device manager shows that the arduino is connected to COM4
but the GUI sees it as connected to COM1
[image: device-manager]
https://cloud.githubusercontent.com/assets/3283492/3156442/21dfef34-eadd-11e3-99b1-0272db3e3c11.png
Anyway all works perfectly if I choose incorrect COM1, and crash when i
choose correct COM4, maybe it specific only for my system.

And I do not understand, the RX and TX blinking when uploading firmware?
Or lights when you trying to connect from GUI? On my arduino when it's
standing by and GUI connected, only LEDs ON lights permanently and L
blinking.


Reply to this email directly or view it on GitHub
#28 (comment).

@Pwdr
Copy link
Owner

Pwdr commented Jun 3, 2014

Is the AccepStepper library properly installed?

On Fri, May 30, 2014 at 11:46 PM, ajn9494 notifications@github.com wrote:

Reopened #28 #28.


Reply to this email directly or view it on GitHub
#28 (comment).

@ajn9494
Copy link
Author

ajn9494 commented Jun 3, 2014

Hardcoding isn't working for either Arduino. It says "Cannot find anything named COM4" (COM3 for the wired in Arduino). As for the library, it should be alright. Is there a way to test if it was installed correctly?

@Pwdr
Copy link
Owner

Pwdr commented Jun 4, 2014

Have you tried hardcoding every COM port (just from 1 to 5 or so)?

When the program compiles correctly, the AccelStepper library is installed
correctly.

On Tue, Jun 3, 2014 at 6:12 PM, ajn9494 notifications@github.com wrote:

Hardcoding isn't working for either Arduino. It says "Cannot find anything
named COM4" (COM3 for the wired in Arduino). As for the library, it should
be alright. Is there a way to test if it was installed correctly?


Reply to this email directly or view it on GitHub
#28 (comment).

@ajn9494
Copy link
Author

ajn9494 commented Jun 4, 2014

I think that's closer. But, what happens how is under the FloodFIll tab, at the very bottom, line 87, it highlights the closing curly brace and gives a new error.

syntax error, maybe a missing ] character

expecting RBRACK, found ','
processing.app.SketchException: Syntax error, maybe a missing ] character?
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:300)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:197)
at processing.mode.java.JavaBuild.build(JavaBuild.java:156)
at processing.mode.java.JavaBuild.build(JavaBuild.java:135)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:176)
at processing.mode.java.JavaEditor$20.run(JavaEditor.java:481)
at java.lang.Thread.run(Thread.java:662)

@Pwdr
Copy link
Owner

Pwdr commented Jun 5, 2014

At least it's not a missing ']'. Can you reproduce this error?

On Wed, Jun 4, 2014 at 3:19 PM, ajn9494 notifications@github.com wrote:

I think that's closer. But, what happens how is under the FloodFIll tab,
at the very bottom, line 87, it highlights the closing curly brace and
gives a new error.

syntax error, maybe a missing ] character

expecting RBRACK, found ','
processing.app.SketchException: Syntax error, maybe a missing ] character?
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:300)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:197)
at processing.mode.java.JavaBuild.build(JavaBuild.java:156)
at processing.mode.java.JavaBuild.build(JavaBuild.java:135)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:176)
at processing.mode.java.JavaEditor$20.run(JavaEditor.java:481)
at java.lang.Thread.run(Thread.java:662)


Reply to this email directly or view it on GitHub
#28 (comment).

@ajn9494
Copy link
Author

ajn9494 commented Jun 5, 2014

Yes, it happens repeatedly. I'll show you.

serial

untitled

@Boreaz
Copy link

Boreaz commented Jun 5, 2014

@ajn9494 I think the best way to check that firmware was correctly uploaded is use serial monitor, just push tools>serial monitor in arduino program, if the arduino controller runs the program, you must see message like this, after few seconds
serial_monitor
or SD initialization failed! if SD card not connected, and you may send commands to arduino like x, X, and see how coordinates will change.
If that not happens, then firmware uploaded not correctly, or serial port is busy, or the arduino is broken.

@Pwdr
Copy link
Owner

Pwdr commented Jun 5, 2014

You induced an bug by adding the pseudo array for the COM ports

Change the line:

arduinoSerial = new Serial(this, Serial.list()[COM1, COM2, COM3,
COM4, COM5], 9600);

With this:

arduinoSerial = new Serial(this, "COM1", 9600);

Or of course the COM port you need.

When connecting the GUI to the Arduino Mega doesn't work, use
Micheal's top tip of using the Arduino IDE's serial monitor.

On Thu, Jun 5, 2014 at 4:04 PM, Michael notifications@github.com wrote:

@ajn9494 https://github.com/ajn9494 I think the best way to check that
firmware was correctly uploaded is use serial monitor, just push
tools>serial monitor in arduino program, if the arduino controller runs the
program, you must see message like this, after few seconds
[image: serial_monitor]
https://cloud.githubusercontent.com/assets/3283492/3188215/a88a3846-ecb8-11e3-9b39-4da5bc910178.png
or SD initialization failed! if SD card not connected, and you may send
commands to arduino like x, X, and see how coordinates will change.
If that not happens, then firmware uploaded not correctly, or serial port
is busy, or the arduino is broken.


Reply to this email directly or view it on GitHub
#28 (comment).

@ajn9494
Copy link
Author

ajn9494 commented Jun 5, 2014

Changing that line of code was successful! The GUI is now able to read both of my Arduinos. Thanks a million. :) :)

Now, I am still having trouble with the Arduino that is currently hooked up to the printer. I'm still getting timeout error; and when I use the serial monitor, nothing appears.

The error code is the same as what I had above in my second comment:

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

I saw on some other computer forums something about "16u2" and reprogramming the Arduino
with "a DFU bootloader". Not sure what all that means, but figured I'd mention.

I'm not as concerned about this since I do have the other Arduino that IS
reading the firmware. But, I wouldn't mind learning why this one is having trouble.

@ajn9494 ajn9494 closed this as completed Jun 10, 2014
@h4ckninja
Copy link

I'm not the Micheal you are looking for. I like Arduino, but that's not me. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants