-
Notifications
You must be signed in to change notification settings - Fork 308
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
Node-Red - add support for node-red-contrib-generic-ble #70
Node-Red - add support for node-red-contrib-generic-ble #70
Conversation
Following on from issue SensorsIot#64, this adds support for Bluetooth in Node-Red: 1. Adds two volume mappings to the template `service.yml`: ``` - /var/run/docker.sock:/var/run/docker.sock - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket ``` 2. Adds device mappings to the template `service.yml`: ``` devices: - "/dev/ttyAMA0:/dev/ttyAMA0" - "/dev/vcio:/dev/vcio" - "/dev/gpiomem:/dev/gpiomem" ``` 3. Changes `build.sh` to: * unconditionally satisfy the `eudev-dev` dependency for `node-red-contrib-generic-ble` by inserting these lines in the generated `Dockerfile`: ``` USER root RUN apk update RUN apk upgrade RUN apk add --no-cache eudev-dev ``` * Add `node-red-contrib-generic-ble` to the list of optional nodes. 4. Changes `menu.sh` to: * define a `user_in_group` function to facilitate checking whether the current user is a member of a particular group. * extends the initial checking performed by the menu to ensure that the current user is a member of both `docker` and `bluetooth` groups. > On the first run of the menu after this patch is applied, most users will likely encounter a reboot prompt enforcing membership of the `bluetooth` group.
Checks for existence of group.
I just added all the logic in this PR to the If you have this repo as your origin, you can:
To test it out. |
I can't think why it should affect anything but I set up my test RPi like this:
after that I can create a temporary branch to merge whichever of my pending pull requests I'm interested in:
switching back and forth between that and master as appropriate. With that as background, I applied your commands:
The checkout failed so I changed to:
Then I ran the menu.
The first time I let it do what it wanted by way of project update. After the installation of Python, I tried to build the stack. The display re-painted with "IOTstack Build Menu" but that was the only thing on the screen. I hit ESC and tried again. The second time:
I tried to build the stack and got the same result. Rinse, repeat for a few more attempts. I did not try the Any ideas? |
Then |
For the git issue, what happens if you run the command: Running My SD card juuust finished being imaged. Going to boot it up right now and install IOTstack on it. |
Trying
Then I tried Cleared the updates block. Tried again, this time permitting updates. Still constant repainting plus this left behind:
Wondered about "detached head" so tried Exit. Retry from ./menu and it worked again. There must be some difference between my checkout command and what the script does internally. Whaddyathink? |
Ah, this error I think is the reason: I will remove the fancy pants stuff, and lets see if that makes it work! |
Okay, I just pushed a new version of the build menu, where I've removed all non ASCII characters. Does that make it work? If not try starting |
No funny stuff with updates. Build stack = instant proper menu. I use a mixture of macOS Terminal + ssh, and an iPad app called Termius which sshes to the Pi. Similar behaviours on both. Whether that means anything ... |
Wait, does that mean it works :D? |
I would also try recloning it from SensorsIoT and running it that way. The other menus such as Do let me know if you find any other bugs! I'm still testing it out myself. Once I'm happy I'll merge it into the Experimental PR: #77 |
Long story - Discord discussion, trying things in VNC, wondering about date formats, experimenting, then trying Do you think that might be implicated? Feels counterintuitive because, if anything, this looks like it should be enabling non-ASCII rather than the other way around. Also can't really see how it would affect ssh sessions. It's just the only thing I could think of that might be implicated. |
I'm thinking "no". I'm thinking that:
isn't actually doing anything on remotes/origin/new-menu. I was so surprised by seeing something working that I didn't realise it was "old menu". I'll give a clean checkout a whirl.
|
Clean checkout is an improvement so I guess tangling things up with my fork did cause hassles. Learnt something there! Basic commands and responses:
In the build menu I chose:
Observations (I realise it's early days so this is just my two cents which, given that we're talking Australian Dollars is, to quote Terry Pratchett, less than a Hershebian Half Dong):
Hitting RETURN took me to the list of nodes for Node-Red. I selected the ones I use but I seem to recall reading somewhere that that bit isn't working yet so maybe all the On completion of the node selection, nothing seemed to happen. I eventually pressed a key (down-arrow, I think) and the main menu repainted. I selected Exit. I got a docker-compose.yaml for which a quick once-over returned "seems reasonable", plus that error about a .save.yml. Trying to bring the stack up got:
Contents of directory after all this:
so definitely no Repeating a menu run and re-selecting the same containers and node-red nodes produced the same result. |
Setup, with existing IOTstack folder (cloned from my fork with SensorsIot as upstream):
In theory, that should be the same as a clone of SensorsIot
Some things to note:
I selected (in no particular order):
For Node-Red, the defaults plus SQLite and BLE. The result was a YAML file and no complaints. 🤪 First time I've seen that screen!!! Then:
That seemed to come up without trouble but, although the
it didn't build Node-Red so I assumed anything with a Dockerfile still needs special treatment. The treatment I use is:
but that moaned like crazy about the image being in use with a stopped container. I got rid of the one it was complaining about but it just moved onto grizzling about another stopped container. In the end, I just:
Then I could finally get rid of the nodered base. I fired up:
and it started building Node-Red with the usual piles of warnings for SQLite and friends. Once that finished, a I was able to add a BLE node to Node-Red and it scanned successfully for nearby signals so I call that a successful test too. How much of this is explained by:
is something I'll leave to you to decide. 👍👍👍 |
The UTF-8 thing is something that makes very little sense. The file:
has some U+2102 characters ("⇒") near the top.
I use the first approach (ssh) for 99.9% of everything I do. That's all I use for muckin' around with IOTstack. This suggests everything in the ssh path understands a bit more than ASCII so I'm at a loss to explain what we were seeing before. Oh, I should add that I did the same test on my "live" RPi and it was the same. I had not run |
Awesome! Glad it's finally, (almost) working correctly haha. Yeah, not sure why portainer wasn't showing yesterday. I guess it doesn't really matter any more since it's showing, but if you wanted to, you could check out the specific commit that it wasn't showing with, and see if it now shows, that would at least tell us if it was some weird merge issue on your end, or if it was the actual stack. It's also possible that some code that I changed did cause stuff to start working. If the other menus are working from the main menu then I'll add back in the characters it was complaining about on the build menu, I'll let you know on Discord when I've done that. For now, I will begin testing all the services and setting up the build scripts with them, as lots of stuff has changed on many of the services since I originally started this, and despite merging master and trying to keep it up to date, it looks like some issues have slipped in! My first order of business will be NodeRed. |
There's still the weird issue of your screen shot showing things in alphabetical order while mine was all over the place. I hate unexplained non-deterministic outcomes. Always suggests something else is going on.
🛫
… On 22 Jun 2020, at 18:10, Slyke ***@***.***> wrote:
Awesome! Glad it's finally, (almost) working correctly haha. Yeah, not sure why portainer wasn't showing yesterday. I guess it doesn't really matter any more since it's showing, but if you wanted to, you could check out the specific commit that it wasn't showing with, and see if it now shows, that would at least tell us if it was some weird merge issue on your end, or if it was the actual stack.
It's also possible that some code that I changed did cause stuff to start working.
If the other menus are working from the main menu then I'll add back in the characters it was complaining about on the build menu, I'll let you know on Discord when I've done that.
For now, I will begin testing all the services and setting up the build scripts with them, as lots of stuff has changed on many of the services since I originally started this, and despite merging master and trying to keep it up to date, it looks like some issues have slipped in! My first order of business will be NodeRed.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I think that's just how the operating system is reporting the list of files back. It is easy to fix though so that it always reports the list back in alphabetical order. I'll change it to that! |
Following on from issue #64, this adds support for Bluetooth in
Node-Red:
Adds two volume mappings to the template
service.yml
:Adds device mappings to the template
service.yml
:Changes
build.sh
to:unconditionally satisfy the
eudev-dev
dependency fornode-red-contrib-generic-ble
by inserting these lines in thegenerated
Dockerfile
:Add
node-red-contrib-generic-ble
to the list of optional nodes.Changes
menu.sh
to:user_in_group
function to facilitate checking whetherthe current user is a member of a particular group.
the current user is a member of both
docker
andbluetooth
groups.