Monday, 4 May 2020

Very basic question and I hope I am in the right forum...

I am using ESP8266 web server to control GPIO. My Wi-Fi network give it an IP of ....99:3300And it works...THEN I decided to use node.js ( I am a beginner ) and here it isconst http = require('http');​const hostname = '192.168.1.99';const port = 3300;​const server = http.createServer((req, res) => {res.statusCode = 200;res.setHeader('Content-Type', 'text/plain');res.end('/5/on');});​server.listen(port, hostname, () => {console.log(`Server running at [http://$](http://$){hostname}:${port}/`);});It does not work...​Error: listen EADDRNOTAVAIL: address not available 192.168.1.99:3300[90m at Server.setupListenHandle [as _listen2] (net.js:1296:21)[39m[90m at listenInCluster (net.js:1361:12)[39m[90m at doListen (net.js:1500:7)[39m[90m at processTicksAndRejections (internal/process/task_queues.js:85:21)[39mEmitted 'error' event on Server instance at:[90m at emitErrorNT (net.js:1340:8)[39m[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)[39m {code: [32m'EADDRNOTAVAIL'[39m,errno: [32m'EADDRNOTAVAIL'[39m,syscall: [32m'listen'[39m,address: [32m'192.168.1.99'[39m,port: [33m3300[39m}my url request gpio 5 to be on ( /5/on) and it is working on the server created by ESP8266

Submitted May 04, 2020 at 09:46AM by sarishy

No comments:

Post a Comment