Closed mateusrdgs closed 7 years ago
This is the correct repo because only etherport (not etherportclient) works with StandardFirmataEthernet.
One problem you have is that you can't use pins 11, 12 or 13 on these boards when using an Ethernet Shield because those pins are used for the SPI connection between the board and the shield. If you try to blink pin 13, you are messing with the SPI clock signal and the shield will not work properly.
Well, I changed to pin 7 and nothing... Same timeout error when trying connect to the board.
Does your W5100 shield have a 6 pin connection down to the Aduino board's 6 pin ICSP connector?
You can also try extending the timeout:
var board = new five.Board({
port: new EtherPort(3030),
timeout: 1e5
});
Then in the ethernetConfig file in StandardFirmataEthernet, make sure you add your computer's IP address here. And either change the IP address on this line to 192.168.0.9 or comment it out (to use DHCP).
Yes, all the 6 pins are properly connected. I reset the board just to guarantee and did this procedure. Nothing.
// STEP 2[REQUIRED for all boards and shields]
// replace with IP of the server you want to connect to, comment out if using 'remote_host'
#define remote_ip IPAddress(192, 168, 0, 5)
// *** REMOTE HOST IS NOT YET WORKING ***
// replace with hostname of server you want to connect to, comment out if using 'remote_ip'
// #define remote_host "server.local"
// STEP 3 [REQUIRED]
// Replace with the port that your server is listening on
#define remote_port 3030
// STEP 4 [REQUIRED unless using DHCP]
// Replace with your board or ethernet shield's IP address
// Comment out if you want to use DHCP
#define local_ip IPAddress(192, 168, 0, 9)
// STEP 5 [REQUIRED]
// replace with ethernet shield mac. Must be unique for your network
const byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x53, 0xE5};
var five = require("johnny-five");
var EtherPort = require('etherport');
//var EtherPortClient = require('etherport-client').EtherPortClient;
var board = new five.Board({
port: new EtherPort(3030),
timeout: 1e5
});
//var board = new five.Board();
board.on("ready", function () {
var led = new five.Led(7);
led.blink(500);
});
Just a notice. In DHCP Address Printer sketch the mac address is this
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};
But in Standard Firmata Ethernet sketch, the mac address is this
const byte mac[] = {0x90, 0xA2, 0xDA, 0x00, 0x53, 0xE5};
Any need to change it on Standard Firmata sketch?
It doesn't matter what the MAC address is as long as it's unique on your network. So you will need to change at least the last number on one of your boards.
Understood. They are unique. All devices IP here are fixed on router, so I tried to comment out the line who defines the Arduino IP address on sketch. Doesn't work. This is strange, because when I ping on arduino, he answer me.
The ping doesn't even touch the sketch. I believe that's handled entirely by the Ethernet controller on the shield.
I can attempt to replicate your setup tonight to determine whether or not the issue could be related to StandardFirmataEthernet (I maintain Firmata).
That's okay. I'll wait. I appreciate your help, thanks.
The following setup works fine for me:
Mac OS X Arduino Uno Arduino Ethernet Shield (older Wiznet 5100 version) johnny-five v0.10.0 etherport v0.1.4 nodejs v6.10.1 Tested fine both with and without DHCP
Ethernet shield connected to a router on the same LAN as my laptop.
This is my code:
var EtherPort = require("etherport");
var five = require('johnny-five');
var board = new five.Board({
port: new EtherPort(3030),
repl: false
});
board.on("ready", function() {
console.log("READY!");
var led = new five.Led(8);
led.blink(500);
});
The only difference as far as I can tell between my setup and yours is Mac vs Linux.
I was also able to test successfully on Ubuntu 14.04. The only time I see the same error you do is when the IP address for the server is incorrect in the Arduino sketch.
Ok, so the error is here. I'm on work now, without my arduino. At noon I go home and try again. I must be letting something go. Thanks for now.
Also make sure port 3030 isn't blocked.
It's something wrong on my OS, but I don't know what. Right now i'm testing on Windows 10 and works well. I'm gonna investigate this. Thanks for your help Jeff.
Weird. Created a Ubuntu 14.04 VM in Gnome 16.04 and in Windows 10, both of them show me the timeout error. I changed the firmata host IP to VM IP, after to my machine IP. Also tried to connect on my raspberry pi running Raspbian, same error. All of them using node 6.10.2 and changed the port number. Only on windows 10 worked. Detail: I'm using dual-boot, so I don't think which is a problem with my hardware.
mine shows this error im using node js and a uno
1607790942364 Device or Firmware Error A timeout occurred while connecting to the Board.
Please check that you've properly flashed the board with the correct firmware. See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting
If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again. node:events:367 throw err; // Unhandled 'error' event ^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
type: 'error',
timestamp: 1607790942364,
class: 'Device or Firmware Error',
message: 'A timeout occurred while connecting to the Board. \n' +
'\n' +
"Please check that you've properly flashed the board with the correct firmware.\n" +
'See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting\n' +
'\n' +
"If connecting to a Leonardo or Leonardo clone, press the 'Reset' button on the board, wait approximately 11 seconds for complete reset, then run your program again.",
data: null
})
at new NodeError (node:internal/errors:278:15)
at Board.emit (node:events:365:17)
at Board.EventEmitter.emit (node:domain:470:12)
at Board.log (C:\Users\benal\node_modules\johnny-five\lib\board.js:642:8)
at Board.
Hi. I don't know if this the correct repository to report this issue or if I had to report on J5 repo. Let me know if it is. Anyway, i'm facing this error while trying to connect J5 to any of my arduino (I had two boards, a UNO and a MEGA).
My code is:
When I ping on either of them, they respond, and the RX/TX led blink.
I tried use EtherPortClient too, without success (that's why i said that I don't know if this is the correct repository to report this issue). I tried use the timeout on board, without success.
It's weird, because some days ago (a month ago, I think) I could use any of the boards without trouble to my network.
Just to clarify:
I will wait some help and let me know if I didn't report anything. Thanks, and sorry for my rusty english.