EspruinoHub crashes when gettingServices while writing from node-red #2064
Replies: 24 comments
-
Posted at 2016-12-31 by dklinkman @solick I had a very similar problem. I got into the EspruinoHub code and made several changes to the logic and it seems to help a lot. At least for me. Plus I fixed a few other little things. You're welcome to try it out. :post: https://github.com/dklinkman/EspruinoHub Also if you want to try a slightly newer firmware look here |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-01 by solick Thanks, tried your version and now the programm don´t crash but the commands are still not excecuted an puck. Tried to switch LEDs on and off, nothing happend. :(
BTW maybe you should make a pull request to the original repo? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-01 by dklinkman It's hard to know what's wrong exactly. Clearly the hub is connecting to the puck. You did say sometimes it works. I'm using an RPi3 and the built in bluetooth. This is what I get using the same code for the hub. I can do it 10 times in a row and it's reliable:
Have you updated the firmware in your puck? What version? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-02 by solick Hi, puck firmware is 1v90, not the beta version. Mybe ist is a problem with node version? I use node v6.9.2 Have you tried with LED1.set() just to be sure? Is there a debug mode in your version so that i can see what is going on? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-02 by Eric Just to add a little more info to this thread. Everything appears to work as expected as far as monitoring the Pucks, but writing crashes the EspruinoHub almost every time. I have tested with @dklinkman version and also tried the beta 1.9.12. It appears slightly more stable and I have manage one or two writes to two different Puck's, but 9 times out of 10 it fails and the EspruinoHub restarts. The error usually get is an out of bounds error, or timed out getting services message. I have also tried using the HTTP proxy setting for the Pi bluetooth, but this made little or no difference. Node-red is currently at version 0.15.12 Any help towards fixing this would be very useful if anyone has any further suggestions. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-02 by solick Hi Eric, which version of node itself are you using? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-02 by Eric Hi Solick, Node is at v0.10.29 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by @gfwilliams @dklinkman please could you issue a PR with your changes to |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-04 by dklinkman @gfwilliams should I just send you the file? I think a pull request has to include all the changes for a commit level. Or so I think, I've actually never done a PR. I'm happy to attempt a PR on the full commit. 4 files I think. The changes to connect.js are more extensive than discovery.js. I don't know what you mean by 'UART specific", except that it is in fact the UART service and characteristic that the code is retrieving. For some reason job.device.discoverAllServicesAndCharacteristics(...) in the original code was not returning for me, so the timeout would always occur, or at least 95% of the time. So I changed the logic to use discoverServices() and discoverCharacteristics() which worked very well. That's the gist of the changes there except I also added a recursive function to write additional chunks of data when the data was more than 20 bytes. Works well! Oh and I fixed the /ble/read topic code which was crashing due to a missing parameter. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-05 by solick @dklinkman @gfwilliams is there a special debug parameter to start the program? Than i would be able to debug on my system and see what happens... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-05 by @gfwilliams Ahh, sorry - just glanced at it quickly and saw You'd have had to have manually submitted the file by Git - it's probably slightly easier if I do it but if you'd submitted it would have preserved your name as the committer for those lines of code. Since I'm dragging in everything it's not an issue though edit: Sorry, there's no special debug command as far as I know |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-05 by @gfwilliams Thanks - just pulled in. Removed the old code and renamed |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-06 by dklinkman Ahh. Yes. I should have noticed that the service is not limited to the uart service. Just happened to be in the use case. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-06 by @gfwilliams Well, if it works it doesn't really matter what it's called - thanks for all your work on this! :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-07 by solick Still Eric´s and my problem is not solved with this update. Any idea on this Gordon? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by @gfwilliams What error messages do you get displayed now, with the update? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-11 by Eric Hi Gordon,
Sometimes it connects, but mostly it fails. I am running out of things to try. Is there any debug info available to get to the bottom of this? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-11 by @gfwilliams The timeout getting services sounds just like what @dklinkman's changes were supposed to fix. At the moment I'm afraid there is no extra debugging - but I'm not sure what else we could print that would help (apart from turning on something inside Noble itself). We're asking 'Noble' to return the available services and the function is never returning. Does |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-11 by Eric Just ran dmesg and it all looks clean from the boot start apart from the last line: [ 5324.782444] Bluetooth: Failed to add device to auto conn whitelist: status 0x0c Not sure what this implies but it only appears once in the list after several successful and unsuccessful writes. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-20 by solick Hi still same problem like Eric has. This is very frustrating because node red support was one of the things i was aiming for to play around with dmesg shows a lot of data length messages and some rxheader problems:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-23 by @gfwilliams @solick so you're using an up to date OS and EspruinoHub software? And the MQTT advertising data is arriving just fine - it's just when you go to connect? The It could be that there's some power fluctuation that's messing things up. I'm stabbing around in the dark a bit though - I mean, I have a Pi 3 here that's working great - and they should presumably all be the same. ACTUALLY how are you connecting to the Pi 3? Via WiFi, or Ethernet? I had problems with a Chromebook where I was trying to stream my display over WiFi and Bluetooth LE connections kept dropping out - I guess it's possible that if you're using WiFi you could be having similar problems? I know my Pi 3 is connected over Ethernet so I wouldn't have that issue. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-02-09 by solick @gfwilliams sorry for my late reply was very busy during the last weeks. I need to check OS but it is from September last year I think. hub software updated for the last trial. pi3 is connected via ethernet I need to check the power supply and will come back to you. Thanks for hints and kind regards Lyn |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-03-05 by solick @gfwilliams, the power supply seems to have been the problem. Now it works!! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-03-06 by @gfwilliams Great! Thanks for letting us know! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-12-31 by solick
Hi, just started finally to play around with my puckjs.
Web IDE works fine.
Installed node-red and esprinoHub und a Raspi 3.
Getting RSSI values etc. works fine, but when sending code with inject button (LED set and reset) i got mostly the following error:
a few times it worked to set a led but reset allways crashed.
Just installed 1v90 on puck but problem remains.
Any idea on this?
Followed the instuctions to stop bluetoothd but still the problem remains.
Thanks and kind regards
solick
Beta Was this translation helpful? Give feedback.
All reactions