Code Monkey home page Code Monkey logo

Comments (2)

warhammerkid avatar warhammerkid commented on June 26, 2024

I don't currently have a raspbian system to verify this with, but once I do I'll update the README with instructions.

If you ran pip install bluetti_mqtt then you should have a bluetti-mqtt command installed (you might have needed to use pip3). On Ubuntu it's in /home/$USER/.local/bin/, but you can find where it is by running which bluetti-mqtt. If that doesn't work, run python -m site --user-base and look in the bin subfolder.

$ python -m site --user-base
/home/ubuntu/.local
$ ls /home/ubuntu/.local/bin/
bleak-lescan    bluetti-logger    bluetti-mqtt

Once you have the path to the bluetti-mqtt command you can use that in a systemd service. This file should be placed at /etc/systemd/system/bluetti-mqtt.service. You'll need to update the path, MQTT broker host, and bluetooth addresses.

[Unit]
Description=Bluetti MQTT
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=30
TimeoutStopSec=15
User=pi
ExecStart=/PATH/TO/bluetti-mqtt --broker BROKER_HOST_HERE BLUETOOTH_ADDRESS
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Once you've created the file, you should be able to run sudo systemctl enable bluetti-mqtt, so that it automatically starts when you reboot, and sudo systemctl start bluetti-mqtt to start it. If that doesn't work, try running sudo journalctl -u bluetti-mqtt to see if it printed out any errors.

from bluetti_mqtt.

dabene1408 avatar dabene1408 commented on June 26, 2024

Thanks, now it's working :)

from bluetti_mqtt.

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.