Related to Arduino communication through node.js with html/javascript

Asked 1 years ago, Updated 1 years ago, 283 views

First of all, I am a beginner who started JavaScript with personal study for about a month. I've been scratching and studying here and there to make a web controller, and I put a function in the button on the controller and hand over the data to Arduino, and Arduino gets the data and lights it up somewhere. It's that kind of project.

First, the web controller is done, so I have to communicate with Arduino through node.js, so I Googling. https://github.com/codeadamca/arduino-from-nodejs I'm trying to find this and follow it's... I connected Arduino to USB. It doesn't come up even if I do chgport... But the device manager says... So if you type the node app.js command to execute node by typing the name that appears in the device manager,

PS C:\Users\WSYS\Documents> node app
node:internal/modules/cjs/loader:1050 throw err; ^

Error: Cannot find module 'com4' Require stack:

It pops up like this 대체이 What is the problem? Or is there an easier way to communicate with Arduino than this? I can't speak other languages yet, but I can only speak a little JavaScript.

javascript arduino nodejs

2023-02-23 07:00

1 Answers

If you look at the error, it seems that the device cannot be found. First, check if the serial port is COM4, and when you open the device, set the value you put as path to COM4 instead of com4./


2023-02-23 09:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.