Puck.js problem to save code #2993
Replies: 26 comments
-
|
Posted at 2019-05-20 by @gfwilliams What you're doing sounds fine, but... Have you updated your firmware at all? The 3 LEDs signifies an internal error, but as I recall that hasn't happened in firmwares for a year or more (it was usually to do with the secure bonding that HID devices often get asked to do) |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by migsanvi Thanks @gfwilliams for answering so quickly. Yesterday I updated my Puck.js to the latest firmware version: 2v03. It seems to have to do with the process of bonding to the phone. I have tried with another phone and it works correctly. Is there any way to remove the previous bondings before executing the code? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by @gfwilliams And it still crashes even with 2v03? Try booting the Puck with the button held down - see http://www.espruino.com/Puck.js#hard-reset - that should clear out any of the old bonding information that's in there. Perhaps somehow it got corrupted. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by AkosLukacs Also, maybe try to remove bonding/pairing info from your phone. At least windows goes stupid sometimes, maybe phones too. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by migsanvi Yes @gfwilliams, my Puck.js is currently running with version 2v03. It also happened with version 2v02. @AkosLukacs, the fault occurs even when the phone has been unbonded. With the unbonded phone, I remove the battery and when I put it back on, the 3 LEDS turn on at the same time ... The phone running Android 5.1 Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by @gfwilliams Did you do the proper hard reset on the Puck as described above? Just updating the firmware won't do it. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-21 by migsanvi @gfwilliams Yes, I do the Hard-reset following the instructions. In fact, when the Puck.js is left with the 3 LEDs blinking the only way to reconnect it to the PC (or to any device) is by doing a Hard-Reset. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-22 by @gfwilliams Wow, ok - so I believe it'll be something that particular phone is doing when connecting then. Which phone is it? Can you reproduce the issue with any other phone? Would you be able to connect a USB-TTL converter to the Puck that's having the problem as described in http://www.espruino.com/Puck.js#serial-console ? When it does the 3 lights thing it should then output an error message on Serial, and I can use that to try and track down where the error is coming from. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-23 by migsanvi Hello @gfwilliams, I am testing with two devices. The first, is a Samsung Galaxy A5 (model 2015, Android 6.0) and with it, the Puck.js works perfectly. The second device is a particular device (Walkie-talkie) called TELO 580 built in Android 5.1. This is my production device and with itconnected, when the battery is removed, the error occurs. Yesterday I bought an USB-TTL converter and today, when it arrives, I will test the Puck.js and I write the result. Thanks for you dedication. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-23 by migsanvi Hello @gfwilliams, I have received the USB-TTL converter and I have connected it to the Puck.js This is error: I hope you can help me, |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-23 by @gfwilliams Are you sure the code posted right at the beginning is the only code running on your device? That error corresponds to
It seems possible that your TELO 580 is reporting itself with an invalid Bluetooth LE MAC address. Please could you tell me what the MAC address the |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-24 by migsanvi Hi @gfwilliams,
Yes, I'm sure. I have to do a hard-reset every time the code is loaded, I connect the TELO and the Puck.js is restarted. When a hard-reset has been performed, the code that shows me On the other hand, I have loaded the following code to see the MAC address of the TELO: After connecting twice, this is the result ("e4:b3:18:0b:a6:de public" is the MAC of my PC). The other MACs correspond to TELO. It seems that they are random values... Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-24 by @gfwilliams I think you may have forgotten to post the result? I don't see any MACs listed... |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-27 by migsanvi Hi @gfwilliams, Yes, you're right. The rush is not good... (Spanish expression: "Las prisas no son buenas"). Sorry... The result of the code above is as follows: When the TELO bluetooth is turned off and on again, the MAC changes, although none of them is the real one (real MAC of TELO: 7e:eb:46:03:35:1c). Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-28 by @gfwilliams There's definitely something a bit odd with the addresses your TELO device is advertising. Basically if it's advertising a public or random address, Espruino will say (like it says your PC is If you look at the answer here https://devzone.nordicsemi.com/f/nordic-q-a/18877/i-want-to-change-the-ble-address you'll see the bottom two bits of the LSB in the address (the first one) have to be as in the spec. However the LSB of the MAC varies from I'm not sure what to suggest really - I'm pretty sure the error comes from Nordic's internal device libraries - so literally any Bluetooth device made by Nordic would have problems connecting to your device. You might be able to turn off the randomisation in your TELO device though? In that case you could stick with a standard BLE address that was ok. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-05-31 by migsanvi Hi @gfwilliams, The TELO580 is not a device purchased directly from the factory and I'm not sure the manufacturer will personalize a firmware ... A question. Why does the first time connect correctly and the error only occurs when the Puck.js is restarted? Does not the MAC check the first time? Thanks, |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-03 by @gfwilliams If it's Android I doubt you need to personalise the firmware - there may just be a setting somewhere to disable the feature. The Nordic libraries have some 'sanity checks' in them. Most likely when loading stored bonding data out of flash the address is checked - when it comes from Nordic's own 'binary blob' (eg direct from Bluetooth) it's not checked. It's difficult because this would appear to be something internal to Nordic's code so would require patching their code - I could produce a special binary for you that has full debug info for the error checks in I guess, and then we could see exactly where it got called from to be certain? |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-13 by migsanvi Hi @gfwilliams! For my part, there's no problem. If you give me a binary to load that gives us more information, I could load it and pass on the data you need. Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-13 by @gfwilliams Hi - please can you try this one and see what it says?Attachments: |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-17 by migsanvi Hi @gfwilliams! This morning (sorry for the delay!), I have loaded the firmware espruino_2v03.20_puckjs.zip into my Puck.js. This is the output with the new version: I hope it works. Thanks for your support and the inconvenience |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-17 by @gfwilliams Thanks for trying it out! So, as expected the error comes from Nordic's internal libraries as I'd said above but the error gets returned as a return code so it's possible for me to handle the error without crashing the device. Please can you give the attached firmware a try and see if that solves your issues? It'll still mention the error (and it won't load the saved bonding info) but it shouldn't crash.Attachments: |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-18 by migsanvi I have uploaded the firmware version in the Puck.js and it has worked! Effective, now when the TELO 580 is linked, when removing the battery to the Puck.js and put it back, it no longer gives the internal error (all the LEDs off) although the saved program does not load anymore I do not have to do a hard reset. For the Puck.js to work again, I just have to connect to the Web IDE and execute: Is this firmware compatible with the MDBT42Q module? I have made the prototype with Puck.js but the final version is with the module. Thank you! |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-18 by @gfwilliams
Are you sure you didn't insert the battery while holding the button down or something like that? However it is possible that the error flagged up by the bluetooth stack stops execution of the JavaScript code - in which case I'll need to make a few more changes.
That exact firmware isn't, but I made the changes for all boards, so any cutting edge build at http://www.espruino.com/binaries/travis/master/ will have the changes in, as will 2v04 when it is released. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-18 by migsanvi These are the results I have obtained with the new firmware (checked several times): With the TELO 580 paired, I remove the battery from the Puck-js until the bluetooth icon of the TELO 580 indicates that no device is connected. I wait about 10 seconds with the Puck-js battery removed. Then I put the battery back (Red LED lights once) but the program does not start. In some test, after a few seconds, the program has returned to work without doing anything. However, if I turn off the bluetooth of the TELO 580 and turn it on again, it automatically connects to the Puck.js and the program works again without having to execute the |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-18 by @gfwilliams So it's actually all ok? I just checked and the code doesn't register an error with Espruino, so it wouldn't end up pausing execution of any saved code. |
Beta Was this translation helpful? Give feedback.
-
|
Posted at 2019-06-18 by migsanvi Yes! everything works correctly in the Puck.js and the MDBT42Q module (updated to firmware version 2v03.32) When the Puck-js runs out of battery, I just have to turn off the bluetooth on the TELO 580 and turn it on again so that the whole system will work again. Although this is because of the TELO not of the Puck.js Thanks for the effort and support! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-05-20 by migsanvi
Hi at all!
I am working on a project that uses the HID features on BLE. In particular, I want to send a character (volume up) each time a button is pressed. This is my code:
To save the program I follow this step:
But when I remove the battery and put it back on (without pressing BTN), the three LEDs start flashing at the same time and the program does not work and any device recognize it (PC or mobile) until I do a Hard reset.
Can anyone tell me what it means to have the three LEDs blink at the same time?
What can I do to save my program and not be deleted when I change the battery?
Thank you very much in advance
Beta Was this translation helpful? Give feedback.
All reactions