Search found 440 matches

by devnull
Wed Nov 06, 2019 9:49 am
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

Jimmo, I can work around this by setting a error flag and if the flag is set and connection fails, then clear the flag and retry the connection. This prevents the connection failure but wastes time attempting the connection twice, and it only appears to happen on the first connection after the error...
by devnull
Wed Nov 06, 2019 9:19 am
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

I need for this to be bullet proof as it will be running un-manned. I am getting a lot of disconnect interrupts with handle 65535 and this then appears to kill the next connection. This loop is simply stress testing, and I get the 65535 handle VERY frequently ! h1 = j.Dev(b"\xcb\xd0\xc5\x0c'\xbd") i...
by devnull
Wed Nov 06, 2019 7:40 am
Forum: Pyboard D-series
Topic: BLE Broadcasts vs Scans
Replies: 5
Views: 746

Re: BLE Broadcasts vs Scans

Yes, using those options it finds the devices immediately
by devnull
Wed Nov 06, 2019 5:32 am
Forum: Pyboard D-series
Topic: BLE Broadcasts vs Scans
Replies: 5
Views: 746

Re: BLE Broadcasts vs Scans

Also, not sure if this is related to the gap-scan timing you mentioned, but very often devices which the mac is known and can be connected to do not appear in the scan results, whether or not they are already connected. Only if I scan several times for a minute at a time will these devices be eventu...
by devnull
Wed Nov 06, 2019 4:11 am
Forum: Pyboard D-series
Topic: BLE Broadcasts vs Scans
Replies: 5
Views: 746

Re: BLE Broadcasts vs Scans

Jimmo, thanks, that's very helpful.

I have already checked the scan manufacturer's data and it does not contain active data, only static data such as the mac address and a couple of other byte variables.

Code: Select all

b"\x02\x01\x06\x03\x02 \xaa\x0e\xff\x00\x1f\x00\x00B\x01d\xcb\xd0\xc5\x0c'\xbd"
by devnull
Wed Nov 06, 2019 3:26 am
Forum: Pyboard D-series
Topic: BLE Broadcasts vs Scans
Replies: 5
Views: 746

BLE Broadcasts vs Scans

Sorrie for all of the BLE questions, I have googled but are not able to find a direct answer. It appears that beacons broadcast and that it is not necessary to connect to the device, but just to listen for a specific device broadcast and read it's data. But how would you do this ? - I know that with...
by devnull
Tue Nov 05, 2019 11:17 pm
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

@jimmo - I have just discovered on the Pyboard D, that sometimes it receives a disconnect interrupt for connection handle 65535, even though a connection for this handle was never opened.

It then appears that the next connect attempt will fail.

Any idea what this is ???
by devnull
Tue Nov 05, 2019 4:29 am
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

Now I am thinking that it might be that the device is not connecting and that it's nothing to do with the interrupt, but generically speaking if you modify a variable in an ISR and then in a loop read the value, could this be an issue ??
by devnull
Tue Nov 05, 2019 4:13 am
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

Well Jimmo, in this case it is part of the Peripheral class that you kindly provided me with: Class Peripheral: ... def connect(self,mswait=2000): if not self._connected: self._central._connecting_peripherals[(self._addr_type, self._addr)] = self self._central._ble.gap_connect(self._addr_type, self....
by devnull
Tue Nov 05, 2019 3:51 am
Forum: General Discussion and Questions
Topic: waiting for an interrupt flag to be set
Replies: 11
Views: 946

Re: waiting for an interrupt flag to be set

If the function is reading the value of self.connected inside the tight loop when self.connected is being modified by the interrupt will this cause problems ??