Communicating between an HTML/JavaScript Webpage and an Arduino

Поделиться
HTML-код
  • Опубликовано: 3 июл 2024
  • This is a video walk through of communicating from a webpage to an Arduino. The full process includes an HTML/JavaScript webpage sending messages to a Node.js server using Socket.io and then communicating to an Arduino using the serialport NPM package.
    Full Tutorial: codeadam.ca/learning/arduino-...
    Code: github.com/codeadamca/arduino...
    Node.js: nodejs.org/en/
    Socket.io: socket.io/
    Arduino: www.arduino.cc/
    Tinkercad: www.tinkercad.com/things/h0C0...
    NPM SerialPort: www.npmjs.com/package/serialport
    NPM Socket.io: www.npmjs.com/package/socket.io
    ---
    Website: codeadam.ca/
    Twitter: / codeadamca
    Instagram: / codeadamca
    GitHub: github.com/codeadamca
    Music: Dreams from Bensound.com

Комментарии • 50

  • @gjenetaosmanaj
    @gjenetaosmanaj 3 года назад +3

    thank you so much - thanks to you I was able to finish a project for university 🥳

  • @Mystical-TEDDY_
    @Mystical-TEDDY_ Год назад +1

    Thats so cool bro this video gon help me a lot!

  • @Alexis-rn8lf
    @Alexis-rn8lf 2 года назад +1

    Thank you, that's was a great introduction to make the link between a webpage and the arduino.

  • @anyersonespana6831
    @anyersonespana6831 7 месяцев назад

    Excelente vídeo, mi amigo.

  • @aristeosuguitan9091
    @aristeosuguitan9091 2 года назад +2

    thank you. keep on sharing. God bless you.

  • @sakibhasan7857
    @sakibhasan7857 3 года назад +2

    Great video

  • @michaelreeser5833
    @michaelreeser5833 2 года назад

    Very simple. Thank you.

  •  3 года назад

    thank you adam!

  • @claudiobarbosa926
    @claudiobarbosa926 2 года назад

    Thank you to help me to make my project, I am from Brazil

  • @andriipereverziev6287
    @andriipereverziev6287 Год назад +1

    Thank you

  • @anyersonespana6831
    @anyersonespana6831 7 месяцев назад

    10/10

  • @rtalich
    @rtalich 2 года назад +1

    Great set of videos!! For a newbie… do you have a video that does the same thing but using the Arduino Ethernet shield?

    • @codeadamca
      @codeadamca  2 года назад

      Sorry, I have not done one using an ethernet connection yet.

  • @Roxill_19
    @Roxill_19 Год назад

    hello sir, your video is so amazing, but i have questions, why i cant reference my .php file in index.php that i create?

  • @friendsintech001
    @friendsintech001 Год назад

    it is a great video,, I'm getting this error that Cannot read properties of undefined (reading 'ReadLine')

    • @ok-mj3nh
      @ok-mj3nh 10 месяцев назад

      did u solve it?

  • @drhastings
    @drhastings 2 года назад +3

    when moving to vs code follow these steps in order to avoid errors.
    to get package.json : npm init --y
    inside the file add
    "dependencies": {
    "socket.io": "^2.0.4",
    "serialport": "^9.0.1"
    },
    Then run npm i.

  • @Mus-i-c-wr1sy
    @Mus-i-c-wr1sy Год назад

    could you create a video about arduino uno monitoring soil moisture, humidity, relay, and controlling water pump using the website and display it and upload it to x10 hosting. kindly include the use of nodemCU if applicable

  • @S--xc4rv
    @S--xc4rv Год назад +1

    if i remove that plugcable from arduio then still it work ? is there any your vifro of esp32 connecting to web page

    • @noamasaraf586
      @noamasaraf586 Месяц назад

      I could use a video about esp32, have you found one?

  • @kadel2322
    @kadel2322 3 года назад +3

    Hi sir! Can you make tutorial also arduino to nodejs using esp8266 wifi module? Is it possible to control both end via wifi?

    • @codeadamca
      @codeadamca  3 года назад +1

      It is possible to achieve the same end result using WiFi, but the code is quite different. I would be happy to make a video, but it would not be for a while. I have quite the list I'm working on!!
      I did find this, which might help:
      forum.arduino.cc/index.php?topic=416227.0

  • @Arsalan0098
    @Arsalan0098 Год назад

    Hey man, Thanks for the video, Can you do the same over Ethernet?

  • @bencegedei4291
    @bencegedei4291 2 года назад +1

    How should I slow this problem?
    PS C:\Users\Game
    ode2> node app
    C:\Users\Game
    ode2\app.js:5
    const parser = new parsers.Readline({
    ^
    TypeError: Cannot read properties of undefined (reading 'Readline')
    at Object. (C:\Users\Game
    ode2\app.js:5:28)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47
    PS C:\Users\Game
    ode2>

    • @codeadamca
      @codeadamca  Год назад

      Were you able to find a solution? From the code snippet you provided, it looks like socket is not being included properly. Here is the app.js file in my GitHub repo:
      github.com/codeadamca/arduino-from-nodejs/blob/main/app.js

  • @riahiyassine7703
    @riahiyassine7703 9 месяцев назад

    Hello Adam...can you help me implement this solution using laravel and web socket...
    Thank you

  • @romeoshams7932
    @romeoshams7932 10 месяцев назад

    I'm getting an error with CORS blocked. How do I fix it?

  • @daromacs
    @daromacs 2 года назад

    It would have helped a lot having the vsCode just in the screen, letters are imposible to read. thank you

    • @codeadamca
      @codeadamca  Год назад

      Yea I know, my more recent videos have much larger text. Thanks for the feedback!

  • @varshithkumar7782
    @varshithkumar7782 3 года назад +2

    its throwing an error in this line-
    var io = require('socket.io').listen(app);
    why is that so ?

    • @suhyouri
      @suhyouri 3 года назад

      i got the same problem did you solve it?

    • @varshithkumar7782
      @varshithkumar7782 3 года назад +1

      @@suhyouriNo, not yet

    • @uFikaz
      @uFikaz 3 года назад +4

      var io = require('socket.io')(app);
      works for me

    • @suhyouri
      @suhyouri 3 года назад

      @@uFikaz thx!! i fixed it and it worked!!

    • @codeadamca
      @codeadamca  3 года назад +1

      Thanks Jonas!

  • @redstonation2005
    @redstonation2005 11 месяцев назад +1

    What if you were hosting the website on a hosting platform? Would there be a way to do it like that?

    • @wattsbeats3899
      @wattsbeats3899 11 месяцев назад

      Hey, any luck finding a solution to this??

    • @redstonation2005
      @redstonation2005 11 месяцев назад

      I didn't have the time to look for one

  • @banguyen2873
    @banguyen2873 7 месяцев назад

    When I run nodejs after uploading code to adruino uno, I get "Access denied" error in nodejs. And I upload the code to adruino after running nodejs, I get "port busy" error. Help me pleaes!

    • @waffle4063
      @waffle4063 7 месяцев назад

      You have to upload the code before you start the server, As the the server is busy because its communication through the serial port.

  • @hletowon6252
    @hletowon6252 Год назад

    I keep getting this >>
    TypeError: Cannot read properties of undefined (reading 'Readline')
    at Object. (C:\Users\Hp\current\app.js:5:28)

    • @giobtw
      @giobtw 8 месяцев назад

      its the serialport

  • @rfz6234
    @rfz6234 2 года назад

    I wish I could read your code more easily...

    • @codeadamca
      @codeadamca  2 года назад

      Yea I know. More recent videos have much larger text. Thanks!

    • @rfz6234
      @rfz6234 2 года назад +1

      @@codeadamca Great.. Thank you for your response..
      But can you remake this topic again?😅..