Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
Cómo abrir el puerto serie USB usando Bonescript

Soy nuevo en el script de hueso, estoy tratando de abrir el puerto USB en serie pero recibo un error, aquí he pegado mi código, verifique y verifique el código, donde estoy cometiendo errores.

 var b = require('bonescript'); var port1='/dev/ttyUSB0'; var port2='/dev/ttyUSB2'; var options={ baudrate: 9600, parity: 'even', // parser: b.serialParsers.readline("\n") }; console.log(b.serialOpen(port1, options, onSerial1));// open port 1 console.log(b.serialOpen(port2, options, onSerial2));//open port 2 b.serialWrite(port1,'A');//start letter bouncing function onSerial1(x){ if (x.event == 'data') { console.log(x.data); var char =x.data;//get letter if(char=='Z') char='A';// reset or incremet else char++; b.serialWrite(port2,char); } } function onSerial2(x){ if (x.event == 'data') { console.log(x.data); var char =x.data; if(char=='Z') char='A'; else char+=1; b.serialWrite(port1,char); } } And I am getting error as follow

 /usr/local/lib/node_modules/bonescript/src/serial.js:16 if (m.ports[args.port].path) path = m.ports[args.port].path; ^ TypeError: Cannot read property 'path' of undefined at Object.m.doOpen (/usr/local/lib/node_modules/bonescript/src/serial.js:16:28) Waiting for the debugger to disconnect...
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!