Giter Club home page Giter Club logo

lampify's People

Contributors

masterdevx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lampify's Issues

Failed to set advertising parameters

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.

Build fails undefined reference

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.

System info

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

Install dependencies:

sudo apt install libbluetooth-dev libnotify-dev make gcc

Missing deps not listed in readme

git

Clone repo in downloads folder

cd ~/Downloads
git clone https://github.com/MasterDevX/lampify.git
cd lampify

Try building

make

Build fail 1

/usr/include/glib-2.0/glib/gtypes.h:32:10: fatal error: glibconfig.h: No such file or directory
   32 | #include <glibconfig.h>

Fix

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

Build fail 2

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

Unable to setup (Raspberri PI 3)

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!

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.