From eb0c2c9baa7db4f96a5b9e5b69b677552f7ce6b9 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 10 Feb 2015 15:51:47 +0100 Subject: [PATCH 1/9] Added virtual bool operator==(const bool value) and virtual bool operator!=(const bool value). Fixes #2611 Bug introduced with #1700 --- libraries/Ethernet/src/EthernetClient.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/Ethernet/src/EthernetClient.h b/libraries/Ethernet/src/EthernetClient.h index 1992db052..16e2500bc 100644 --- a/libraries/Ethernet/src/EthernetClient.h +++ b/libraries/Ethernet/src/EthernetClient.h @@ -24,6 +24,8 @@ public: virtual void stop(); virtual uint8_t connected(); virtual operator bool(); + virtual bool operator==(const bool value) { return bool() == value; } + virtual bool operator!=(const bool value) { return bool() != value; } virtual bool operator==(const EthernetClient&); virtual bool operator!=(const EthernetClient& rhs) { return !this->operator==(rhs); }; From 3fec636b295c7aebfb3cc13f946ce3f81867a130 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Mon, 16 Feb 2015 20:11:17 +0100 Subject: [PATCH 2/9] An attempt to improve Yun's discovery. Thanks @roadfun. See #2576 --- .../discoverers/NetworkDiscovery.java | 32 ++++++++++++++----- .../src/processing/app/helpers/NetUtils.java | 2 +- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java b/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java index 85cd05c66..106b50924 100644 --- a/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java +++ b/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java @@ -58,19 +58,35 @@ public class NetworkDiscovery implements Discovery, ServiceListener, cc.arduino. @Override public List discovery() { - List ports = clonePortsList(); - Iterator iterator = ports.iterator(); - while (iterator.hasNext()) { + List boardPorts = clonePortsList(); + Iterator boardPortIterator = boardPorts.iterator(); + while (boardPortIterator.hasNext()) { try { - BoardPort board = iterator.next(); - if (!NetUtils.isReachable(InetAddress.getByName(board.getAddress()), Integer.parseInt(board.getPrefs().get("port")))) { - iterator.remove(); + BoardPort board = boardPortIterator.next(); + + InetAddress inetAddress = InetAddress.getByName(board.getAddress()); + int broadcastedPort = Integer.valueOf(board.getPrefs().get("port")); + + List ports = new LinkedList(); + ports.add(broadcastedPort); + + //dirty code: allows non up to date yuns to be discovered. Newer yuns will broadcast port 22 + if (broadcastedPort == 80) { + ports.add(0, 22); + } + + boolean reachable = false; + for (Integer port : ports) { + reachable = reachable || NetUtils.isReachable(inetAddress, port); + } + if (!reachable) { + boardPortIterator.remove(); } } catch (UnknownHostException e) { - iterator.remove(); + boardPortIterator.remove(); } } - return ports; + return boardPorts; } private List clonePortsList() { diff --git a/arduino-core/src/processing/app/helpers/NetUtils.java b/arduino-core/src/processing/app/helpers/NetUtils.java index c67245801..96fe6ff09 100644 --- a/arduino-core/src/processing/app/helpers/NetUtils.java +++ b/arduino-core/src/processing/app/helpers/NetUtils.java @@ -11,7 +11,7 @@ public abstract class NetUtils { Socket socket = null; try { socket = new Socket(); - socket.connect(new InetSocketAddress(address, port), 100); + socket.connect(new InetSocketAddress(address, port), 300); return true; } catch (IOException e) { return false; From 0990f98b1430bdd79022d48981f91ddf354bae78 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Thu, 19 Feb 2015 09:34:32 +0100 Subject: [PATCH 3/9] InetAddress.isReachable is reported reliable on mac and recent java versions Refactored NetUtils.isReachable to two functions: isReachableByEcho and isPortOpen If the first one will fail, the second one will be used --- .../discoverers/NetworkDiscovery.java | 5 +--- .../src/processing/app/helpers/NetUtils.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java b/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java index 106b50924..6f593571a 100644 --- a/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java +++ b/arduino-core/src/cc/arduino/packages/discoverers/NetworkDiscovery.java @@ -75,10 +75,7 @@ public class NetworkDiscovery implements Discovery, ServiceListener, cc.arduino. ports.add(0, 22); } - boolean reachable = false; - for (Integer port : ports) { - reachable = reachable || NetUtils.isReachable(inetAddress, port); - } + boolean reachable = NetUtils.isReachable(inetAddress, ports); if (!reachable) { boardPortIterator.remove(); } diff --git a/arduino-core/src/processing/app/helpers/NetUtils.java b/arduino-core/src/processing/app/helpers/NetUtils.java index 96fe6ff09..67201bf3d 100644 --- a/arduino-core/src/processing/app/helpers/NetUtils.java +++ b/arduino-core/src/processing/app/helpers/NetUtils.java @@ -4,10 +4,37 @@ import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; +import java.util.Arrays; +import java.util.List; public abstract class NetUtils { + private static boolean isReachableByEcho(InetAddress address) { + try { + return address.isReachable(100); + } catch (IOException e) { + return false; + } + } + public static boolean isReachable(InetAddress address, int port) { + return isReachable(address, Arrays.asList(port)); + } + + public static boolean isReachable(InetAddress address, List ports) { + if (isReachableByEcho(address)) { + return true; + } + + boolean reachable = false; + for (Integer port : ports) { + reachable = reachable || isPortOpen(address, port); + } + + return reachable; + } + + private static boolean isPortOpen(InetAddress address, int port) { Socket socket = null; try { socket = new Socket(); From 0b6e274b5dacd7da4b6acb3f68e8ef939dca44d7 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Thu, 19 Feb 2015 18:08:15 +0100 Subject: [PATCH 4/9] Bridge.ino example: comment fixed --- libraries/Bridge/examples/Bridge/Bridge.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/Bridge/examples/Bridge/Bridge.ino b/libraries/Bridge/examples/Bridge/Bridge.ino index 78343f01c..74c912d4c 100644 --- a/libraries/Bridge/examples/Bridge/Bridge.ino +++ b/libraries/Bridge/examples/Bridge/Bridge.ino @@ -26,8 +26,8 @@ #include #include -// Listen on default port 5555, the webserver on the Yún -// will forward there all the HTTP requests for us. +// Listen to the default port 5555, the Yún webserver +// will forward there all the HTTP requests you send YunServer server; void setup() { From 606604d7d6c4bf12f022e013836347c4001f77b2 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 19 Feb 2015 17:26:44 +0100 Subject: [PATCH 5/9] Update revision log. Version set to 1.6.1. --- arduino-core/src/processing/app/BaseNoGui.java | 4 ++-- build/shared/revisions.txt | 10 ++++++++++ hardware/arduino/avr/platform.txt | 2 +- hardware/arduino/sam/platform.txt | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index d9cf887f9..de51e50be 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -37,9 +37,9 @@ import processing.app.packages.LibraryList; public class BaseNoGui { /** Version string to be used for build */ - public static final int REVISION = 10600; + public static final int REVISION = 10601; /** Extended version string displayed on GUI */ - static String VERSION_NAME = "1.6.0"; + static String VERSION_NAME = "1.6.1"; static File buildFolder; diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 73a84f275..ba7557fd2 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,4 +1,14 @@ +ARDUINO 1.6.1 + +[ide] +* Improved Yun detection for upload via network (Ron Guest) +* In platforms.txt "objcopy" recipe is no more tied to the "hex" format (Arnav Gupta) +* /dev/cu.* serial ports are now filtered from the port list on MacOSX +* Ports in ports list are now grouped by type +* Upgraded avr-gcc toolchains to 3.4.5 +* Fixed wrong parsing of boards.txt when using submenu and boards id with underscores + ARDUINO 1.6.0 - 2015.02.09 [ide] diff --git a/hardware/arduino/avr/platform.txt b/hardware/arduino/avr/platform.txt index 051bd013b..797e7e3bf 100644 --- a/hardware/arduino/avr/platform.txt +++ b/hardware/arduino/avr/platform.txt @@ -6,7 +6,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Arduino AVR Boards -version=1.6.0 +version=1.6.1 # AVR compile variables # --------------------- diff --git a/hardware/arduino/sam/platform.txt b/hardware/arduino/sam/platform.txt index 41d10efe8..27a562b8b 100644 --- a/hardware/arduino/sam/platform.txt +++ b/hardware/arduino/sam/platform.txt @@ -5,7 +5,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=Arduino ARM (32-bits) Boards -version=1.6.0 +version=1.6.1 # SAM3 compile variables # ---------------------- From 3bd694d78b63c038cdb52dea97f28573db452d48 Mon Sep 17 00:00:00 2001 From: PaulStoffregen Date: Sun, 22 Feb 2015 03:54:44 -0800 Subject: [PATCH 6/9] Update status bar when custom menus change --- app/src/processing/app/Base.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 451a5bed9..350ceeeb0 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1187,6 +1187,7 @@ public class Base { Action subAction = new AbstractAction(_(boardCustomMenu.get(customMenuOption))) { public void actionPerformed(ActionEvent e) { Preferences.set("custom_" + menuId, ((TargetBoard)getValue("board")).getId() + "_" + getValue("custom_menu_option")); + onBoardOrPortChange(); } }; subAction.putValue("board", board); From e385f67fce1f7e68579420410a32ff6c5df9e4ef Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Thu, 12 Feb 2015 10:20:27 +0100 Subject: [PATCH 7/9] Better error message when opening serial monitor on a busy serial device. Closes #2632 --- app/src/processing/app/Editor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 7d3b9b0de..af95a8fcc 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -26,6 +26,7 @@ import cc.arduino.packages.MonitorFactory; import com.jcraft.jsch.JSchException; +import jssc.SerialPortException; import processing.app.debug.*; import processing.app.forms.PasswordAuthorizationDialog; import processing.app.helpers.OSUtils; @@ -2572,6 +2573,12 @@ public class Editor extends JFrame implements RunnerListener { statusError(_("Unable to connect: is the sketch using the bridge?")); } catch (JSchException e) { statusError(_("Unable to connect: wrong password?")); + } catch (SerialException e) { + String errorMessage = e.getMessage(); + if (e.getCause() != null && e.getCause() instanceof SerialPortException) { + errorMessage += " (" + ((SerialPortException) e.getCause()).getExceptionType() + ")"; + } + statusError(errorMessage); } catch (Exception e) { statusError(e); } finally { From 0ae9e3a0d0788691f469651f9bee72147977fbf6 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Wed, 25 Feb 2015 11:20:40 +0100 Subject: [PATCH 8/9] Libraries: added missing properties --- libraries/LiquidCrystal/library.properties | 2 +- libraries/SD/library.properties | 4 ++-- libraries/Stepper/library.properties | 4 ++-- libraries/TFT/library.properties | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/LiquidCrystal/library.properties b/libraries/LiquidCrystal/library.properties index 05d2c9faa..4786c58c5 100644 --- a/libraries/LiquidCrystal/library.properties +++ b/libraries/LiquidCrystal/library.properties @@ -1,6 +1,6 @@ name=LiquidCrystal version=1.0 -author= +author=Arduino, Adafruit maintainer=Arduino sentence=Allows communication with alphanumerical liquid crystal displays (LCDs). For all Arduino boards. paragraph=This library allows an Arduino board to control LiquidCrystal displays (LCDs) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works with in either 4 or 8 bit mode (i.e. using 4 or 8 data lines in addition to the rs, enable, and, optionally, the rw control lines). diff --git a/libraries/SD/library.properties b/libraries/SD/library.properties index 088d7c60f..ad4a6d686 100644 --- a/libraries/SD/library.properties +++ b/libraries/SD/library.properties @@ -1,7 +1,7 @@ name=SD version=1.0 -author= -maintainer= +author=Arduino, SparkFun +maintainer=Arduino sentence=Enables reading and writing on SD cards. For all Arduino boards. paragraph=Once an SD memory card is connected to the SPI interfare of the Arduino board you are enabled to create files and read/write on them. You can also move through directories on the SD card. category=Data Storage diff --git a/libraries/Stepper/library.properties b/libraries/Stepper/library.properties index 7e2ab9698..30b7cea44 100644 --- a/libraries/Stepper/library.properties +++ b/libraries/Stepper/library.properties @@ -1,7 +1,7 @@ name=Stepper version=1.0 -author= -maintainer= +author=Arduino +maintainer=Arduino sentence=Allows Arduino boards to control a variety of stepper motors. For all Arduino boards. paragraph=This library allows you to control unipolar or bipolar stepper motors. To use it you will need a stepper motor, and the appropriate hardware to control it. category=Device Control diff --git a/libraries/TFT/library.properties b/libraries/TFT/library.properties index 46e9d26ed..68ea4b6e4 100644 --- a/libraries/TFT/library.properties +++ b/libraries/TFT/library.properties @@ -1,7 +1,7 @@ name=TFT version=1.0 -author= -maintainer= +author=Arduino, Adafruit +maintainer=Arduino sentence=Allows drawing text, images, and shapes on the Arduino TFT graphical display. For all Arduino boards. paragraph=This library is compatible with most of the TFT display based on the ST7735 chipset category=Display From b1b83c09898d2b21ae2e136e4ecba5311f397eab Mon Sep 17 00:00:00 2001 From: sngl Date: Mon, 10 Nov 2014 17:00:27 +0100 Subject: [PATCH 9/9] Updated YunClient::connect method' Now it stop the connection on the linux side when it fails --- libraries/Bridge/src/YunClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Bridge/src/YunClient.cpp b/libraries/Bridge/src/YunClient.cpp index 82965894a..0c5dc479f 100644 --- a/libraries/Bridge/src/YunClient.cpp +++ b/libraries/Bridge/src/YunClient.cpp @@ -160,7 +160,7 @@ int YunClient::connect(const char *host, uint16_t port) { if (connected()) return 1; - opened = false; + stop(); handle = 0; return 0; }