{"action":"created","issue":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/465","repository_url":"https://api.github.com/repos/sandeepmistry/noble","labels_url":"https://api.github.com/repos/sandeepmistry/noble/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/sandeepmistry/noble/issues/465/comments","events_url":"https://api.github.com/repos/sandeepmistry/noble/issues/465/events","html_url":"https://github.com/sandeepmistry/noble/issues/465","id":177665807,"number":465,"title":"RPI3 Disconnects","user":{"login":"ddxtreme","id":3801976,"avatar_url":"https://avatars.githubusercontent.com/u/3801976?v=3","gravatar_id":"","url":"https://api.github.com/users/ddxtreme","html_url":"https://github.com/ddxtreme","followers_url":"https://api.github.com/users/ddxtreme/followers","following_url":"https://api.github.com/users/ddxtreme/following{/other_user}","gists_url":"https://api.github.com/users/ddxtreme/gists{/gist_id}","starred_url":"https://api.github.com/users/ddxtreme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddxtreme/subscriptions","organizations_url":"https://api.github.com/users/ddxtreme/orgs","repos_url":"https://api.github.com/users/ddxtreme/repos","events_url":"https://api.github.com/users/ddxtreme/events{/privacy}","received_events_url":"https://api.github.com/users/ddxtreme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-09-18T17:48:35Z","updated_at":"2016-10-23T20:38:47Z","closed_at":null,"body":"I tested a simple simple to connect to a BLE device, but i almost all the times receive a disconnect before connecting... Cant figure out why.\r\n\r\nThe same script on MacOS works as expected.\r\n\r\n```javascript\r\nvar noble   = require('noble');\r\n\r\nnoble.on('stateChange', function(state) {\r\n  if (state === 'poweredOn') {\r\n    noble.startScanning(['180d']);\r\n  } else {\r\n    noble.stopScanning();\r\n  }\r\n});\r\n\r\n\r\nnoble.on('discover', function(peripheral) {\r\n  console.log(peripheral.advertisement.localName);\r\n\r\n  peripheral.on('disconnect', function() {\r\n    console.log(\"disconnected\", peripheral.advertisement.localName)\r\n  });\r\n\r\n\r\n  peripheral.connect(function(error) {\r\n    peripheral.discoverSomeServicesAndCharacteristics(['180d'], ['2a37'], function(error, services, characteristics){\r\n      var service = services[0];\r\n      var characteristic = characteristics[0];\r\n      \r\n      console.log(characteristic);\r\n    });\r\n  });\r\n\r\n});\r\n```\r\n\r\n```javascript\r\nnode index2.js \r\nPolar H7 B861C114\r\ndiscovered Polar H7 B861C114\r\ndisconnected Polar H7 B861C114\r\n```\r\n\r\n\r\nHere the output of hcidump:\r\n\r\n```\r\nHCI sniffer - Bluetooth packet analyzer ver 5.23\r\ndevice: hci0 snap_len: 1500 filter: 0xffffffff\r\n2016-09-18 17:40:55.894473 > HCI Event: Command Complete (0x0e) plen 4\r\n    Set Event Mask (0x03|0x0001) ncmd 1\r\n    status 0x00\r\n2016-09-18 17:40:55.895041 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Event Mask (0x08|0x0001) ncmd 1\r\n    status 0x00\r\n2016-09-18 17:40:55.895551 > HCI Event: Command Complete (0x0e) plen 12\r\n    Read Local Version Information (0x04|0x0001) ncmd 1\r\n    status 0x00\r\n    HCI Version: 4.1 (0x7) HCI Revision: 0xb6\r\n    LMP Version: 4.1 (0x7) LMP Subversion: 0x2209\r\n    Manufacturer: Broadcom Corporation (15)\r\n2016-09-18 17:40:55.895955 > HCI Event: Command Complete (0x0e) plen 4\r\n    Write LE Host Supported (0x03|0x006d) ncmd 1\r\n    00 \r\n2016-09-18 17:40:55.896361 > HCI Event: Command Complete (0x0e) plen 6\r\n    Read LE Host Supported (0x03|0x006c) ncmd 1\r\n    00 01 00 \r\n2016-09-18 17:40:55.896915 > HCI Event: Command Complete (0x0e) plen 10\r\n    Read BD ADDR (0x04|0x0009) ncmd 1\r\n    status 0x00 bdaddr B8:27:EB:07:A3:EF\r\n2016-09-18 17:40:55.906495 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Scan Enable (0x08|0x000c) ncmd 1\r\n    status 0x0c\r\n    Error: Command Disallowed\r\n2016-09-18 17:40:55.906922 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Scan Parameters (0x08|0x000b) ncmd 1\r\n    status 0x00\r\n2016-09-18 17:40:55.912280 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Scan Enable (0x08|0x000c) ncmd 1\r\n    status 0x00\r\n2016-09-18 17:40:57.319102 > HCI Event: Command Status (0x0f) plen 4\r\n    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1\r\n2016-09-18 17:40:57.771967 > HCI Event: Command Status (0x0f) plen 4\r\n    LE Read Remote Used Features (0x08|0x0016) status 0x00 ncmd 1\r\n2016-09-18 17:40:57.773726 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Scan Enable (0x08|0x000c) ncmd 1\r\n    status 0x00\r\n2016-09-18 17:40:57.876261 > HCI Event: Disconn Complete (0x05) plen 4\r\n    status 0x00 handle 64 reason 0x3e\r\n    Reason: Connection Failed to be Established\r\n2016-09-18 17:41:00.207559 > HCI Event: Command Complete (0x0e) plen 4\r\n    LE Set Scan Enable (0x08|0x000c) ncmd 1\r\n    status 0x0c\r\n    Error: Command Disallowed\r\n```"},"comment":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/comments/255612796","html_url":"https://github.com/sandeepmistry/noble/issues/465#issuecomment-255612796","issue_url":"https://api.github.com/repos/sandeepmistry/noble/issues/465","id":255612796,"user":{"login":"sandeepmistry","id":1163840,"avatar_url":"https://avatars.githubusercontent.com/u/1163840?v=3","gravatar_id":"","url":"https://api.github.com/users/sandeepmistry","html_url":"https://github.com/sandeepmistry","followers_url":"https://api.github.com/users/sandeepmistry/followers","following_url":"https://api.github.com/users/sandeepmistry/following{/other_user}","gists_url":"https://api.github.com/users/sandeepmistry/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeepmistry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeepmistry/subscriptions","organizations_url":"https://api.github.com/users/sandeepmistry/orgs","repos_url":"https://api.github.com/users/sandeepmistry/repos","events_url":"https://api.github.com/users/sandeepmistry/events{/privacy}","received_events_url":"https://api.github.com/users/sandeepmistry/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T20:38:47Z","updated_at":"2016-10-23T20:38:47Z","body":"@BasKiers @cscholze what peripheral devices are you using? Maybe the noble connection parameter are used need to be adjusted?\r\n\r\n@BasKiers have you tried to see if `gatttool` exhibits similar behaviour?"}}
{"actor":{"display_login":"sandeepmistry"}}