Comments (18)
Did not work, as it kept trying to run again and cancel the previous one; in the end, I set up a service that runs the script at the start and if it stops, restarts it. works a treat.
Copied this https://gist.github.com/emxsys/a507f3cad928e66f6410e7ac28e2990f
from renogy-bt.
Hello,
I haven't tested the code with Home Assistant image, its designed primarily to run on Raspberry Pi OS, and then it sends data to Home Assistant using MQTT protocol.
from renogy-bt.
from renogy-bt.
Yeah that might work, it makes a clean install on new raspberry image. Not sure how the IP address looks like from docker though. But ideally a dedicated hardware is better for HA.
from renogy-bt.
i have now got it working in docker, I keep getting ERROR:root:Connection failed: le-connection-abort-by-local when running python3 ./example.py, some times it works, due to know what this might be, is this because its already connected. it not connected to anything else.
from renogy-bt.
this is full out put.
(venv) xxxxxxxx@raspberry:/opt/path/to/venv/bin/renogy$ python3 ./example.py
INFO:root:Starting client: BT-TH-xxxxxxxx => ac:xxx:xxx:1c:a4:xxx
INFO:root:Adapter status - Powered: True
INFO:root:Starting discovery...
INFO:root:Devices found: 8
INFO:root:Found matching device BT-TH-xxxxxxxx => [ac:xxx:xxx:1c:a4:xxx]
ERROR:root:Connection failed: le-connection-abort-by-local
from renogy-bt.
Are you close enough to the device?
from renogy-bt.
from renogy-bt.
Is the enable_polling
flag set to true in config.ini?
from renogy-bt.
from renogy-bt.
it seems to work after about 30 tries of running "python3 ./example.py" within terminal
from renogy-bt.
it seems to connect now and run, how do I get it to auto-run all the time without having to manually run the example file. thanks again
from renogy-bt.
If polling is enabled it should keep running. If you want to auto-start it on restarts add it to /etc/rc.local
. Or you can disable polling and schedule a periodic cron job using crontab.
from renogy-bt.
im not very good with Python,
/etc/rc.local does not really work, as i want it running all the time, and if it stops, I want it to restart, I tried cron job, but cant get that to run; the only way really is to run the code below in terminal.
source /opt/path/to/venv/bin/activate && cd /opt/path/to/venv/bin/renogy && python3 ./example.py >> /opt/path/to/venv/bin/renogy/log_file.log 2>&1
from renogy-bt.
Run crontab -e
and insert the following command:
*/5 * * * * /opt/path/to/venv/bin/renogy/example.py
This will run every 5 minutes (turn off polling in config.ini)
from renogy-bt.
from renogy-bt.
Yes, you can replace it with the full command. But you get the idea, */5 means it runs every five minutes.
from renogy-bt.
Finally got it working, had to add it as */5 * * * * /opt/path/to/venv/bin/python3 /opt/path/to/venv/bin/renogy/example.py
from renogy-bt.
Related Issues (20)
- can be deleted, wrong user error
- client can not be used directly HOT 1
- BT-2 device is undiscoverable HOT 2
- Error when using raspberry pi 4 HOT 9
- ERROR:root:base client cannot be used directly HOT 3
- plattform esp32-ble esphome - ENHANCEMENT
- install steps HOT 4
- dump example.py to text file or json locally? HOT 2
- tested also with RCC40RVRE HOT 4
- Can this be migrated to esphome ble
- ML2440 HOT 6
- Hammering MQTT servers? HOT 6
- Using Computer and USB-RS232 converter with Renogy Rover MPTT 40A, bypassing Bluetooth Module BT-01 HOT 2
- DCC50S ID via hub is 96, not 97 HOT 1
- Temperature showing up as hotter than surface of the sun. HOT 3
- Renogy Smart Shunt 300 Bluetooth HOT 13
- MQTT Discovery support HOT 5
- RICH SOLAR 60 HOT 1
- Help with RBT12100LFP-BT HOT 10
- How to run 2 config files ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from renogy-bt.