-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Firmata fails to start a connection with Arduino mega2560 #374
Comments
Hi @matipan thanks for the detailed report. I personally do not have a MEGA2560 to test with, so a little hard to diagnose your problem. Any way you can provide the call stack at the point where it hangs? |
Hi @deadprogram, thanks for the quick response! Sure, this is the stack trace I could get:
The problem is that this stack trace is not complete, this is right before it hangs. I don't know which Do you know how I can do that? Thanks! |
So I created a Docker image with all the things I needed to run the program.
to run the program inside the container, and It gets stuck in the same point. So it's not a problem of Mac OS apparently |
Hi again! I tried running the same program on an Arduino UNO and it worked. So it's either an issue with the mega2560 in general or with mine in particular! |
I just tested blink with my mega2560 and all seems to work. It certainly may be your board. I'm running on OSX Sierra with go 1.7.3. |
Well that's weird, it worked once, and now no longer works. Will try to see what's going on. |
Anyone find out more information on this? |
Hi there, no updates here. I don't know what else I can do though |
Hi all, I'm having a recurrent hang-at-connect on a Arduino Nano (I think v3.2) - just starting to tackle that but I'm under the impression that there's a problem either with locks or order of "Events" triggered (CapabilityQuery etc.) So yeah basically program hangs on client.Connect() 95/100 times, I've seen it work 2 times so far... |
tell me if you think this is unrelated I'll start another issue ; here's the stack trace - definitely a deadlock here :
|
this above solves it for me, probably not the way to do it though. @matipan could you try it on your hardware? |
Hi @rkjdid to me that makes sense to increase the size of the one buffered channel, and to the make the other one buffered. It does not introduce any race conditions that are not already there, certainly. I'd be happy to accept a PR with that change, if you wanted to submit one. :) |
gladly, let me get back to you soon |
core: use 10-buffered chans for events, see #374
The buffered channel code that seems to have addressed this has now been released as part of Gobot 1.4 so I am now closing this issue. Please reopen if needed. Thank you! |
Hi everyone! I'm having the exact same problem as the original one in this issue. I'm using an Arduino Mega 2560 with the blinking example.
But firmdata was sucessfully loaded in the Arduino. I'm not able to run any gobot nor artoo program into my arduino. I checked the hardware loading the same blinking example in c with Arduino Ide and the hw works fine. It's definitely something with the firmdata platform creating the adaptor that's not able to communicate with Mega 2560. For instance, when running:
I can just imagine that the same is happening at the firmdata adaptor level of gobot as the error that I see is printed on port communication timeout. Can you help me @deadprogram? Thanks! |
Hi @emmeblm I suspect that the problem lies in the specific firmware being loaded to the Mega. The version that is part of Gort is specific to the Uno and clones, and so even tho it might flash properly, it probably is not executing correctly. One way to test this out is to try compiling and flashing Firmata onto the Mega directly from the Arduino IDE, and then try running the Gobot code. My man @thoughtentity is working on some updates to Gort to allow for compiling and flashing with different boards, such as the mega. Also, I now have a Mega (somewhere) to test with. I am going to reopen this issue, since it seems like it is still around. |
Hi @deadprogram, thanks for the answer.. I tried what you mentioned with no success.. Uploaded firmata directly from Arduino Ide and still get the message:
when running go run blink_led.go. I still have the feeling that this problem lies at the firmata client level. |
I just tried flashing my Arduino Mega 2560 with the StandardFirmata sketch. I then ran the
I did notice that I needed to exit the Arduino IDE before trying to run the Gobot program, possibly the Arduino IDE connected itself to the serial port for debugging? Also which version of Arduino and StandardFirmata did you use to flash your board? |
Hello, there. Just checking in to see if there was any further info, I am not able to reproduce with the latest code. |
Hello, I also had a problem with Arduino Mega 2560.
"I did notice that I needed to exit the Arduino IDE before trying to run the Gobot program, possibly the Arduino IDE connected itself to the serial port for debugging?" - Did not quite understand what you meant? |
Hello, now I tried to do the same with Arduino Uno
|
I've been doing a bunch of experiments with different boards, and have found some cases where when partial data has been read from the board, the messages can get out of sync. Currently experimenting with some different fixes for additional robustness. More very soon... |
The I've just tested on a real Arduino Uno R3, a real Arduino 101, a clone Arduino Uno, and a clone Arduino Mega 2560, and they all were able to connect multiple times. Next release of Gobot will include this update. In the meantime, any testing/feedback is appreciated. |
This code was released in v1.8.0 so now closing. Please reopen if needed. Thanks everyone! |
I am getting the same issue with esp8266 and gobot 1.12 |
For future readers still encountering this error. I instead uploaded Firmata Using arduino IDE and led eg. worked fine.
|
Hi!
I'm trying to run the blinking example with an Arduino MEGA2560.
These are the steps I followed:
So I changed the NewAdaptor to
firmata.NewAdaptor("/dev/tty.usbmodem1421")
.Then
gort arduino install
and it installedavrdude-6.3
successfully.Now I run:
According to the output of that command, the firmata software was successfully loaded. So the only thing left to do is run the program:
And it just hangs there.
I tried debugging it, and I got here. For some reason, the program stays in that
Read
method forever.I'm running macOS Sierra 10.12.2 and go version 1.8
PS: I tried the blinking example from the Arduino IDE and it worked fine
The text was updated successfully, but these errors were encountered: