Giter Club home page Giter Club logo

Comments (9)

MasterDevX avatar MasterDevX commented on September 24, 2024 1

First of all, I'm sorry for responding that late. Anyways..

When I try verbose mode for setup, I get right away [W] Failed to send notification!, without any timeout, so I am not even sure if it tries to send anything.

This message itself is a not an error but a warning, so the program should work normally even if this pops up. What you can try to do is to download the nRF Connect app on your phone, click "Scan" and check if something actually appers on the screen when you run Lampify commands. If not, that means your device you have Lampify installed on doesn't send any data to the lamp.

I first tried to install it on a Raspberry Pi 3b+ and found the same issue as @ReX1983. It now runs and says Connecting to the lamp, but then stops right away. Of course the lamps also don't flash, so it's not connecting to the lamps.

It's also a good idea to start with playing around nRF connect, check the paragtaph above.

I then tried it on a laptop with a Live Ubuntu on a usb drive, on which I successfully installed it, but got a different error when trying to run "lampify q setup" which is : "[E] Failed to set advertising parameters!".

Can you specify the exact laptop model? First, you can try using bluetooth as you would usually do (connect wireless headset, transfer files, etc.) to make sure the bluetooth actually works while booted with live USB.

Either for some reason the RPi does not transmit the advertising packet or something is wrong.

You can check that via nRF connect, details at the beginning of my comment.

It would be nice if @MasterDevX could tell us what version / distro of Linux and what bluetooth card they were using so we can see whether using an older operating system would help.

The distro is Arch Linux with kernel version 6.4.7. Laptop model: Lenovo ideapad 330-15IKB. The bluetooth card is Qualcomm Atheros QCA9377 (rev 31).

not sure what has changed in the linux bluetooth stack in the past three years but maybe this code only works on certain bluetooth cards / distros

The thing I've noticed is that the card you reported Lampify worked on has bluetooth version 4.2, while the other one has 5.3. First, I thought this is the reason and the code is just incompatible with buetooth 5.x version, but then I've checked on my bluetooth card specs once again and it has bluetooth 5.0. So it looks like this is not the cause of the problem.

from lampify.

RomuloGatto avatar RomuloGatto commented on September 24, 2024 1

Hello guys! I'm having the same issue, but I've found something that may be useful.

First, I was getting Failed to find adapter, then, I installed bluez and it evolved into the same error as @ReX1983 [W] Failed to send notification!

I was making some changes and then I discovered that hcitool(that is part of bluez, together with gatttool and bluetoothctl) seems to be incompatible with Bluetooth 5.0+, that way if I ran hcitool lescan, the error returned is Set scan parameters failed: Input/output error, which reassembles the error we all have on the on lampify.
image

For Bluetooth 5.0+, we should use bluetoothctl scan le, and it works as expected.
image

That's something that leads me to think that the code needs to do some checking to determine the version of the adapter and modify the command when 5.0+

from lampify.

techedgeoff avatar techedgeoff commented on September 24, 2024

Всем привет! Как оказалось, здесь важен порядок передачи библиотек. Просто поместите -lbluetooth и -lnotify после lampify.c
В моём случае это сработало!
Окончательный вид команды таков:

gcc -Wall -Ofast -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -I /usr/include/gdk-pixbuf-2.0 -o lampify lampify.c -lbluetooth -lnotify

P.S. Мой светильник EStares работает с приложением LampSmart Pro. Удалось успешно подключить его через lampify, однако работает не стабильно, буду разбираться дальше.

from lampify.

NBreskvar avatar NBreskvar commented on September 24, 2024

Hello, I was so exicted to find this app, since I have some lights that use LampSmart Pro on Android and I would love to get time schedule working for turning them on and off at specific times with a Raspberry Pi.

I first tried to install it on a Raspberry Pi 3b+ and found the same issue as @ReX1983. It now runs and says Connecting to the lamp, but then stops right away. Of course the lamps also don't flash, so it's not connecting to the lamps.

I then tried it on a laptop with a Live Ubuntu on a usb drive, on which I successfully installed it, but got a different error when trying to run "lampify q setup" which is : "[E] Failed to set advertising parameters!". I also tried it with a Live Debian Cinnamon, but it wouldn't recognise my bluetooth card there.

I'm not sure what to do next, but I would really love to get this working so I'm open to try anything!

from lampify.

bilalhp avatar bilalhp commented on September 24, 2024

@MasterDevX trying to run this on Raspberry Pi 3b+ and also observed that this is not working.

Everything seems to compile and run properly, but setup never happens.

Either for some reason the RPi does not transmit the advertising packet or something is wrong.

from lampify.

Zulex avatar Zulex commented on September 24, 2024

Did anyone seem to fix this? I wanted to integrate it in HA on the Rpi3 too

from lampify.

Justin8428 avatar Justin8428 commented on September 24, 2024

I also couldn't get this working on a laptop running Debian 12 (with AX210 wireless card which supports BLE).
After installing libbluetooth-dev the app compiles properly however when running it the app gets stuck on "[E] Failed to set advertising parameters!" similar to @NBreskvar
Doing some simple debugging in gdb seems to suggest the app gets stuck with the function hci_send_req() which appears to be part of the core bluez stack -- the function always returns -1 which I think means that the app is unable to communicate with the bluetooth card. Not sure if this is related to hci being depreciated in Bluez.
It would be nice if @MasterDevX could tell us what version / distro of Linux and what bluetooth card they were using so we can see whether using an older operating system would help.

I think "[W] Failed to send notification!" refers to the libnotify library which is probably only relevant for sending desktop notifications for GNOME-based environments.

(Interestingly when debugging the app on Ubuntu 20.04 it complains it can't find hci.c, again not sure if this has to do with modern Ubuntu putting the bluez stack in a snap. I'm not a C developer so feel free to correct the above statements if someone finds something else interesting.)

from lampify.

Justin8428 avatar Justin8428 commented on September 24, 2024

update: working on Debian 12 with an Intel AC-8265 wireless card, interestingly the AX210 might be too new / unsupported for the hci_send_req() function. not sure what has changed in the linux bluetooth stack in the past three years but maybe this code only works on certain bluetooth cards / distros

from lampify.

bilalhp avatar bilalhp commented on September 24, 2024

You can check that via nRF connect, details at the beginning of my comment.

I checked it, and there is activity. I can see RSSI value from "raspberrypi" updated each time I run setup. I guess it sends the packet and RSSI value is also good, but setup still never happens.

Is there a way to sniff BLE when I try setup with the original Lampsmart App?

from lampify.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.