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
thank you so much - thanks to you I was able to finish a project for university 🥳
Thats so cool bro this video gon help me a lot!
Thank you, that's was a great introduction to make the link between a webpage and the arduino.
Great! Glad it helped!
Excelente vídeo, mi amigo.
thank you. keep on sharing. God bless you.
Great video
Very simple. Thank you.
Glad it was helpful!
thank you adam!
You're welcome!
Thank you to help me to make my project, I am from Brazil
You are welcome!
Thank you
10/10
Great set of videos!! For a newbie… do you have a video that does the same thing but using the Arduino Ethernet shield?
Sorry, I have not done one using an ethernet connection yet.
hello sir, your video is so amazing, but i have questions, why i cant reference my .php file in index.php that i create?
it is a great video,, I'm getting this error that Cannot read properties of undefined (reading 'ReadLine')
did u solve it?
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.
Thanks for this!
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
if i remove that plugcable from arduio then still it work ? is there any your vifro of esp32 connecting to web page
I could use a video about esp32, have you found one?
Hi sir! Can you make tutorial also arduino to nodejs using esp8266 wifi module? Is it possible to control both end via wifi?
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
Hey man, Thanks for the video, Can you do the same over Ethernet?
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>
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
Hello Adam...can you help me implement this solution using laravel and web socket...
Thank you
I'm getting an error with CORS blocked. How do I fix it?
It would have helped a lot having the vsCode just in the screen, letters are imposible to read. thank you
Yea I know, my more recent videos have much larger text. Thanks for the feedback!
its throwing an error in this line-
var io = require('socket.io').listen(app);
why is that so ?
i got the same problem did you solve it?
@@suhyouriNo, not yet
var io = require('socket.io')(app);
works for me
@@uFikaz thx!! i fixed it and it worked!!
Thanks Jonas!
What if you were hosting the website on a hosting platform? Would there be a way to do it like that?
Hey, any luck finding a solution to this??
I didn't have the time to look for one
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!
You have to upload the code before you start the server, As the the server is busy because its communication through the serial port.
I keep getting this >>
TypeError: Cannot read properties of undefined (reading 'Readline')
at Object. (C:\Users\Hp\current\app.js:5:28)
its the serialport
I wish I could read your code more easily...
Yea I know. More recent videos have much larger text. Thanks!
@@codeadamca Great.. Thank you for your response..
But can you remake this topic again?😅..