We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using serialport to connect to a bluetooth module on an AVR micro with the following code:
#include <avr/io.h> #include <avr/wdt.h> #include <stdlib.h> volatile uint8_t bt_rx; int main(void) { // usart UBRR1L = 25; // 38.4k UCSR1A |= _BV(U2X1); UCSR1A |= _BV(TXC1); UCSR1B |= (_BV(RXEN1) | _BV(TXEN1)); UCSR1C |= (_BV(UCSZ11) | _BV(UCSZ10)); // 8 bits, 1 stop bit while (1) { wdt_reset(); loop_until_bit_is_clear(UCSR1A, RXC1); bt_rx = UDR1; } }
All this does is consume bytes sent to it, pretty simple.
I also wrote a node program to dump a file through serialport:
if (process.argv.length !== 4) { console.log('Usage: node test COM FILE'); return 0; } var SerialPort = require('serialport').SerialPort; var fs = require('fs'); var comPort = process.argv[2]; var inputFilePath = process.argv[3]; var serialPort = new SerialPort(comPort); var inputData = fs.readFileSync(inputFilePath); serialPort.on('open', function (err) { if (err) { console.error('open', err); } else { console.log('open'); serialPort.write(inputData, function (err) { if (err) { console.error('write', err); } else { console.log('done') } }); } }); process.on('SIGINT', function() { serialPort.close(); });
Then I dump a binary file with 20000 bytes: node serialport COM4 input.bin
node serialport COM4 input.bin
On Windows, everything goes great. The output goes:
open done
And I have a logic analyzer connected to the USART on my Bluetooth module:
Everything comes in nice and smoothly.
On Mac, it's a totally different story. The output goes:
open done done done done done done done done done done done done done done done done done done done
And the logic analyzer has huge gaps between data:
Has anyone seen this before? Anyone know if this an issue with SerialPort, or OS X?
I am running OS X Yosemite (which has been rife with Bluetooth issues since I upgraded from Mavericks).
The text was updated successfully, but these errors were encountered:
This looks like it could be a hardware issue. Tested on a Mid 2010 MBP with Yosemite, and everything was great. Late 2012 MBP has issues.
Sorry, something went wrong.
@programmarchy Any further updates? Was it that machine?
Yes, it was the machine. Thanks for ping back.
Still haven't figured out the problem with the machine, but the same exact code worked on another Mac of the same model.
Closing.
No branches or pull requests
I'm using serialport to connect to a bluetooth module on an AVR micro with the following code:
All this does is consume bytes sent to it, pretty simple.
I also wrote a node program to dump a file through serialport:
Then I dump a binary file with 20000 bytes:
node serialport COM4 input.bin
On Windows, everything goes great. The output goes:
And I have a logic analyzer connected to the USART on my Bluetooth module:
Everything comes in nice and smoothly.
On Mac, it's a totally different story. The output goes:
And the logic analyzer has huge gaps between data:
Has anyone seen this before? Anyone know if this an issue with SerialPort, or OS X?
I am running OS X Yosemite (which has been rife with Bluetooth issues since I upgraded from Mavericks).
The text was updated successfully, but these errors were encountered: