Skip to content

Unable to setup (Raspberri PI 3)Β #1

@ReX1983

Description

@ReX1983

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions