diff --git a/HISTORY.rst b/HISTORY.rst index 10dcb2d1..dbe956f6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,19 @@ PlatformIO 3.0 PlatformIO 2.0 -------------- +2.9.4 (2016-06-04) +~~~~~~~~~~~~~~~~~~ + +* Show ``udev`` warning only for the Linux OS while uploading firmware + +2.9.3 (2016-06-03) +~~~~~~~~~~~~~~~~~~ + +* Added support for `Arduboy `__, the game system + the size of a credit card +* Updated `99-platformio-udev.rules `__ for Linux OS +* Refactored firmware uploading to the embedded boards with SAM-BA bootloader + 2.9.2 (2016-06-02) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/articles.rst b/docs/articles.rst index e844b961..8791784c 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -23,6 +23,7 @@ Here are recent articles about PlatformIO: 2016 ^^^^ +* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 30, 2016 - **Ron Moerman** - `IoT Development with PlatformIO `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ * May 26, 2016 - **Charlie Key** - `7 Best Developer Tools To Build Your NEXT Internet of Things Application `_ diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index 90054e71..b4fcf0e7 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -176,6 +176,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index 30f5aa76..d1e26c13 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -166,6 +166,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index 440ddb8c..9b755937 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -162,6 +162,26 @@ Adafruit - 8 Kb - 0.5 Kb +Arduboy +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``arduboy`` + - `Arduboy `_ + - ATMEGA32U4 + - 16 MHz + - 32 Kb + - 2.5 Kb + Arduino ~~~~~~~ diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index b9430876..fd04de77 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -240,6 +240,7 @@ Using Arduino Framework with Staging version Articles -------- +* Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ * May 22, 2016 - **Pedro Minatel** - `Estação meteorológica com ESP8266 (Weather station with ESP8266, Portuguese) `_ * May 16, 2016 - **Pedro Minatel** - `Controle remoto WiFi com ESP8266 (WiFi remote control using ESP8266, Portuguese) `_ diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 1c6c0cce..ebb13fb6 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -15,6 +15,7 @@ from __future__ import absolute_import from os.path import isfile, join +from platform import system from shutil import copyfile from time import sleep @@ -47,22 +48,27 @@ def TouchSerialPort(env, port, baudrate): sleep(0.4) -def WaitForNewSerialPort(env): - before = [i['port'] for i in get_serialports(use_grep=True)] - sleep(0.5) +def WaitForNewSerialPort(env, before): + print "Waiting for the new upload port..." + prev_port = env.subst("$UPLOAD_PORT") new_port = None elapsed = 0 - while elapsed < 10: - now = [i['port'] for i in get_serialports(use_grep=True)] - diff = list(set(now) - set(before)) - if diff: - new_port = diff[0] - break - + while elapsed < 5 and new_port is None: + now = get_serialports() + for p in now: + if p not in before: + new_port = p['port'] + break before = now sleep(0.25) elapsed += 0.25 + if not new_port: + for p in now: + if prev_port == p['port']: + new_port = p['port'] + break + if not new_port: env.Exit("Error: Couldn't find a board on the selected port. " "Check that you have the correct port selected. " @@ -85,6 +91,15 @@ def AutodetectUploadPort(env): env.Replace(UPLOAD_PORT=item['disk']) break else: + if (system() == "Linux" and + not isfile("/etc/udev/99-platformio-udev.rules")): + print ( + "\nWarning! Please install `99-platformio-udev.rules` and " + "check that your board's PID and VID are listed in the rules." + "\n https://raw.githubusercontent.com/platformio/platformio" + "/develop/scripts/99-platformio-udev.rules\n" + ) + board_hwids = [] if "BOARD" in env and "build.hwids" in env.BoardConfig(): board_hwids = env.BoardConfig().get("build.hwids") diff --git a/platformio/util.py b/platformio/util.py index 477687ae..0e5271d0 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -287,34 +287,7 @@ def exec_command(*args, **kwargs): return result -def get_serialports(use_grep=False): - - def _grep_serial_ports(): - result = [] - if system() == "Windows": - output = exec_command(["mode"]).get("out", "") - for line in output.split("\n"): - line = line.strip() - if "COM" in line: - result.append({"port": line[line.index("COM"):-1], - "description": "", "hwid": ""}) - else: - if system() == "Linux": - patterns = ["/dev/%s*" % p for p in ( - "ttyS", "ttyUSB", "ttyACM", "ttyAMA", "rfcomm", "ttyO")] - else: - patterns = ["/dev/tty.*", "/dev/cu.*"] - for pattern in patterns: - for port in glob(pattern): - result.append( - {"port": port, "description": "", "hwid": ""}) - return result - - if use_grep: - result = _grep_serial_ports() - if result: - return result - +def get_serialports(): try: from serial.tools.list_ports import comports except ImportError: @@ -332,9 +305,9 @@ def get_serialports(use_grep=False): result.append({"port": p, "description": d, "hwid": h}) # fix for PySerial - if not result and not use_grep: - result = _grep_serial_ports() - + if not result and system() == "Darwin": + for p in glob("/dev/tty.*"): + result.append({"port": p, "description": "n/a", "hwid": "n/a"}) return result diff --git a/scripts/99-platformio-udev.rules b/scripts/99-platformio-udev.rules index 5ac03b12..a3c846b7 100644 --- a/scripts/99-platformio-udev.rules +++ b/scripts/99-platformio-udev.rules @@ -45,8 +45,15 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="066 # QinHeng Electronics HL-340 USB-Serial adapter SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0666" -# ARDUINO UNO -SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0043", MODE:="0666" +# Arduino boards +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="[08][02]*", MODE:="0666" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="[08][02]*", MODE:="0666" + +# Arduino SAM-BA +ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{ID_MM_DEVICE_IGNORE}="1" +ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", ENV{MTP_NO_PROBE}="1" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666" +KERNEL=="ttyACM*", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE:="0666" # Digistump boards SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"