p5-serial / p5.serialserver Goto Github PK
View Code? Open in Web Editor NEWServer for use with p5.serialport
Home Page: https://p5-serial.github.io/p5.serialserver
License: MIT License
Server for use with p5.serialport
Home Page: https://p5-serial.github.io/p5.serialserver
License: MIT License
There's a reliably repeatable problem with readStringUntil:
function serialEvent() {
// read a string from the serial port:
var inString = serial.readStringUntil('\r\n');
//check to see that there's actually a string there:
if (inString.length > 0 ) {
//put it in a global variable:
inData = inString;
}
}
result: one serialEvent is triggered, then nothing.
Now replace serialEvent with the following:
void serialEvent() {
var inByte = char(serial.read());
if (inByte === '\n') {
inData = '';
} else {
inData += inByte;
}
}
result: inData reliably gets the original string.
@vanevery I tested this after we parted, and it was indeed the right file after all.
When I tried to install p5.serialserver
in my Mac I got the next errors:
> [email protected] install /Users/bsys/node_modules/p5.serialserver/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/bin/node',
node-pre-gyp verb cli '/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release/serialport.node" (not found)
node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http EACCES: permission denied, mkdir '/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build'
node-pre-gyp verb command build [ 'rebuild' ]
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build'
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release"
gyp ERR! cwd /Users/bsys/node_modules/p5.serialserver/node_modules/serialport
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/bsys/node_modules/p5.serialserver/node_modules/serialport
node-pre-gyp ERR! node -v v8.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/Users/bsys/node_modules/p5.serialserver/node_modules/serialport/build/Release' (1)
npm WARN enoent ENOENT: no such file or directory, open '/Users/bsys/package.json'
npm WARN bsys No description
npm WARN bsys No repository field.
npm WARN bsys No README data
npm WARN bsys No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/bsys/.npm/_logs/2018-05-04T16_19_25_570Z-debug.log
~~~Go to ```~/node_modules``` create a folder called p5.serialserver paste ```startserver.js```~~~
~~~Run in terminal with node ```~/node_modules/p5.serialserver/startserver.js```~~~
└─$ uname -a
Linux kali 5.16.0-kali7-amd64 #1 SMP PREEMPT Debian 5.16.18-1kali1 (2022-04-01) x86_64 GNU/Linux
┌──(jung㉿kali)-[~/Desktop/p5.serialport]
└─$ node --version
v16.15.0
┌──(jung㉿kali)-[~/Desktop/p5.serialport]
└─$ npm --version
8.8.0
┌──(jung㉿kali)-[~/Desktop/p5.serialport]
└─$ yarn --version
1.22.18
yarn install v1.22.18
warning package.json: License should be a valid SPDX license expression
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning [email protected]: License should be a valid SPDX license expression
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Rebuilding all packages...
error /home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings: Command failed.
Exit code: 1
Command: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
Arguments:
Directory: /home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings
Output:
prebuild-install WARN install No prebuilt binaries found (target=16.15.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.9.12 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/home/jung/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/jung/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/jung/.cache/node-gyp/16.15.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/jung/.cache/node-gyp/16.15.0',
gyp info spawn args '-Dnode_gyp_dir=/home/jung/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/jung/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings/build'
CXX(target) Release/obj.target/bindings/src/serialport.o
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:78:51: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
78 | uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:135:53: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
135 | uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:175:52: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
175 | uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:215:52: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
215 | uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:270:50: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
270 | uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:314:50: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
314 | uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘void EIO_AfterGet(uv_work_t*)’:
../src/serialport.cpp:329:17: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
329 | results->Set(Nan::Newv8::String("cts").ToLocalChecked(), Nan::Newv8::Boolean(data->cts));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jung/.cache/node-gyp/16.15.0/include/node/node.h:63,
from ../../../nan/nan.h:58,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
3961 | V8_WARN_UNUSED_RESULT Maybe Set(Local context,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate expects 3 arguments, 2 provided
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
3964 | V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate expects 3 arguments, 2 provided
../src/serialport.cpp:330:17: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
330 | results->Set(Nan::Newv8::String("dsr").ToLocalChecked(), Nan::Newv8::Boolean(data->dsr));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jung/.cache/node-gyp/16.15.0/include/node/node.h:63,
from ../../../nan/nan.h:58,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
3961 | V8_WARN_UNUSED_RESULT Maybe Set(Local context,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate expects 3 arguments, 2 provided
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
3964 | V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate expects 3 arguments, 2 provided
../src/serialport.cpp:331:17: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::FactoryBasev8::Boolean::return_t)’
331 | results->Set(Nan::Newv8::String("dcd").ToLocalChecked(), Nan::Newv8::Boolean(data->dcd));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jung/.cache/node-gyp/16.15.0/include/node/node.h:63,
from ../../../nan/nan.h:58,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
3961 | V8_WARN_UNUSED_RESULT Maybe Set(Local context,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate expects 3 arguments, 2 provided
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
3964 | V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate expects 3 arguments, 2 provided
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:363:58: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
363 | uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: In function ‘void EIO_AfterGetBaudRate(uv_work_t*)’:
../src/serialport.cpp:378:17: error: no matching function for call to ‘v8::Object::Set(v8::Localv8::String, Nan::imp::IntegerFactoryv8::Integer::return_t)’
378 | results->Set(Nan::Newv8::String("baudRate").ToLocalChecked(), Nan::Newv8::Integer(data->baudRate));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/jung/.cache/node-gyp/16.15.0/include/node/node.h:63,
from ../../../nan/nan.h:58,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, v8::Localv8::Value, v8::Localv8::Value)’
3961 | V8_WARN_UNUSED_RESULT Maybe Set(Local context,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3961:37: note: candidate expects 3 arguments, 2 provided
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate: ‘v8::Maybe v8::Object::Set(v8::Localv8::Context, uint32_t, v8::Localv8::Value)’
3964 | V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
| ^~~
/home/jung/.cache/node-gyp/16.15.0/include/node/v8.h:3964:37: note: candidate expects 3 arguments, 2 provided
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:409:52: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
409 | uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp: At global scope:
../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Localv8::String& v8str)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp:430:28: note: remove parentheses
430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Localv8::String& v8str)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| - -
../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses]
449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/serialport.cpp:449:30: note: remove parentheses
449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| - -
In file included from ../../../nan/nan.h:58,
from ../src/./serialport.h:6,
from ../src/serialport.cpp:1:
/home/jung/.cache/node-gyp/16.15.0/include/node/node.h:847:7: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Localv8::Object)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void)’} [-Wcast-function-type]
847 | (node::addon_register_func) (regfunc),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jung/.cache/node-gyp/16.15.0/include/node/node.h:881:3: note: in expansion of macro ‘NODE_MODULE_X’
881 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~
../src/serialport.cpp:483:1: note: in expansion of macro ‘NODE_MODULE’
483 | NODE_MODULE(serialport, init);
| ^~~~~~~~~~~
make: *** [bindings.target.mk:116: Release/obj.target/bindings/src/serialport.o] Error 1
make: Leaving directory '/home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/jung/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (node:events:527:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.16.0-kali7-amd64
gyp ERR! command "/home/jung/.nvm/versions/node/v16.15.0/bin/node" "/home/jung/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/jung/Desktop/p5.serialport/node_modules/@serialport/bindings
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
WHY DOES THIS NOT WORK? WHAT IS MISSING? DOES THIS NOT WORK ON LINUX?
Need to test
need broadcastit for the data and sendit for most other things
Need to update api documentation link. currently leads to 404 page.
http://vanevery.github.io/p5.serialport/docs/classes/p5.serialport.html
Hello !
I'm trying to get data from a python script into a p5.js app.
In your example, I have only find communication with arduino but not with other program.
I'm using this python librairy but didn't succeed to make it work. I'm not an expert on serial neither.
Is it possible to make such a workflow work ?
I'll be happy to contribute to your doc/example if I manage to make it work.
Is there any way to get mor detailed error informations? (That is, [serial.on('error', console.log('ERROR'));
On this branch, I'm importing the libs (p5, p5.serialport, p5.dom) as node modules. This way, we get the latest versions each time we npm install
... but it will only work if the NPM modules are up to date.
Getting the following error when trying to install on linux (Ubuntu) with nodejs v.4.2.6
Same issue when trying to install locally.
$ sudo npm install -g p5.serialserver
/usr/local/bin/p5serial -> /usr/local/lib/node_modules/p5.serialserver/startserver.js
[email protected] install /usr/local/lib/node_modules/p5.serialserver/node_modules/serialport
node-pre-gyp install --fallback-to-build
/usr/bin/env: ‘node’: No such file or directory
/usr/local/lib
└── (empty)
npm ERR! Linux 4.8.0-52-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "p5.serialserver"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/////npm-debug.log
npm ERR! code 1
I am facing problem in getting the serial port from my port(COM3) which is defined in my sketch.js code.
Opening /dev/cu.usbmodem14131: Unknown error code 3
I am getting this error although my sketch.js is:
var serial; // variable to hold an instance of the serialport library
var portName = 'COM3'; // fill in your serial port name here
var inData; // for incoming serial data
function setup() {
createCanvas(400, 300);
serial = new p5.SerialPort(); // make a new instance of the serialport library
serial.on('data', serialEvent); // callback for when new data arrives
serial.on('error', serialError); // callback for errors
serial.open(portName); // open a serial port
serial.clear();
}
function draw() {
// black background, white text:
background(0);
fill(255);
// display the incoming serial data as a string:
text("incoming value: " + inData, 30, 30);
}
function keyTyped() {
var outByte = key;
console.log("Sending " + outByte);
//serial.write(Number(outByte)); // Send as byte value
serial.write(outByte); // Send as a string/char/ascii value
}
function serialEvent() {
// read a byte from the serial port:
var inByte = serial.read();
println("inByte: " + inByte);
inData = inByte;
}
function serialError(err) {
println('Something went wrong with the serial port. ' + err);
}
On server, should check for "baudrate" in options and change to "baudRate".
This is an issue as some browsers aren't allowing non-secure socket connections from secure origins. Chrome 69 allows it to localhost which helps but Safari and Firefox are blocking.
Need to figure out a way to allow WSS connections to work. This is also an issue with https://github.com/vanevery/p5.serialcontrol
I was thinking about how to implement two-port sketches today. In Processing, the port generating the event is returned to serialEvent as a parameter like so:
void serialEvent(port) {
}
With this, you can take different actions depending on which port is sending data. It might be useful to have this option in P5 too. I tried to see if I could access the port using "this" in the callback functions, but it didn't work.
According to the instruction, run ' node startserver.js', then use the demo example 'echo', but got the issue: how to solve this out
/p5.serialserver.js:142
ports.forEach(function(port) {
^
TypeError: Cannot read property 'forEach' of undefined
From processing/p5.js-editor#167
"Does the editor restart the server on each run? I was having issues with zombie console logging when sketches are closed."
Here's the process for testing:
Result: sketch does not run.
Hello,
When I run the p5.serialserver PDE and select the Arduino port from the drop down menu the app crashes. Please see the screenshot and error log below.
I'm running Processing 4 on Manjaro
Any suggestions on a bug fix would be greatly appreciated, thank you
SEVERE: An error occured while forwarding a Controller event, please check your code at selectPort
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Controller.setValue(Unknown Source)
at controlP5.ScrollableList.updateIndex(Unknown Source)
at controlP5.ScrollableList.onRelease(Unknown Source)
at controlP5.Controller.setMousePressed(Unknown Source)
at controlP5.ControllerGroup.setMousePressed(Unknown Source)
at controlP5.ControlWindow.mouseReleasedEvent(Unknown Source)
at controlP5.ControlWindow.mouseEvent(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1309)
at processing.core.PApplet.handleMethods(PApplet.java:1456)
at processing.core.PApplet.handleMouseEvent(PApplet.java:2368)
at processing.core.PApplet.dequeueEvents(PApplet.java:2261)
at processing.core.PApplet.handleDraw(PApplet.java:2104)
at processing.awt.PSurfaceAWT$9.callDraw(PSurfaceAWT.java:1386)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:356)
Caused by: java.lang.RuntimeException: Error opening serial port /dev/ttyACM0: Permission denied
at processing.serial.Serial.(Unknown Source)
at processing.serial.Serial.(Unknown Source)
at p5_serialserver.selectPort(p5_serialserver.java:245)
... 25 more
NullPointerException
Trying out the echo example, I discovered a syntax error in p5.serialport.js on line 443: The token '*/' has to be removed.
and the server therefore needs to be restarted between each page load which is very annoying
Hi , I installed node 0.12.7 and after i did npm -g install p5.serialserver
i run node startserver.js it starts but in P5.js as soon as i uncomment the line "serial = new p5.SerialPort(); " it gives an error : "Uncaught TypeError: undefined is not a function"
When i run the html file it doenst work either
Thx for the help !
project called p5.serialport here
project called p5.serialserver on npm
Tom makes point that it should be called p5.serialsocket to accurately describe functionality
Hello,
First of all, I'm loving the library it's amazing!
I'm not sure if this is a question or a feature request. I want to be able to send an ArrayBuffer of pixel data over serial to an LED matrix connected vai an Arduino.
I've created this sketch and Arduino code but just can't get the ArrayBuffer data to be received and/or processed correctly.
P5 sketch: https://editor.p5js.org/owenmcateer/sketches/mY4FOIUZ
I've left some comments in the sketch to explain whats going on.
Arduino code: https://gist.github.com/owenmcateer/1151febe57b7bd971255cfef2f0a2e06
(I have tested and confirmed this Arduino code to be working using glediator(a led display animation program that is sent over serial connection, glediator uses an end line market of \1))
Any help to point me in the right direction would be great. Thank you.
when refresh the page, get this error.
Everything works fine at 9600 baud, but if I change the baud rate to some higher value in both my js script and on the micrcontroller, the communication does not work. The problem appears to be that the server automatically is configured to use 9600 baud. How can I change this on the server?
Perhaps the same CDN as p5.js itself?
In order to make the client more dynamic, change the default websocket address from localhost to the IP address obtained from document.location.hostname.
For example:
serial = new p5.SerialPort(document.location.hostname);
voila! Works from any client device's browser.
from @tigoe
Attached is a kluge for getting port's board name.
A real version could look for the user’s ~/Library/Arduino15/packages, and in each package folder keep looking for boards.txt files, and take any line with .pid in it and pull the pid for comparison.
But this will get the names for now.
ListPorts.js
/*
Lists serial ports.
Copied from https://github.com/voodootikigod/node-serialport readme
refactored to get rid of anonymous functions, to make it clearer for
those new to JavaScript
*/
var pids = [{productName : 'Yún', productId : 0x0041},
{productName : 'Yún', productId : 0x8041},
{productName : 'Yún', productId : 0x0041},
{productName : 'Yún', productId : 0x8041},
{productName : 'Uno', productId : 0x0043},
{productName : 'Uno', productId : 0x0001},
{productName : 'Uno', productId : 0x0043},
{productName : 'Uno', productId : 0x0243},
{productName : 'Mega', productId : 0x0010},
{productName : 'Mega', productId : 0x0042},
{productName : 'Mega', productId : 0x0010},
{productName : 'Mega', productId : 0x0042},
{productName : 'Mega', productId : 0x0210},
{productName : 'Mega', productId : 0x0242},
{productName : 'Mega ADK', productId : 0x003f},
{productName : 'Mega ADK', productId : 0x0044},
{productName : 'Mega ADK', productId : 0x003f},
{productName : 'Mega ADK', productId : 0x0044},
{productName : 'Leonardo', productId : 0x0036},
{productName : 'Leonardo', productId : 0x8036},
{productName : 'Leonardo', productId : 0x0036},
{productName : 'Leonardo', productId : 0x8036},
{productName : 'Micro', productId : 0x0037},
{productName : 'Micro', productId : 0x8037},
{productName : 'Micro', productId : 0x0037},
{productName : 'Micro', productId : 0x8037},
{productName : 'Micro', productId : 0x0237},
{productName : 'Micro', productId : 0x8237},
{productName : 'Esplora', productId : 0x003C},
{productName : 'Esplora', productId : 0x803C},
{productName : 'Esplora', productId : 0x003C},
{productName : 'Esplora', productId : 0x803C},
{productName : 'LilyPad USB', productId : 0x9207},
{productName : 'LilyPad USB', productId : 0x9208},
{productName : 'Robot Control Board', productId : 0x0038},
{productName : 'Robot Control Board', productId : 0x8038},
{productName : 'Robot Control Board', productId : 0x0038},
{productName : 'Robot Control Board', productId : 0x8038},
{productName : 'Robot Motor Board', productId : 0x0039},
{productName : 'Robot Motor Board', productId : 0x8039},
{productName : 'Robot Motor Board', productId : 0x0039},
{productName : 'Robot Motor Board', productId : 0x8039},
{productName : 'Gemma', productId : 0x0c9f},
{productName : 'Arduino Zero (Programming Port)', productId : 0x2157},
{productName : 'Arduino Zero native', productId : 0x804d},
{productName : 'Arduino Zero native', productId : 0x004d},
{productName : 'Arduino Zero native', productId : 0x824d},
{productName : 'Arduino Zero native', productId : 0x024d},
{productName : 'MKR1000', productId : 0x804e},
{productName : 'MKR1000', productId : 0x004e},
{productName : 'MKR1000', productId : 0x824e},
{productName : 'MKR1000', productId : 0x024e},
{productName : 'Arduino 101', productId : 0x0AB6},
{productName : 'Flora8', productId : 0x8004},
{productName : 'Bluefruit Micro', productId : 0x800A},
{productName : 'Feather 32u4', productId : 0x800C},
{productName : 'Adafruit 32u4', productId : 0x8001},
{productName : 'Circuit Playground 32u4 cat', productId : 0x8011},
{productName : 'Adafruit feather M0', productId : 0x800B},
{productName : 'Adafruit feather M0', productId : 0x000B},
{productName : '#Adafruit radio M0', productId : 0x8014},
{productName : '#Adafruit radio M0', productId : 0x0014},
{productName : '#Adafruit metro M0', productId : 0x8013},
{productName : '#Adafruit metro M0', productId : 0x0013},
{productName : 'Blend', productId : 0x0036},
{productName : 'Blend', productId : 0x8036},
{productName : 'Blend Micro 8', productId : 0x2404},
{productName : 'Blend Micro 16', productId : 0x2404}];
var serialport = require("serialport");
var myName = "unknown";
// list serial ports:
serialport.list(listPorts);
function listPorts(error, ports) {
ports.forEach(printPort);
function printPort(port) {
for (p in pids) {
if (pids[p].productId == port.productId) {
myName = pids[p].productName;
}
}
console.log(port.comName + "\t" + port.manufacturer + "\t" + port.productId + "\t" + myName );
}
}
Hi,
After cloning the package and using npm install I end up with this error when calling startserver.js:
`/Users/u0122145/Documents/p5.serialport/node_modules/bindings/bindings.js:91
throw err
^
Error: Could not locate the bindings file. Tried:
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/build/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/build/Debug/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/build/Release/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/out/Debug/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/Debug/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/out/Release/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/Release/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/build/default/serialport.node
→ /Users/u0122145/Documents/p5.serialport/node_modules/serialport/compiled/11.12.0/darwin/x64/serialport.node
at bindings (/Users/u0122145/Documents/p5.serialport/node_modules/bindings/bindings.js:88:9)
at Object. (/Users/u0122145/Documents/p5.serialport/node_modules/serialport/lib/bindings.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/Users/u0122145/Documents/p5.serialport/node_modules/serialport/lib/serialport.js:12:25)`
node startserver.js 8081
./startserver.js 8082
etc..
Might be useful to check serial.bufferUntil(inByte) and serial.buffer(size)
https://processing.org/reference/libraries/serial/Serial_bufferUntil_.html
https://processing.org/reference/libraries/serial/Serial_buffer_.html
@tigoe reports that if client doesn't register callback for "close" and/or "error" when those happen the, port doesn't close.
It could either be a client side issue with the missing callback creating a condition where the close property isn't updated or a server side issue resulting from an error generated on the client side.
This should be tested/verified and corrected.
When trying to connect to serial in the usual way:
var serial = new p5.SerialPort();
I am graced with the ERR:
WebSocket connection to 'ws://localhost:8081/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
I've tried:
I'm having trouble copying the whole list of errors right now but they take the form:
> [email protected] install /Users/adi/dev/github/open-source/p5.serialport/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ '/usr/local/Cellar/node/10.11.0/bin/node',
node-pre-gyp verb cli '/Users/adi/dev/github/open-source/p5.serialport/node_modules/serialport/node_modules/.bin/node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "/Users/adi/dev/github/open-source/p5.serialport/node_modules/serialport/build/Release/serialport.node" (not found)
node-pre-gyp http GET https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-darwin-x64.tar.gz
node-pre-gyp http 404 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-darwin-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
node-pre-gyp ERR! Tried to download(undefined): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
node-pre-gyp verb command build [ 'rebuild' ]
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport.o
../src/serialport.cpp:90:44: error: no matching member function for call to 'ToInt32'
return getValueFromObject(options, key)->ToInt32()->Int32Value();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../src/serialport.cpp:90:44: error: /Users/adi/.node-gyp/10.11.0/include/node/v8.hno: 2433matching: 43member: note: candidate function not viable: requires single argument 'context', but no
arguments were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
^
function/Users/adi/.node-gyp/10.11.0/include/node/v8.h:2446:34: note: candidate function not viable: requires single argument for'isolate', callbut tono
'ToInt32' arguments
were provided
return getValueFromObject(options, key)->ToInt32()->Int32Value();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/Users/adi/.node-gyp/10.11.0/include/node/v8.h:2433:43: note: candidate function not viable: requires single argument 'context', but no
arguments were provided
V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
^
/Users/adi/.node-gyp/10.11.0/include/node/v8.h:2446:34: note: candidate function not viable: requires single argument 'isolate', but no
arguments were provided
Local<Int32> ToInt32(Isolate* isolate) const);
^
Local<Int32> ToInt32(Isolate* isolate) const);
^
../src/serialport.cpp:102:44: error: no matching member function for call to 'ToNumber'
return getValueFromObject(options, key)->ToNumber()->NumberValue();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/Users/adi/.node-gyp/10.11.0/include/node/v8.h:2421:44: note: candidate function not viable: requires single ../src/serialport.cppargument: 102'context',: 44but: no
errorarguments: were noprovided matching
member function for call to 'ToNumber'
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
I just updated the p5.js web editor to use https, which broke @tigoe's p5.serial example. I had to change the file p5.serialport.js, on line 78, to
this.socket = new WebSocket("wss://" + this.hostname + ":" + this.serverport);
to get it to work.
I have tried everything I can think of to try and download p5.serialserver on a mac. I used all three methods suggested in the documentation. It keeps giving me errors that 3 arguments are required, but 2 were provided like below:
npm ERR! /path/path/path/node-gyp/17.4.0/include/node/v8-object.h:247:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! V8_WARN_UNUSED_RESULT Maybe Set(Local context, uint32_t index,
Then the following:
npm ERR! ^
npm ERR! 4 errors generated.
npm ERR! make: *** [Release/obj.target/bindings/src/serialport.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make
failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/path/path/path/.nvm/versions/node/v17.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.1.0
npm ERR! gyp ERR! command "/path/path/path/.nvm/versions/node/v17.4.0/bin/node" "/path/path/path/.nvm/versions/node/v17.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /path/path/path/.nvm/versions/node/v17.4.0/lib/node_modules/p5.serialserver/node_modules/@serialport/bindings
npm ERR! gyp ERR! node -v v17.4.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
I assume this is because there are updated required and some of the packages required have changed, but I'm not sure which packages or how to resolve this. Any ideas would be helpful.
When I try to sart the server with : $ node startserver.js
I get :
module.js:440
throw err;
^
Error: Cannot find module 'ws'
at Function.Module._resolveFilename (module.js:438:15)
at Function.Module._load (module.js:386:25)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object.start (C:\p5.serialport-master\p5.serialserver.js:23:24)
at Object. (C:\p5.serialport-master\startserver.js:4:14)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
What's wrong ?
I've noticed that all the P5 JS Editor examples in the main readme file in https://github.com/p5-serial/p5.serialport are giving 404 error. It's not a big problem because they are also hosted in the repo but I think it could be nice to either remove them or re-link them. Thanks!
Hello, I am one of the developers of WebJack (https://github.com/publiclab/webjack) and love your library. I was curious if you'd be interested in an audio connection implementation of this lib, which would wrap WebJack and allow for connecting using the browser's WebRTC microphone API. It's not as solid as your implementation but is nice because it requires no app, and works on phones.
I think making a WebJack wrapper offer exactly the same methods as p5.serialport would be pretty easy, but wanted to ask if you're interested in this first. Otherwise I think I could refactor the simple example i have to at least match p5.serialport: https://p5js.org/examples/interaction-arduino-sensor-data-via-webjack.html
Thanks!
Serial.list() should return a list. That way all the examples that do serial.list()[x] will be easier to translate from Processing. - Tom
It needs to be HTTPS/WSS on the client side, in the library to work through these services.
Probably just add a "secure" flag to the constructor.
Requires keeping an array of open ports with associated clients. Every operation would loop through the array and work on the appropriate client/port combination.
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.