masterdevx / lampify Goto Github PK
View Code? Open in Web Editor NEWA simple CLI application to control the BLE lamp
A simple CLI application to control the BLE lamp
When I try to setup (or other commands) I get an error message.
$ ./lampify v setup
[I] Turning the lamp on
[E] Failed to set advertising parameters!
Looking at the code it fails when the hciSetParams
function returns. I assume this might be caused by my Bluetooth device driver not supporting this function. not sure how to fix this, help would be appreciated.
Hello I'm trying to build 'lampify' but I'm unable to do so, I've tried building on Linux mint and Kali linux both fail the same way.
Linux tom-mint 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
sudo apt install libbluetooth-dev libnotify-dev make gcc
git
cd ~/Downloads
git clone https://github.com/MasterDevX/lampify.git
cd lampify
make
/usr/include/glib-2.0/glib/gtypes.h:32:10: fatal error: glibconfig.h: No such file or directory
32 | #include <glibconfig.h>
Seems the missing header file is located at a different location in my system:
/usr/lib/x86_64-linux-gnu/glib-2.0/include
Fix: add the missing path to the Makefile
gcc -Wall -Ofast -I /usr/include/glib-2.0 -I /usr/lib/glib-2.0/include -I /usr/include/gdk-pixbuf-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -lbluetooth -lnotify -o lampify lampify.c
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `hciSetParams':
lampify.c:(.text+0x13d4): undefined reference to `hci_send_req'
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `sendPacket':
lampify.c:(.text+0x1430): undefined reference to `hci_get_route'
/usr/bin/ld: lampify.c:(.text+0x143f): undefined reference to `hci_open_dev'
/usr/bin/ld: lampify.c:(.text+0x14c7): undefined reference to `hci_send_req'
/usr/bin/ld: lampify.c:(.text+0x14f3): undefined reference to `hci_send_cmd'
/usr/bin/ld: lampify.c:(.text+0x150c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0x152c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0x1537): undefined reference to `hci_close_dev'
/usr/bin/ld: /tmp/ccvBgzpw.o: in function `decodeCommand':
lampify.c:(.text+0x17e9): undefined reference to `notify_init'
/usr/bin/ld: lampify.c:(.text+0x17f5): undefined reference to `notify_notification_new'
/usr/bin/ld: lampify.c:(.text+0x1805): undefined reference to `notify_notification_set_timeout'
/usr/bin/ld: lampify.c:(.text+0x180f): undefined reference to `notify_notification_show'
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: all] Error 1
I don't know how to fix this issue, it seems the hci functions are depreciated in Bluez, this might be causing the problem. I have no clue on how to fix this, I hope someone is able to help
Hello!
Firstly - let me thank you for your effort - I was looking for a way to control my lamp from Home Assistant and your project would be a great starting point. I have this ceiling lamp with hidden fans that I can control with its remote or via FanLamp Pro (Android app).
I tried to compile your project on a Raspberri PI 3 (running a fresh install of Raspberry Pi OS) but make failed:
/usr/bin/ld: /tmp/ccKXiblm.o: in function `hciSetParams':
lampify.c:(.text+0xa8c): undefined reference to `hci_send_req'
/usr/bin/ld: /tmp/ccKXiblm.o: in function `sendPacket':
lampify.c:(.text+0xacc): undefined reference to `hci_get_route'
/usr/bin/ld: lampify.c:(.text+0xad8): undefined reference to `hci_open_dev'
/usr/bin/ld: lampify.c:(.text+0xb38): undefined reference to `hci_send_req'
/usr/bin/ld: lampify.c:(.text+0xb64): undefined reference to `hci_send_cmd'
/usr/bin/ld: lampify.c:(.text+0xb7c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0xb9c): undefined reference to `hci_le_set_advertise_enable'
/usr/bin/ld: lampify.c:(.text+0xbac): undefined reference to `hci_close_dev'
/usr/bin/ld: /tmp/ccKXiblm.o: in function `decodeCommand':
lampify.c:(.text+0xe18): undefined reference to `notify_init'
/usr/bin/ld: lampify.c:(.text+0xe28): undefined reference to `notify_notification_new'
/usr/bin/ld: lampify.c:(.text+0xe34): undefined reference to `notify_notification_set_timeout'
/usr/bin/ld: lampify.c:(.text+0xe40): undefined reference to `notify_notification_show'
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: all] Error 1
After some research, I understood that it is a common issue that should be solved by using pkg-config, so my Makefile became:
`gcc -Wall -Ofast -o lampify `pkg-config --cflags glib-2.0 gdk-pixbuf-2.0` lampify.c `pkg-config --libs glib-2.0 gdk-pixbuf-2.0 libnotify` -lbluetooth`
In this way, make succeeds, but unfortunately lampify still doesn't pair with the lamp (setup doesn't result in the lamp blinking 3 times).
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.
Any idea?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.