-
-
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
not working on OSX #11
Comments
Did you update for your serial port path ALSO is your arduino configured to On Mon, Apr 18, 2011 at 11:00 PM, santiago <
Chris Williams The things I make that you should check out: |
it actually shows me the first two bytes of the Arduino's stream and then the machine freezes. Using the same code in the same macbook but running ubuntu instead works as expected. |
How did you install node.js on the mac? Homebrew? On Mon, Apr 18, 2011 at 11:22 PM, santiago <
Chris Williams The things I make that you should check out: |
from sources. running 0.4.4 on OSX and 0.4.6 on ubuntu |
try upgrading your osx to 0.4.6 It does work on OSX. I have heard of various oddities though. Also check On Mon, Apr 18, 2011 at 11:25 PM, santiago <
Chris Williams The things I make that you should check out: |
I'm having the same issue, both with 0.4.6 and 0.4.7 on OSX (10.6.7). |
Can you do me a favor and switch to using the raw process and send raw Thanks, Chris On Tue, Apr 26, 2011 at 1:28 PM, robotconscience <
Chris Williams The things I make that you should check out: |
Hi, I'm having the same problem. Here's my arduino code (just sending a dummy void setup(){ int inByte = 0; void loop(){ and then my js code: var serialport = require("serialport"); var port = "/dev/tty.usbserial-A9005fr8"; var serial_port = new SerialPort(port, { serial_port.on("data", function (data) { repl.start("=>"); On Apr 26, 2011, at 1:33 PM, voodootikigod wrote:
|
Might be related to the flaky FTDI drivers for OS X. I experienced panics when unplugging the FTDI device without properly closing the connection... |
I've seen that as well... However, the main issue we're having is that it doesn't continuously read for some reason. We get one reading and then it just sits. |
I am using a FTDI usb serial adapter on OSX and I saw the problems, mentioned above, using serialport on node.js .4.7 However, using v0.5.0-pre I was able to get a updating feed from the serial port using test_read.js var http = require('http') server = http.createServer(function(req, res){ io.on('connection', function(client){ serial_port.on('error', function (exception) { serial_port.on('data', function (data) { When trying to run this: |
@lowjumpingfrog |
Had the same issue here too on OSX 10.6.7, Node 0.4.7. I was trying to get updates from an Arduino but experienced the same pause after the first result. I'll have a look at FTDI drivers and maybe rolling node back to 0.4.6. |
Ok, I've just tried this with the Virtual Serial Port software (http://code.google.com/p/macosxvirtualserialport/) and that works fine so it does seem to be something to do with the FTDI drivers & Node. I tried updating those to the latest version (2.2.16) and tried again with the Arduino but still no luck. I'm going to try rolling back Node to check that next. |
Got it working with Node v0.5.0-pre :) So, just to confirm that's OSX 10.6.7, Node v0.5.0-pre, FTDI USB serial driver v2.2.16 |
@robotconscience I finally got an arduino, can you try the following PDE: https://gist.github.com/1001784 and this JS file: https://gist.github.com/1001785 Thanks. |
I think @soundanalogous is right. When I upgraded to node 0.5.0 pre it worked fine. I did also update my FTDI drivers but I think it was probably node. |
I'm running into the same problem. I'm on OSX, latest version, new iMac less than two weeks old. I'm running a brand-new version of node (node -v tells me "v0.5.0-pre") and I just updated my FTDI drivers. I have no problem reading/writing to my arduino board via a python script or via the Arduino IDE, so I don't think it's an FTDI issue. @voodootikigod I looked at the gists you linked above and tried them out - what happens is, I get the first batch of data (a "0") and that traces out as expected - and then the application quits. In an attempt to add some persistence, I added a standard basic http server to the same script. Now it no longer quits after outputting the data, but nothing else happens. It just sits there, and if I let it sit long enough it hangs in a way that won't let me kill it. Seemed to be immune even to sudo kill -9, so I rebooted. If, after a few seconds of inactivity I just ctrl-C it then it goes away just fine. So, that sounds to me like maybe some kind of buffer overflow? The new data is being collected somewhere and it's just not coming out? Any other information I can provide that might help you track this down? |
That's very strange. When it happened with me it didn't quit, it just stopped. You're right though, sounds like a buffer overflow or something... |
@mbilokonsky if it is quitting without an exception that means that the event loop has emptied. Any way I could ssh into your system? Ping me voodootikigod on any IM/IRC channel. Quick question are you running node as built from source? |
Can someone who has had/still has an issue with this please attempt installing these FTDI drivers: http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_16.dmg and verify if the issue is still present. If it is please IM me directly so we can work to figure out what is going on and hopefully fix it. I am limited at this point as I have tried it on 4 different Macs (MacPro3,1, MacMini3,1, MacBookAir3,2, Latest MBP, MacMini2,1) and cannot for the life of me recreate. I will buy a beer for the first to help out (when we are in proximity and I can purchase a beer or send you money). |
I am out of town this week but I will give this a try over the weekend and get back to you! Sent from my iPhone On Jun 8, 2011, at 21:03, voodootikigodreply@reply.github.com wrote:
|
Hi, I still got the same error, or I do something wrong. I already have installed FTDI...2_2_16, and node v0.4.8. my JS code (coffeescript notation) sys = require("sys")
repl = require("repl")
serialport = require("serialport")
SerialPort = require("serialport").SerialPort
serial = new SerialPort "/dev/tty.usbmodem411"
serial.on "data", (data)->
console.log 'event'
console.log data
serial.on "error", (msg)->
console.log "error: #{msg}"
setInterval ()->
console.log 'still alive'
, 1000
repl.start( "=>" )
and this is my Arduino code float temp;
void setup() {
Serial.begin(9600);
}
void loop () {
temp = analogRead(0);
Serial.println(temp);
delay(1000);
}; I get just one on_data event in the begining, and nothing more, even if I send data every 1 s form Arduino. My output looks like this:
on Arduino's Serial Monitor works fine. Any suggestion ? |
I tried once again to connect Arduino with node by node-serialport. It seems there is a problem with Buffer. When I run node, node-serialport recive just few first chars form serialport (each time different lenght). Even if I send new data every 5 seconds, the event "on data" is no triggerd anymore. Below I include my coffee code. PATH = "/dev/tty.usbmodem411"
serialport = require("serialport")
SerialPort = serialport.SerialPort
sys = require('sys')
repl = require("repl")
serialPort = new SerialPort PATH, {baudrate: 9600, parser: serialport.parsers.raw }
serialPort.on "data", (data)->
console.log data
console.log data.toString()
repl.start('=>') and console output
|
Author: Please stop adding +1 comments without providing OSX Version, FTDI Driver Version, Laptop Model and Arduino board model. It is working on OS X for certain cases and the issue is not the serial port code, its the node.js event loop not seeing the read hook. I am working to identify and resolve, but need specifics not "doesn't work for me". Keep nerding! |
** My setup: ** about FTDIUSBSerialDriver is a bit strange, because I installed this one: http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_16.dmg
I get
|
… conditions for all code samples from ticket #11.
If you were having this issue, please test now with version 0.2.5 on node version 0.4.8. Version 0.2.5 is the current version available in NPM. There is a known issue with node version 0.5.0-pre which is awaiting for 0.5.0 to stabilize before changing to handle. Please post if it works OR if it does not work. |
Using node 0.4.8 and using a freshly installed instance of node-serialport from NPM I'm still getting the exact same issue - it'll spit out the first value then quit. O_o my_mac:NewTest mykola$ node -v |
Converted from node.js IOWatcher to node.js fs.ReadStream. Please test on your local systems version 0.2.6 if all good will rev up to 0.3.0. |
That seems to have fixed it for me! Thanks man! |
I am closing this ticket until/unless someone comes forward expressing that 0.2.7 doesn't fix their issue. |
Can run on Windows? |
Hi, running test_read.js on OSX 10.6, using an Arduino, crashes/freezes the machine, which makes me to reboot.
The text was updated successfully, but these errors were encountered: