Trying to get my device working... #2214
Replies: 13 comments
-
Posted at 2017-05-09 by billsalt Oh @gfwilliams, forgot to add that I'm running 1v92.54 on the puck-js. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-10 by billsalt @gfwilliams trying another method, by mac address. Also disconnects from IDE without changing the characteristic:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-10 by @gfwilliams That's odd - do you see the LEDs blink on for a fraction of a second - which would be the sign of an error? Please could you also try the standard 1v92 release and see if that behaves any better? Also, please could you check |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-10 by billsalt Battery is 100%. I reloaded with 1v92 release and similar behavior: not finding the service sometimes, and sometimes hanging and dropping the IDE. I haven't caught the LED blinking, though sometimes I have to pull the battery to reset to get the IDE connected again. Is there a serial debugger operating that I can catch? Any other ideas? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-10 by billsalt @gfwilliams one thought: could there be an issue with the number of devices returning information (buffer overflows)? I have at least a dozen BLE devices in my environment. I'll try to find an isolated coffee shop (though lots of devices show up now) to test this theory, but thought I'd pass this on in case there is a way to increase resources. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by @gfwilliams Yes, there's a serial connection available that might help? info here: http://www.espruino.com/Puck.js#serial-console There shouldn't really be a buffer overflow - because data is stored in Espruino's static jsvars, it's pretty difficult to get it to properly overflow. I also have quite a few BLE devices here and have never encountered problems - but roughly how many devices do you think you see in range? And are you using just the code you posted, or is there more? I guess if you're using up most of the RAM there is a small chance that the code doesn't handle running out of memory while searching for devices properly? If programming/debugging by serial you should at least see any error messages if they appear though. Having said that, having lots of BLE devices within range could probably make your connection more unstable. It's basically just luck whether their transmissions overlap or not, so once you get to a certain amount of devices all together it can make communications very unreliable. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-11 by billsalt @gfwilliams I'll look into the serial console connection. I have 14-18 devices within range, but went to a coffee shop where I was able to reduce that to 6 (too many fitness devices) and had similar results. The connection works just fine with an iOS, MacOS using LightBlue and my custom apps, so this is an issue I'm having solely with these espruino-based devices. I've had noble-based javascript application work using raspberry pi as well. Bottom line, it isn't a technology issue IMHO. Any additional debugging thoughts from you (or the community) would be greatly appreciated. There are several reasons I'd like to get espruino working for this. THANKS! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-12 by @gfwilliams Around 20 devices in range should really be ok, and 6 definitely - I have pretty much that many in range all the time. The IDE is running on Mac OS? Are you using literally just the code that you posted above, or is that part of a much larger project that you're uploading? Also, can you use that code to change a characteristic on a different BLE device? Could it be something specific about your custom device that is causing Puck.js problems? Final thing - you could try |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-15 by billsalt The IDE is running on MacOS, correct. The code I posted is exactly what I'm running on a completely reset and restored device (both with released and experimental Espruino). I'll try a different (128-bit) characteristic on another device, good suggestion, although LightBlue on both iOS and MacOS work just fine with it. I'll also try the more explicit representation you suggest. The truly maddening thing is that I've actually seen it work twice, but can't repeat it with any predictability! Thanks @gfwilliams! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-15 by billsalt Hi @gfwilliams, I get either no service found or an IDE disconnect, sometimes requiring I pull the battery to reset the (finder) device. Let me know if you get the same/different results, THANKS! LBS code:
Finder code:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-22 by billsalt Hi @gfwilliams- did you have a chance to try the example above? I'm curious if you (or others) repeat my issues and especially if there is a solution. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-23 by @gfwilliams Not yet, it's on my list. After the week off it took me literally all day yesterday to catch up on emails/forum posts. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-23 by @gfwilliams Just tried with 1v92 and looks ok to me - just gives me The The error is because I have a bunch of Bluetooth LE devices here and your code is trying to connect to the first one that's found, which is probably never the correct one. I changed your code to the following so that it works the same but searches for the correct device, re-uploaded, and the red LED comes on on the
Are you really using all those other pins though? Is it actually a Puck.js with a whole bunch of wires attached, or some other device? So yeah, it works fine for me as long as it's connecting to the correct device. If you want to connect by name look at |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-05-09 by billsalt
Hi @gfwilliams, I've picked this up again after another interruption. Here's the situation: I have a device with my own custom 128-bit service UUID and characteristics. It is a connectable iBeacon. I can connect easily with LightBlue (iOS) and view/change characteristics. I'm trying to connect to a service and change a characteristic that is an LED (00=off, ff=on). The code below has worked exactly twice, and fails a lot more. Failures are IDE disconnect, and "Uncaught Error: Unhandled promise rejection: No Services found". I can't reproduce when it passes, but it seems to be right after I've loaded a new revision of espruino (the first time). Very frustrating... Any ideas on how to debug what's happening? Code below (you helped me get this fixed last week or two), along with LightBlue screenshots.
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions