-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Unable to run demo] - Firmata closes serial connection... #53
Comments
Thanks, I'm going to cross-file this with Firmata |
Follow here: firmata/firmata.js#13 |
Thanks. I spent the afternoon tracking down another Arduino Uno, loading an Ubuntu VM, and swapping various cables - but while I didn't get dumped into a Firmata prompt, I couldn't get the demo examples (or REPL) to work... it just lights up TX on the Arduino. Bummer. I'm going to retry later with a Macbook and my multimeter.
|
Have you loaded StandardFirmata onto the board? |
In short, after a fresh install of Mountain Lion it works on my Macbook. However, on various Linux machines it fails with the same error above. Details in the Firmata link, as I suspect it's the problem too. :( |
Thanks for the update—I'm moving from Boston to New York over the next few days, but once I'm settled in I'll commit to working through the installation process on Linux. |
I'm interested to know what's up with this. Is the VM handling USB correctly? I have no issues with Johnny-Five on any of my GNU/Linux machines |
Paul, thanks for the feedback. It's good to know it's possible :). The VM Host is set to pass through a USB Bus and specified devices (in this case an Arduino Uno as /dev/ttyASM0). And I can now get Firmata to work on both Ubuntu and ArchLinux VMs. For Arch it was a matter of not being in the 'uucp' group:
Ubuntu:
Ok, that said it still fails. Within ArchLinux it really doesn't post an error. Occasionally, I get dumped to a firmata prompt. But trying to pass led.on() or similar didn't work as I had hoped Trying Johnny-five on Ubuntu now results in the same thing as ArchLinux... the TX light stays lit but pin13 doesn't cycle...
Also I was able to get another project, Duino (https://github.com/ecto/duino), to work on both Arch and Ubuntu. It doesn't use Firmata as the Arduino sketch, but it's own. Not sure if that helps pinpoint the issue... Thanks for the help so far. |
Re: the repl missing Which version of the IDE are you using? Which version of Firmata? if it's 2.3, switch to 2.2 |
Not sure if this will fix your issue or not: https://github.com/soundanalogous/AdvancedFirmata. If it doesn't file an issue there and/or fork and submit a pull request. The official Firmata library is not going to move forward anytime soon (if ever for reasons other than bug fixes). |
Hi guys, I'm running into the same issue here :'( I'm running Ubuntu 12.10. At this time I'm testing with Arduino 0023 because I'm sure that it has Firmata 2.2. ( I've tried with Arduino 1.0.x and got the same error ). I've loaded Standard Firmata from File/Examples/Firmata/StandardFirmata and when I try to run the led-strobe example I get the following: $ node led-strobe.js 1355586587821 Board Connecting...
What can I do? |
I had the exact same problem and today I successfully got the LED to cycle. I used the standardFirmata shipped with the version 1.0.3 of the IDE, then just after clicking "upload", I execute the following command:
This is the only Johnny-Five example I have tested so far. I'll let you know if I run into other problems. |
hum, very strange, I just tried the potentiometer example and couldn't get it to work. Then I tried the cycling LED again and can't get it to work anymore :-( |
Unfortunately, these reports have been impossible to reproduce :( |
Yep. I'm using the AMD64 variant of Ubuntu 12.10, and I've tried every version of standardFirmata out there. I'm gonna try Ubuntu 32 to see if it helps. Has anyone tried Johnny-Five with the RaspberrPi and its default OS? If it works, this could be an expensive but relatively easy fix (I've ordered mine yesterday). |
I've created live USBs of Ubuntu 12.10 in 32b and 64b then booted them and installed Java, g++, node+npm, the Arduino IDE v1.0.3 and then downloaded Johnny-five. I have successfully uploaded standardFirmata 2.2 and the version shipped with the IDE (not at the same time of course) but I haven't been able to execute the demo code, it never goes further than For the record, the easiest way to upload firmata or any other arduino code to the board is to start the IDE with |
Do you mean hitting the actual reset button on the board? Doing that will reset the board, which erases the compiled and uploaded Standard Firmata... which is why Johnny-Five can't make a connection. |
Rick, I'm definitely not doing hard testing like Louis, but I can tell you I do not hit the reset button after upload the Firmata but get the same error "Cannot set property 'mode' of undefined" |
@rwldrn The need to reset the board might depend on the type of board actually. I'm using Leonardo and uploading new sketches often fails if I don't press the reset button of the board right after clicking the upload button of the IDE. @evilsaurer The EDIT: I can confirm that Firmata is not to blame, having played with the Firmata Test Program (again, ran with sudo). |
In order to use StandardFirmata with Arduino Leonardo you have to replace the version of Firmata included in the Arduino IDE with version 2.3.2 or higher: https://github.com/firmata/arduino/downloads. This will ensure that all of the pins are mapped correctly. Leonardo was not added to Boards.h of the Firmata library until version 2.3.2. |
[Oops, I inadvertently deleted my last post, here it is, sorry] I have a version of firmata.js that works with my configuration: https://github.com/louisremi/firmata I read a little bit of the docs of SerialPort and the Firmata protocol and noticed that the current firmata.js doesn't wait for the "open" event of SerialPort and doesn't send requests for REPORT_VERSION and QUERY_FIRMWARE characters. So I fixed that and was able to run my first Johnny-five demo, this time for real! I just don't know why everything works fine for others... I need those who don't have problems to make sure my fix doesn't break anything, and I need @stevenrace to tell me if my version of the file fixes his problems. Thank you in advance! PS: @soundanalogous I have been able to run the basic Johnny-Five example on a Leonardo using both Firmata 2.2 and Firmata 2.3. But you're right, Firmata 2.3 is required to get all pins properly mapped on that card. |
It will work, but your pins will not all be mapped correctly. Firmata (the Arduino library, not the node.js library... confusing... should have been named "node-firmata" or something like that) detects the ATmega32u4 on the Leonardo, but thinks it's a Teensy 2.0 board. The pinout is different on the Teensy 2.0 and Leonardo. Here is the Leonardo board definition from Boards.h (which was added in Firmata v2.3.2): // Leonardo And this is the board definition for the Teensy 2.0 board (for version of Firmata earlier than 2.3.2) // Teensy 2.0 This means that I2C pins and analog pins will not map properly and that not all of the digital pins will be available if you are using a Leonardo with an older version of Firmata. The latest version of Firmata supports both Leonardo and Teensy 2.0 boards. |
I was running into the same bug but made a few changes and got past it. First off, I'm running an Arduino Uno on an Ubuntu 12.04 VM inside a Windows 7 host. I'm using the 1.0.3 IDE and node v0.8.7 and johhny-five v0.5.14. When I originally set up Firmata, I did it through Windows 7, and then switch to Ubuntu to do the JS work and got this error. I then installed Arduino IDE into Ubuntu and re-uploaded Firmata to the Arduino from there, and changed permissions on /dev/ttyACM0 to 0777. I'm not sure which of these changes fixed it, but either way the error stopped happening. |
@kingcoyote that is surprising, but interesting. I'm still very interested to know if my modified firmata.js fixes the problem for @stevenrace |
I experienced a very similar bug. First setup was Arduino Uno with Firmata 2.2 uploaded via Arduino 0023 running on Windows 8 x64. Things got stuck on 1359288784867 Board Connecting... when running Johnny Five from Raspberry Pi with Node.js compiled from source and Johnny Five installed locally via npm package. Strange thing is that everything worked flawlessly with same setup except running J-5 from a Linux Mint 14 laptop. According to @kingcoyote i tried uploading Firmata 2.2 from Arduino 0023 on Linux machine. Now things got even more strange. I could not get the LED Fade example to work but LED Strobe example works a litte. LED Turns on and off once and then get stuck again at this point: 1359288784867 Board Connecting... Repl does not take any commands (not even ^C) until i pull the Arduinos USB off the Pi. The best output i could get is the following when i ran the LED Fade example (LED didn't do anything) then typing led.on() while repl got stuck, so i didn't see the actual text i was writing and finally pulling the USB plug. 1359286779541 Board Connecting...
Maybe this is somewhat useful to you. |
Sorry, I've been warning people away from the npm package... it's severely out of date and has bugs, but I haven't been ready or comfortable with releasing a new version, but it looks like I may have to... |
Well thats a nice hint. I'll check that later. Edit: Cloned a fresh johnny-five version from github and required that via an absolute path. But that did not change anything for me :( |
Guys, i'm a noob in linux (so don't scream if this is some obvious thing or something), but this worked for me. I tried all of the above stuff, about permissions and all, but they did nothing by themselves, I had to change ttyACM0 to ttyUSB0. Vola, works beautifully.. |
The port detection should match that: var rport = /usb|acm|^com/i; |
First off, rad project. I'm hoping someone can steer me towards the light...
Attempting to run the demo code: (
Which fails with:
ArchLinux
NPM version 1.1.46
Node version v.0.8.5
Arduino Uno via USB
thanks in advance...
The text was updated successfully, but these errors were encountered: