Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with nuimo-config-node #3

Open
Trisk3lion opened this issue Apr 9, 2019 · 13 comments
Open

Problem with nuimo-config-node #3

Trisk3lion opened this issue Apr 9, 2019 · 13 comments

Comments

@Trisk3lion
Copy link

Hello, I have a problem with the nuimo-config node won't start/initilize/work with the recent node-red version.
I have tried it with both node-red on raspberry pi 3B and on an debian intel nuc. I did get it to work a few month ago, maybe before the new year, on a raspberry pi so it could be node-reds fault.

Do you have any idea what the problel could be or maybe where how I could get some logs out and diagnose the problem?

@readeral
Copy link
Owner

Hi Trisk3lion,

I haven't updated node-red recently (nor have I been using my own package, as I've moved house 3 times since December!) - I'll upgrade node-red and will look at updating this project to work again, now that I've moved into a permanent house and have two Nuimos sitting and waiting for me to use.

As it was my first attempt at coding a node, there's probably things that I included in the code that weren't sanctioned parts of node-red which have consequently broken.

Al

@Trisk3lion
Copy link
Author

I 100% understand this hasn't been your first priority!

I look forward to see if you find anything, I wish i could inspect the code myself and figure it out but my programming skills are far, far from sufficiant.

@readeral
Copy link
Owner

readeral commented Apr 25, 2019 via email

@readeral
Copy link
Owner

So I've just gone to update Node-Red myself and noticed this little tid-bit:

You will also need to rebuild any nodes that have binary dependancies

This is the case for this node, as it does compile binary dependencies. I know it's an annoying process, but can you try uninstalling and reinstalling the node and see if that works?

@readeral
Copy link
Owner

Sorry, no need to uninstall/reinstall, just go for a rebuild - again from the NodeRed docs:

You will also need to rebuild any nodes that have binary dependancies. If you installed them in the recommended ~/.node-red directory, you can do this by:
cd ~/.node-red
npm rebuild
You will then need to restart Node-RED.

@Trisk3lion
Copy link
Author

Trisk3lion commented Apr 28, 2019

At last I got the opportunity to tinker some more with node-red.
This is my output when i run node-red-start

Welcome to Node-RED
28 Apr 17:27:15 - [info] Node-RED version: v0.20.3
28 Apr 17:27:15 - [info] Node.js  version: v10.15.3
28 Apr 17:27:15 - [info] Linux 4.14.98-v7+ arm LE
28 Apr 17:27:16 - [info] Loading palette nodes
28 Apr 17:27:22 - [warn] ------------------------------------------------------
28 Apr 17:27:22 - [warn] [node-red-contrib-nuimo-controller/nuimo-config] Error: Cannot find module 'bluetooth-hci-socket'
28 Apr 17:27:22 - [warn] ------------------------------------------------------
28 Apr 17:27:22 - [info] Settings file  : /home/pi/.node-red/settings.js
28 Apr 17:27:22 - [info] Context store  : 'default' [module=memory]
28 Apr 17:27:22 - [info] User directory : /home/pi/.node-red
28 Apr 17:27:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
28 Apr 17:27:22 - [info] Flows file     : /home/pi/.node-red/flows_heimdall.json
28 Apr 17:27:23 - [info] Server now running at http://127.0.0.1:1880/
28 Apr 17:27:23 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

28 Apr 17:27:23 - [info] Waiting for missing types to be registered:
28 Apr 17:27:23 - [info]  - nuimo-config

So I guess it is something to do with bluetooth-hci-socket not being installed? But shouldn't that be configured when installing the node or the prerequisites?
I should not that this is on Raspberry Pi 3 but I have the same problem with an Node-red instance running in docker on a intel nuc debian. Both of these are installed/deployed pretty recent so maybe it could be something with bluetooth-hci-socket not being installed as it should?

Edit: I tried the npm rebuild as well and it didn't have any effect.

