jlama / powertagd

15 stars 7 forks source link

Extended quick start help #10

Closed Cicrocoft closed 1 year ago

Cicrocoft commented 1 year ago

Hi,

I've given up on pairing my 3P R9 power tags trough a hue smart switch and z2m, and now trying your solution.

I understand all the steps in the QuickStart guide, but step 2 "build powertagd with make". Could you "noobify" this step for me :-)?

Another question: What app do you use in HA to process the file it spits out, when everything is up and running? Was looking around in my influxDB addon, but failed to locate a locale file import.

jlama commented 1 year ago

To build, cd in the src directory and run make.

I don't use HA. powertagd simply outputs data to stdout, it doesn't create files. You need to process the output yourself or you can use the included powertag2influx app to send the data directly to InfluxDB.

Using powertag2influx, running powertagd would look something like:

powertagd | powertag2influx --token xxx --orgId xxx --bucket powertag
Cicrocoft commented 1 year ago

That simple 😂 Thanks.

Great, then I can create a sensor from the influxDB entries, and everything will look shinny and nice.

Will make a short how to, if/when I get it all working for future HA users.

Thanks again.

Seekersdk commented 1 year ago

Getting stuck at this error: Makefile:33: ash.o Error 127. Tried giving chmod x permissions to the files also.

image

Running Linux 5.15 64bit

Edit: Just saw it logged me on to my new account. Its still the same person writting... lol

Cicrocoft commented 1 year ago

Think I'll make a fresh Linux installation to test. Looks like it's a very reduced Linux installation HA runs on, so it's properly the issue.

jlama commented 1 year ago

The issue here is that you haven't any cc installed, i.e. a compiler. You need to install gcc or clang.

Seekersdk commented 1 year ago

Had to install gcc and alpine-sdk - Then it worked :) Thanks

Will flash dongle e now and see if it all works :)

Seekersdk commented 1 year ago

So, got the dongle flashed and running. Just need to fix the databse part now. It says:

image

Think I figured it out. Need to run the .go file in your git.. So for this I need Golang support in my HA container... Think I will end up installing this on a "clean and normal" Ubuntu installation instead of the container HA is running in.

jlama commented 1 year ago

You just need to install golang somewhere to build it, could be on any machine.

Seekersdk commented 1 year ago

Builded the influx file somewhere else, and move it to the HA system... then had to gcompat and libc6-compat, and I could run the file... So now im almost at the finish line I hope. Just need to add the USB dongle again, and link the database :)

apk add gcompat apk add libc6-compat

image

Do I need to specify the path for the USB dongle for the powertagd part? powertagd | powertag2influx --token xxx --orgId xxx --bucket powertag

Seekersdk commented 1 year ago

Got everything running finally... Just cant get the powertags to connect.

Powertag R9M63/R9M41

Getting this error: image

jlama commented 1 year ago

Weird. Seems like your PowerTag do some things differently. Can you run with the -v flag and post the result (text format) please?

Seekersdk commented 1 year ago

sure - give me 10min. Need to install Putty. Was using the build in terminal in HA... it is very basic

Seekersdk commented 1 year ago

This Alpine linux, HA and me will never become friends.

Find below log - Let me know if it is enough :) putty2.log

jlama commented 1 year ago

Thanks, I'll take a look later, but at first glance your PowerTags use a completely different set of commissioning options. I also have a R9M41 but it doesn't behave like this.

What is the Version number of your PowerTag? (It's on the PowerTag sticker, below the SN).

Cicrocoft commented 1 year ago

Lucky me 😂😩

Version: V004.000.424

jlama commented 1 year ago

So you have newer PowerTags than mines and they have changed how they are commissioned.

I've pushed some changes to the repo, please rebuild powertagd (rerun make), try again and let me know.

Seekersdk commented 1 year ago

There is a 90% chance it the Alpine linux being a annoyingthough, but just to confirm before I start adding stuff, is it me or you :P?

image

jlama commented 1 year ago

You must be missing a package, like libc-dev.

Seekersdk commented 1 year ago

Success (I think?):

image

jlama commented 1 year ago

Yes!

Seekersdk commented 1 year ago

Fantastic :)

Now I just need to get the database part to work. Getting connection refused when trying to connect to influx...

Seekersdk commented 1 year ago

Added --url for the direct ip to the server. Now it works :-)

Seekersdk commented 1 year ago

Got it all running nice and smooth now. Thank you for helping a Linux newb, @jlama.

Note to HA users wanting to run this within the HA container: When you update the HA core, you will losse all the libraries etc you have installed, and you need to reinstall them. The powertagd files and powertag2influx is still there.

image