Nodejs using the node serial port module to communicate with an Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ม.ค. 2025

ความคิดเห็น • 49

  • @vtreanor
    @vtreanor 9 ปีที่แล้ว +60

    Great job. Just concise information.
    - No silly intro
    - No idiot chatter
    - No music
    Perfect!

  • @phoenixperry2
    @phoenixperry2 ปีที่แล้ว

    I miss you - this made me so happy to find you here on a search. This is awesome.Thanks for making it.

  • @anbdesign
    @anbdesign 7 ปีที่แล้ว +1

    Amazing tutorial, thanks Stacey! For those who have tried this recently and ran into problems like me, this tutorial was created with version 4.0 of serialport package, they seemed to have changed things in the 5.0 release. So use this command line instead: npm install serialport@^4.0.0 --save

  • @D4rkS7der
    @D4rkS7der 7 ปีที่แล้ว

    Great start to this topic, exactly what i was looking for.

  • @hayttman
    @hayttman 7 ปีที่แล้ว

    Awesome video! Love this stuff, I just wanted to see shotly what it was all about in order to know if it was what I was looking for and you provided just that! Thanks

  • @egeusz
    @egeusz 8 ปีที่แล้ว +2

    THIS WAS SOO HELPFUL!! thank you!!

  • @CanalFilipeCarvalho
    @CanalFilipeCarvalho 4 ปีที่แล้ว

    Great! Now I need to send this prompted data to a Database or something that allows me to do it. Any clues? All the best!!

  • @nguyencao8144
    @nguyencao8144 6 ปีที่แล้ว +2

    How do write data to Arduino?

  • @PrappoPrinceDeveloper
    @PrappoPrinceDeveloper 9 ปีที่แล้ว +1

    thanks Stacey Mulcahy . this is what im looking for :)

  • @SparrowHawkPilot
    @SparrowHawkPilot 8 ปีที่แล้ว +1

    Simply Marvelous!

  • @vinchelo
    @vinchelo 3 ปีที่แล้ว

    great! is it possible to send from node to arduino ?, any idea how to achieve that?

  • @sertu1462
    @sertu1462 4 ปีที่แล้ว

    For some reaseon, *parser:serialport.parsers.readline('
    ')* doesn't work.
    If I type * parser: new serialport.parsers.Readline('
    ') *, it does somewhat work, but it gives out the imput in hex code. Apart from that, the code is the same. Does anyone know what the problem might be?

  • @GOKHANDILEK
    @GOKHANDILEK 8 ปีที่แล้ว

    Hi, thanks for this.
    I am trying this with Arduino Yun.
    Could you please let me know how I can use network port to communicate with ardiono over wifi?

  • @davidvelasco861
    @davidvelasco861 5 ปีที่แล้ว

    Hi Miss Stacey, may we ask how to display serial outpur "Stacey" on an HTML with Node.js please

  • @FordExplorer-rm6ew
    @FordExplorer-rm6ew 4 ปีที่แล้ว

    Is the module still alive/available today?

  • @kaikai7702
    @kaikai7702 6 ปีที่แล้ว +1

    how to send data to device?

  • @mlavgn
    @mlavgn 6 ปีที่แล้ว +1

    Weren't you my prof one year?
    Hahaha
    Thanks for the tutorial.

  • @muhamadhaziq4839
    @muhamadhaziq4839 6 ปีที่แล้ว

    Hello miss, I want to ask something. Can you help me? I really need your help regarding my project. Thank you

  • @anup619thapa
    @anup619thapa 4 ปีที่แล้ว +3

    For newbies like me who tried this and had some errors.. here is the code that worked for me (Date: 03/26/2020)
    const serialport = require("serialport");
    const SerialPort = serialport.SerialPort;
    const portName = process.argv[2];
    const myPort = new serialport(portName,{
    baudRate:9600,
    parser: new serialport.parsers.Readline("
    ")
    })
    myPort.on('open',onOpen);
    myPort.on('data',onData);
    function onOpen(){
    console.log("Open Connection");
    }
    function onData(data){
    console.log("on Data " + data);
    }
    /// I am an absolute newbie so I cannot tell you why the code needed to be altered. My guess is the serial
    port version has changed.

    • @mohdmajidakhtar2122
      @mohdmajidakhtar2122 4 ปีที่แล้ว

      Can you tell me how you installed the module?

    • @anup619thapa
      @anup619thapa 4 ปีที่แล้ว

      @@mohdmajidakhtar2122 serialport? using npm install serialport

    • @mohdmajidakhtar2122
      @mohdmajidakhtar2122 4 ปีที่แล้ว

      @@anup619thapa its not installing now in windows10. Giving me errors.

    • @sertu1462
      @sertu1462 4 ปีที่แล้ว

      Thank you, it worked, pretty much. Did you do any changes besides *parser: new serialport.parsers.Readline("
      ")* ? because I could swear I had it like that before and it didn't work.

  • @tamaldas3544
    @tamaldas3544 5 ปีที่แล้ว

    this code is not working with latest version of serialport......can you please provide the code for same result in latest version?

    • @brianmillan1626
      @brianmillan1626 4 ปีที่แล้ว

      hi Tamal 0n dd you can solve it i try and results the same troubl

  • @funkyboodah
    @funkyboodah 6 ปีที่แล้ว

    is it the same using mac command line?

  • @MrChillerfx
    @MrChillerfx 6 ปีที่แล้ว

    How do you pass in a command to your arduino using serialport nodejs?? For example .. how to run a example.sh script file on your arduino using nodejs?

    • @sertu1462
      @sertu1462 4 ปีที่แล้ว

      The way I did it in a project I did a while back is by sending back the letter "a" using *myPort.write('a
      ')* in the js code. Could be any letter or string, doesn't have to be an "a". Reading that string on the Arduino is a bit tricky and I'm still not sure how I did it exactly, but here's the code
      *char out[1];*
      *Serial.readBytes(out, 1);*
      *if(out[0]=='a'){* your code *}*
      so once it recieves the letter, it does whatever code it is supposed to do. You don't really pass a command through the serialport in that case, only a signal that triggers whatever code you have on your arduino.
      Might be a bit late for you, but maybe it helps other people a little bit.

  • @bloggerdelptc
    @bloggerdelptc 7 ปีที่แล้ว

    Perfect!! Thank u so much!!

  • @oleonunez
    @oleonunez 7 ปีที่แล้ว

    actualiza el código por favor hoy no funciona.

  • @ChandanGogois
    @ChandanGogois 7 ปีที่แล้ว

    how to install node serialport module

  • @SheharyarSMAdil
    @SheharyarSMAdil 4 ปีที่แล้ว

    Getting Error: "Class constructor ReadLineParser cannot be invoked without 'new' ",

  • @EangFmbs
    @EangFmbs 7 ปีที่แล้ว

    You are my boost!

  • @naveenvignesh5
    @naveenvignesh5 7 ปีที่แล้ว

    How to handle serial port gets access denied error in windows 7

  • @brianmillan1626
    @brianmillan1626 4 ปีที่แล้ว

    i have a error here parser:serialport.parsers.readline("
    ") TypeError: Cannot read property 'parsers' of undefined but i cant solve it i dont understan what im doing worst but Congrats 4 amazing tutorial, thanks Stacey!

  • @psybrq
    @psybrq 6 ปีที่แล้ว

    Great and concise video, but please format the JS code better, it's driving me crazy!

  • @lantern10069
    @lantern10069 5 ปีที่แล้ว

    Great job!

  • @PokettoMusic
    @PokettoMusic 8 ปีที่แล้ว

    Thanks, it worked (:

  • @cluberic
    @cluberic ปีที่แล้ว +1

    this does not work anymore

  • @joshuaemekaosu1059
    @joshuaemekaosu1059 3 ปีที่แล้ว

    Thank you so much

  • @yunushkin88
    @yunushkin88 8 ปีที่แล้ว

    this beauty itself compared with the com port in WinAPI;).

  • @joelcohen9925
    @joelcohen9925 9 ปีที่แล้ว

    It doesn't let me have 2 connections to the same port, how do I fix that?

  • @smdrafiqq
    @smdrafiqq 9 ปีที่แล้ว

    Video is not clear :(

  • @stavoik3725
    @stavoik3725 6 ปีที่แล้ว

    Please read the tutorial here is the answer of many troubles! node-serialport.github.io/utilities/ReadLineParser.html

  • @saimjhojha9162
    @saimjhojha9162 3 ปีที่แล้ว

    😂😂😂🤣🤣🤣

  • @prakashsen1782
    @prakashsen1782 6 ปีที่แล้ว

    C:\Users\PRAKASH\Downloads
    ode-serialport-master
    ode-serialport-master>npm install serialport --save
    npm ERR! code ENOSELF
    npm ERR! Refusing to install package with name "serialport" under a package
    npm ERR! also called "serialport". Did you name your project the same
    npm ERR! as the dependency you're installing?
    npm ERR!
    npm ERR! For more information, see:
    npm ERR!
    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\PRAKASH\AppData\Roaming
    pm-cache\_logs\2018-06-17T10_14_03_413Z-debug.log