Git Product home page Git Product logo

Comments (13)

zewelor avatar zewelor commented on July 17, 2024

Hi

There is generic ble scanner worker. Probably you can use it: https://github.com/zewelor/bt-mqtt-gateway/blob/master/workers/blescanmulti.py
https://github.com/zewelor/bt-mqtt-gateway/blob/master/config.yaml.example#L84

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

hello
thank you for the answer I looked and I did this:
`mqtt:
host: 192.168.1.140
port: 1883
#username: user
#password: password
#ca_cert: /etc/ssl/certs/ca-certificates.crt # Uncomment to enable MQTT TLS, update path to appropriate location.
#ca_verify: False # Verify TLS certificate chain and host, disable for testing with self-signed certificates, default to True
#client_cert: mosq_client.crt # If client_cert and client_key are specified, MQTT uses client certificate authentication instead of username + password
#client_key: mosq_client.key
topic_prefix: bt2mqtt # All messages will have that prefix added, remove if you dont need this.
client_id: bt-mqtt-gateway
availability_topic: lwt_topic

manager:
sensor_config:
topic: homeassistant
retain: true
topic_subscription:
update_all:
topic: homeassistant/status
payload: online
command_timeout: 35 # Timeout for worker operations. Can be removed if the default of 35 seconds is sufficient.
command_retries: 0 # Number of retries for worker commands. Default is 0. Might not be supported for all workers.
update_retries: 0 # Number of retries for worker updates. Default is 0. Might not be supported for all workers.
workers:
mysensors:
command_timeout: 35 # Optional override of globally set command_timeout.
command_retries: 0 # Optional override of globally set command_retries.
update_retries: 0 # Optional override of globally set update_retries.
args:
port: /dev/ttyUSB0
baudrate: 9600
topic_prefix: mysensors/out

miscale:

args:

mac: 00:11:22:33:44:55

topic_prefix: miscale

users: # Used for recognizing multiple people, as well as for decoding body metrics! (Optional)

Alex: # Name (used in MQTT to define a user topic)

weight_template: # The weight template that the user will be tracked by!

min: 70

max: 90

sex: male # Sex (male or female)

height: 185 # Height (in cm)

dob: 2000-01-11 # DOB (in yyyy-mm-dd format)

Olivia:

weight_template:

min: 30

max: 60

sex: female

height: 165

dob: 2000-02-22

update_interval: 1800

miflora:

args:

devices:

herbs: 00:11:22:33:44:55

topic_prefix: miflora

per_device_timeout: 6 # Optional override of globally set per_device_timeout.

update_interval: 300

blescanmulti:
  args:
    devices:
      nut01: F0:2C:AC:84:4C:31
      nut02: D3:E2:D7:F9:5E:D9
    topic_prefix: blescan
    available_payload: home
    unavailable_payload: not_home
    available_timeout: 0
    unavailable_timeout: 60
    scan_timeout: 10
    scan_passive: true
  update_interval: 60

`

It seems to give a few things but in my test I have 2 nut find 3 and I only see one on MQTT Explorer
image

When I do
sudo ./gateway.py

I have an error on the opening of the serial port ttyUSB0 that I cannot correct
image

Afterwards, during the deployment I change the path for the user
image

Then when I run the service I get this error again
image

So when restarting my VM there will no longer be the active service

thanks a lot for your help

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

In workers section of the config, leave only blescanmulti worker, delete everything else, if you don't want to use it ( you probably don't need anything else for now ).

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

sorry for the formatting of the code block there must be symbols in it badly recognized

yes I deleted or commented everything for future use like Miscale

on the other hand I do not understand the errors related to the serial port and the service which does not want to remain active.
if my VM is stopped and restart I lose bt2mqtt and I have to restart by hand

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

serial port is used AFAIK only by mysensors worker, from pasted config, looks like you got it still on. Delete it and it should run

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

Hello
Indeed I left my sensor
Removing more error is better :)
However, I can't get the service to activate.

image

image

image

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

Run it without service to get full logs.

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

I launched this
sudo ./gateway.py -d

image

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

Looks good. Not sure why service version doesn't start. I think you could try to add "-d" on the end of this line, maybe it will show some error: https://github.com/zewelor/bt-mqtt-gateway/blob/master/bt-mqtt-gateway.service#L9.

EDIT: Or maybe this: https://unix.stackexchange.com/questions/225401/how-to-see-full-log-from-systemctl-status-service

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

I started all over again I have this command which gives me
image

image

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

You probably missed this step:

sudo pip3 install -r requirements.txt

Also I would suggest try docker router, as it should be easier to work with and maintain.

from bt-mqtt-gateway.

jerome6994 avatar jerome6994 commented on July 17, 2024

good evening
I ordered it, it's weird!

I can't make it despite the advice
docker I don't have at all I only have VMs
behind this test I want to implement the solution on several pi zero to mesh the house better

from bt-mqtt-gateway.

zewelor avatar zewelor commented on July 17, 2024

I've looked at venv instructions and fixed them a bit. I'm not using this method so don't have much experience. If you want to mesh home with some bluetooth tags to see where is someone etc. I would recommend use some esp32 board with software like https://esphome.io/ or https://tasmota.github.io/docs/ or maybe something like this: https://home-assistant-guide.com/2021/09/09/is-espresense-the-successor-to-esp32-mqtt-room-weve-been-waiting-for/. Having few rpi zero is a headache to support them in long run. You got whole linux system running + possible problems with sdcard wearing after a lot of writes ( unless you configure os as read only ).

I would go with esphome route, you can probably use it with mqtt only without Home Assistant even.

from bt-mqtt-gateway.

Related Issues (20)

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.