{"action":"created","issue":{"url":"https://api.github.com/repos/platformio/platformio/issues/632","repository_url":"https://api.github.com/repos/platformio/platformio","labels_url":"https://api.github.com/repos/platformio/platformio/issues/632/labels{/name}","comments_url":"https://api.github.com/repos/platformio/platformio/issues/632/comments","events_url":"https://api.github.com/repos/platformio/platformio/issues/632/events","html_url":"https://github.com/platformio/platformio/issues/632","id":150589618,"number":632,"title":"Feature request: allow multiple VID/PID pairs when detecting serial ports","user":{"login":"nopdotcom","id":1357866,"avatar_url":"https://avatars.githubusercontent.com/u/1357866?v=3","gravatar_id":"","url":"https://api.github.com/users/nopdotcom","html_url":"https://github.com/nopdotcom","followers_url":"https://api.github.com/users/nopdotcom/followers","following_url":"https://api.github.com/users/nopdotcom/following{/other_user}","gists_url":"https://api.github.com/users/nopdotcom/gists{/gist_id}","starred_url":"https://api.github.com/users/nopdotcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nopdotcom/subscriptions","organizations_url":"https://api.github.com/users/nopdotcom/orgs","repos_url":"https://api.github.com/users/nopdotcom/repos","events_url":"https://api.github.com/users/nopdotcom/events{/privacy}","received_events_url":"https://api.github.com/users/nopdotcom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/platformio/platformio/labels/enhancement","name":"enhancement","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"valeros","id":886732,"avatar_url":"https://avatars.githubusercontent.com/u/886732?v=3","gravatar_id":"","url":"https://api.github.com/users/valeros","html_url":"https://github.com/valeros","followers_url":"https://api.github.com/users/valeros/followers","following_url":"https://api.github.com/users/valeros/following{/other_user}","gists_url":"https://api.github.com/users/valeros/gists{/gist_id}","starred_url":"https://api.github.com/users/valeros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeros/subscriptions","organizations_url":"https://api.github.com/users/valeros/orgs","repos_url":"https://api.github.com/users/valeros/repos","events_url":"https://api.github.com/users/valeros/events{/privacy}","received_events_url":"https://api.github.com/users/valeros/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/platformio/platformio/milestones/39","html_url":"https://github.com/platformio/platformio/milestones/2.9.0","labels_url":"https://api.github.com/repos/platformio/platformio/milestones/39/labels","id":1660803,"number":39,"title":"2.9.0","description":"","creator":{"login":"ivankravets","id":1760209,"avatar_url":"https://avatars.githubusercontent.com/u/1760209?v=3","gravatar_id":"","url":"https://api.github.com/users/ivankravets","html_url":"https://github.com/ivankravets","followers_url":"https://api.github.com/users/ivankravets/followers","following_url":"https://api.github.com/users/ivankravets/following{/other_user}","gists_url":"https://api.github.com/users/ivankravets/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankravets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankravets/subscriptions","organizations_url":"https://api.github.com/users/ivankravets/orgs","repos_url":"https://api.github.com/users/ivankravets/repos","events_url":"https://api.github.com/users/ivankravets/events{/privacy}","received_events_url":"https://api.github.com/users/ivankravets/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":13,"state":"open","created_at":"2016-03-22T21:01:59Z","updated_at":"2016-04-23T21:29:52Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-23T19:35:47Z","updated_at":"2016-04-23T21:40:37Z","closed_at":null,"body":"**PlatformIO Version** (`platformio --version`): PlatformIO, version 2.9.0.dev0\r\n\r\n### Description of problem\r\n\r\nSome boards’ serial ports don’t get auto-discovered when they’re using a variant PID.\r\n\r\nVID/PID pairs can vary for a board depending on the mode they’re in. I’m on a MediaTek LinkIt 7688 DUO. In pure bootloader mode, it shows up as 0E8D:AB00; when running a sketch, it uses 0E80:AB0***1***.\r\n\r\nDetection parameters are defined in the `boards.txt`: https://github.com/MediaTek-Labs/linkit-smart-7688-duo-arduino/blob/master/mtk/avr/boards.txt#L10\r\n```\r\nsmart7688.vid.0=0x0E8D\r\nsmart7688.pid.0=0xAB00\r\nsmart7688.vid.1=0x0E8D\r\nsmart7688.pid.1=0xAB01\r\n```\r\n\r\nI don’t think there is any need need to support multiple `-DUSB_PID` settings. In the 7688 DUO case, we always want to use AB0***1*** when building; when looking for the serial port to upload, just detect the `AB00` as well. \r\n\r\nThis is used quite a bit in core Arduino; the Leonardo definition is an example: https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/boards.txt#L267\r\n```\r\nleonardo.vid.0=0x2341\r\nleonardo.pid.0=0x0036\r\nleonardo.vid.1=0x2341\r\nleonardo.pid.1=0x8036\r\nleonardo.vid.2=0x2A03\r\nleonardo.pid.2=0x0036\r\nleonardo.vid.3=0x2A03\r\nleonardo.pid.3=0x8036\r\n```\r\n\r\nIn this case, the PID 0036 is the pure bootloader, and the 8036 is the CDC ACM device.\r\n\r\nVID 2341 belongs to “Arduino SA”, and 2A03 belongs to “dog hunter AG”. This is fallout from the Arduino.cc breakup. \r\n\r\n(For more fun, see the Arduino Micro definition at https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/boards.txt#L306 which tries to deal with the Arduino vs Genuino mess. I recommend totally ignoring this.)"},"comment":{"url":"https://api.github.com/repos/platformio/platformio/issues/comments/213836525","html_url":"https://github.com/platformio/platformio/issues/632#issuecomment-213836525","issue_url":"https://api.github.com/repos/platformio/platformio/issues/632","id":213836525,"user":{"login":"ivankravets","id":1760209,"avatar_url":"https://avatars.githubusercontent.com/u/1760209?v=3","gravatar_id":"","url":"https://api.github.com/users/ivankravets","html_url":"https://github.com/ivankravets","followers_url":"https://api.github.com/users/ivankravets/followers","following_url":"https://api.github.com/users/ivankravets/following{/other_user}","gists_url":"https://api.github.com/users/ivankravets/gists{/gist_id}","starred_url":"https://api.github.com/users/ivankravets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivankravets/subscriptions","organizations_url":"https://api.github.com/users/ivankravets/orgs","repos_url":"https://api.github.com/users/ivankravets/repos","events_url":"https://api.github.com/users/ivankravets/events{/privacy}","received_events_url":"https://api.github.com/users/ivankravets/received_events","type":"User","site_admin":false},"created_at":"2016-04-23T21:40:37Z","updated_at":"2016-04-23T21:40:37Z","body":"@valeros I propose to replace `vid` and `pid` by `hwid`. Hardware ID should be a list of pairs `[vid, pid]`. For example,\r\n\r\n```json\r\n    \"leonardo\": {\r\n        \"build\": {\r\n            \"core\": \"arduino\",\r\n            \"extra_flags\": \"-DARDUINO_ARCH_AVR -DARDUINO_AVR_LEONARDO\",\r\n            \"f_cpu\": \"16000000L\",\r\n            \"mcu\": \"atmega32u4\",\r\n            \"usb_product\": \"Arduino Leonardo\",\r\n            \"variant\": \"leonardo\",\r\n            \"hwid\": [\r\n              [\"0x2341\", \"0x8036\"],\r\n              [\"0x0036\", \"0x2A03\"]\r\n            ]\r\n        },\r\n        \"frameworks\": [\"arduino\"],\r\n        \"name\": \"Arduino Leonardo\",\r\n        \"platform\": \"atmelavr\",\r\n        \"upload\": {\r\n            \"disable_flushing\": true,\r\n            \"maximum_ram_size\": 2560,\r\n            \"maximum_size\": 28672,\r\n            \"protocol\": \"avr109\",\r\n            \"require_upload_port\" : true,\r\n            \"speed\": 57600,\r\n            \"use_1200bps_touch\": true,\r\n            \"wait_for_upload_port\": true\r\n        },\r\n        \"url\": \"http://arduino.cc/en/Main/arduinoBoardLeonardo\",\r\n        \"vendor\": \"Arduino\"\r\n    }\r\n```\r\n\r\nThe first item of array should be used for https://github.com/platformio/platformio/blob/develop/platformio/builder/scripts/frameworks/arduino.py#L121\r\n\r\nPlease update all boards with https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/boards.txt . Also need to add VID/PID from @arduino-org"}}