I know the IP of my computer, but when I try
require("http").get('http://192.168.0.5:3000', function(res) { res.on('data', function(d) { console.log("--->"+d); }); }).on('error', function(e) { console.log(' --- ERROR: ', e) });
require("http").get('http://192.168.0.5:3000', function(res) {
res.on('data', function(d) {
console.log("--->"+d);
});
}).on('error', function(e) {
console.log(' --- ERROR: ', e)
it shows the error
--- ERROR: { "code": -15, "message": "no response" }
--- ERROR: { "code": -15,
"message": "no response"
}
But I can access http://192.168.0.5:3000 on my desktop browser.
http://192.168.0.5:3000
Any thoughts on why Espruino might not be able to access it?
EDIT: hmm, I can access the Espruino if I know it's IP:
┌─[00:41:15/localhost/chronos/.../src/trusktr+trusktr.io]└─╼ ping 192.168.0.8PING 192.168.0.8 (192.168.0.8) 56(84) bytes of data.64 bytes from 192.168.0.8: icmp_seq=1 ttl=255 time=15.1 ms64 bytes from 192.168.0.8: icmp_seq=2 ttl=255 time=35.6 ms64 bytes from 192.168.0.8: icmp_seq=3 ttl=255 time=61.1 ms
┌─[00:41:15/localhost/chronos/.../src/trusktr+trusktr.io]
└─╼ ping 192.168.0.8
PING 192.168.0.8 (192.168.0.8) 56(84) bytes of data.
64 bytes from 192.168.0.8: icmp_seq=1 ttl=255 time=15.1 ms
64 bytes from 192.168.0.8: icmp_seq=2 ttl=255 time=35.6 ms
64 bytes from 192.168.0.8: icmp_seq=3 ttl=255 time=61.1 ms
Is there a way to make Espruino's IP static?
@trusktr started 8 years ago
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I know the IP of my computer, but when I try
it shows the error
But I can access
http://192.168.0.5:3000
on my desktop browser.Any thoughts on why Espruino might not be able to access it?
EDIT: hmm, I can access the Espruino if I know it's IP:
Is there a way to make Espruino's IP static?