Does it work if you use the Arduino IDE instead? Regarding the "connection refused": does the sketch use Bridge?