Edit 2: Found this, could it be related? noble/node-bluetooth-hci-socket#107

@readeral
Copy link
Owner

readeral commented May 3, 2019

Thanks Trisk3lion, it certainly could be related. At the moment I don't have any further short term solution other than to downgrade it seems, I'm sorry! Did you go so far as to uninstall the node and reinstall it? The missing nuimo-config node is really curious. I wonder whether the upgraded version of node-red implements config nodes differently.

However - I'm working on my own implementation of a BLE server which is less generic, and specifically for connecting Nuimos to NodeRed. I've been working on it today, it's something I'll be working on for the next week, but to say I'm new to BLE programming is an understatement...

But sit tight, hopefully I can implement something a little more rigorous, and hopefully resolve the multiple nuimos issue at the same time.

@readeral
Copy link
Owner

readeral commented May 5, 2019

Hi @Trisk3lion, I've made some progress - I'm retaining use of Noble as now I better understand how it works, and how nuimojs (my main dependency) was using it, I think I've got it.

Unfortunately Noble seems essentially abandoned. Quite stable, but not working on Node 10. Thankfully there's a fork committed to keeping Noble up to date until it is actively maintained again, but nuimojs doesn't use that fork. In order to gain some extra features (like multiple nuimos, and better managing the bluetooth connection) and to utilise abandonware's fork, I'm going to drop nuimojs and just implement that layer myself.

At the moment I have a test program running Node 10 and happily connecting two Nuimos at once. Next step is to swap out nuimojs and do some tests. It'll take a few days, but hopefully I can get you sorted by the end of the week.

In the meantime, you might have some success modifying the nuimojs installed package to reference that fork of Noble instead of the one that it has installed.

@tobycheese
Copy link

Hi @readeral
Could you give an update on the status of node-red-contrib-nuimo?

I have an unused Nuimo controller sitting around that I really want to use. A node-red integration would be perfect, but if I have to, I might use senics python api to try to get a working solution. I am just trying to gauge which path to go.

Do you think you'll have the time to fix it and keep it current? Or are you not using it yourself anymore? Do you have specific issues that you would like to get help with? I don't have any experience with node, but some with javascript. And, like everybody else, just a very limited amount of time :-)

@readeral
Copy link
Owner

Hey @tobycheese,

Yeah I’ve really neglected this library, sorry! I do have Nuimo still but they’re not in use at the moment pending time to revisit this work, so I guess this is as good a prompt as ever to get going again. I haven’t looked into where Noble is at recently so hopefully there’s been some movement there as well.

Have you been having any/specific issues with the library yourself? It is unfortunately quite hard to install/build

@tobycheese
Copy link

There is absolutely no reason to apologise for anything, @readeral !

I have the same issue with Cannot find module 'bluetooth-hci-socket' as given by the OP. But I also have node-red and everything running in a docker container, and that could very well be the problem. The senic python API also does not work completely in that setup, it can see my Nuimo but not connect.

My next step is to take docker out of the equation until I can get things to work on plain raspbian. But I need a second bluetooth adapter because I don't want to pollute or take down my main system. I have spare RPIs, but only older ones without BT.

For know, I am not actively seeking help until I can properly isolate the problem :-)

@readeral
Copy link
Owner

Yeah ok. So clearly we need to get to the bottom of it.

The whole docker thing is sufficiently unfamiliar to me that troubleshooting a docker container approach is beyond me, but seriously, how different can it be that it makes a library like this impossible to use. So whatever the issue is, if it’s docker related, I guess this library would need a fix for that anyway.

I’ll dig into where and how that hci-socket module is installed and see what I can find.

@readeral
Copy link
Owner

readeral commented Nov 14, 2019

When you do npm install, do you get the warning that it has skipped the optional dependency of @abandonware/[email protected] (or noble/bluetooth-hci-socket) ?

If so, it could be that you'll need to install it manually. Unfortunately I don't want to make it a dependency of this library, because the package won't install on a mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants