garrows / browser-serialport Goto Github PK
View Code? Open in Web Editor NEWRobots in the browser. Just like node-serialport but for browser/chrome apps.
License: MIT License
Robots in the browser. Just like node-serialport but for browser/chrome apps.
License: MIT License
options.rtscts = _options.rtscts;
if (options.flowControl || options.flowcontrol) {
var fc = options.flowControl || options.flowcontrol;
if (typeof fc === 'boolean') {
options.rtscts = true;
} else if (typeof fc === 'string'){
var fcup = fc.toUpperCase();
var idx = FLOWCONTROLS.indexOf(fcup);
if (idx < 0) {
var err = new Error('Invalid "flowControl": ' + fcup + '. Valid options: ' + FLOWCONTROLS.join(', '));
callback(err);
return false;
} else {
// "XON", "XOFF", "XANY", "DTRDTS", "RTSCTS"
switch (idx) {
case 0:
options.rtscts = true;
break;
}
return true;
}
}else{
var clean = fc.every(function (flowControl) {
var fcup = flowControl.toUpperCase();
var idx = FLOWCONTROLS.indexOf(fcup);
if (idx < 0) {
var err = new Error('Invalid "flowControl": ' + fcup + '. Valid options: ' + FLOWCONTROLS.join(', '));
callback(err);
return false;
} else {
// "XON", "XOFF", "XANY", "DTRDTS", "RTSCTS"
switch (idx) {
case 0:
options.rtscts = true;
break;
}
return true;
}
});
if(!clean){
return;
}
}
}
node-serialport
changed its API with version 4 (constructor, autoOpen, etc.). Is it planned for browser-serialport
to align with those changes ?
Probably others too
Probably others
I have an App with nwjs (0.15.3) that communicates to an Arduino board using browser-serialport.
When the usb cable is disconnected I get a disconnect and close event on mac64 and win64 platforms, but the same code on win32 platform does not receive any event when the cable is disconnected.
Is there any known incompatibility with win32? (or maybe I am missing something to make it work)
Thanks
The johnny five app could not be installed due to missing the johnny-five-js16.jpeg file.
Hi Folks,
I'm working towards getting our c++ bindings isolated enough that we could switch out serialport implementations in an easier way. This could include the chrome serialport object. I think this is something to talk about because I'm going to be releasing some breaking changes to serialport to improve it's api and it's silly to implement everything twice. I'm thinking maybe we could merge projects.
I've opened serialport/node-serialport#739 to explore the option.
I can find "Serial Monitor" in Chrome OS and it runs fine.
But I can't find when I'm searching Web Store for "Serial Monitor" in crouton (https://github.com/dnschneid/crouton).
When I use link to it you have in README, I'm able to install it and it runs.
It doesn't allow opening serial port though. chrome.serial.open() returns -1 as connectionId. This looks like a crouton udev user permission issue as I am able to run "Serial Monitor" when I start Chrome as root.
I tried the latest Chrome Version 30.0.1599.114 (for Ubuntu 12.04, 32 bit).
Still, the question is why can't I find "Serial Monitor" in Web Store on crouton?
Frankly need node-serialport to make native returns consistent first
Hi,
i'm trying to load an Arduino program, in a chrome extension with avrgirl-arduino, but when try to load a big program to an Arduino UNO modified board (mCore board), sometimes (or everytime ) give a timeout when loading an address on verify, or when its programming a page.
Load the same program to an original Arduino UNO always work, no problem, just on this board and just on chrome, if i use avrgirl-arduino on a NodeJS program, always work too.
You know the differences between the nodejs and chome.serial API that maybe, can origin the problem
Any help to debug it better will be appreciated.
Thanks!
The chrome extension code its here, we use avrgirl-arduino and add some code to create a serial monitor.
If you have a mCore board (with a common Arduino UNO always work ) you can test here:
Login, and activate the "show under development board and robots" on profile account ( http://beta-bitbloq.bq.com/#/account )
Then go to create a new project, select the robot mBot, and create and load some programs.
I don't have access to do this. Would be nice to have CI on the repo.
Hi,
are there type definitions for TypeScript somewhere in the wild?
None found with npm install @types/browser-serialport
Bye,
Martin
datastring has been depreciated as its not in node-serialport
does chrome handle that safely?
hello, is browser-serialport supported by electron?
I tried to use the package, but the list ports are null.
Maybe the trouble is permission.
Hi @garrows , do I need to convert the module with browserify?
I convert the module firstly:
browserify index.js > browser-serialport.js
When I try to get the serialPort in the html, but there is error say cannot find:
<script src="require-2.2.0.js"></script>
<script src="browser-serialport.js"></script>
<script>
var SerialPort = require("browser-serialport").SerialPort;
</script>
Where is wrong?
Hi Glen
Do you have any sort of licence on this? - or is it all just as is.
Best to stick some sort of open licence on it than nothing at all.
Thanks
Steve
can not support ESC/POS "cut paper" ,but node-serialprt can support
Pretty sure some of the linting errors are bugs.
Added jshint to npm test
here: https://github.com/garrows/browser-serialport/tree/jshint
mocha in browser, headless, and @phated found a link to install extensions from command line
serial api has changed.
Here's a working implementation: https://gist.github.com/monteslu/11151839
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.