Closed riker65 closed 3 years ago
You could try something like
PYTHONPATH=. python3 examples/vedirect_print.py
This will add the current directory to the Python module search path and allow python to find the vedirect module under the vedirect directory.
https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH
For the setup.py you need to provide the install command.
python3 setup.py install
thanks , working now for the example
how to run vedirect with designated USB1?
python3 vedirect.py --port /dev/ttyUSB1
Running the vedirect_print.py
example using /dev/ttyUSB1 would be
PYTHONPATH=. python3 examples/vedirect_print.py --port /dev/ttyUSB1
Running the
vedirect_print.py
example using /dev/ttyUSB1 would be
PYTHONPATH=. python3 examples/vedirect_print.py --port /dev/ttyUSB1
ok thanks this worked.
what is vedirect/vedirect.py used for?
thanks a lot
vedirect/vedirect.py
is the library code implementing the Victron VE.Direct protocol.
ah ok understood
another questions: how to add user and password of MQTT broker?
would this work?
` parser.add_argument('--mqttuser', help='MQTT broker address', type=str, default='user') parser.add_argument('--mqttpw', help='MQTT broker address', type=str, default='pw') parser.add_argument('--mqttbrokerport', help='MQTT broker port', type=int, default='1883') parser.add_argument('--topicprefix', help='MQTT topic prefix', type=str, default='bmv/') args = parser.parse_args() ve = Vedirect(args.port, args.timeout)
found the solution:
client.username_pw_set(args.mqttuser,args.mqttpw)
print("Connecting...")
must be called before connecting
Hi
do you have some hints how to install or use setup.py
or just run it with /dev/ttyUSB1 I only want to read data from BMV shunt
errors I face:
Example `python3 examples/vedirect_print.py --port /dev/ttyUSB1
Traceback (most recent call last): File "examples/vedirect_print.py", line 5, in
from vedirect import Vedirect
ModuleNotFoundError: No module named 'vedirect'
Setup:
python3 setup.py usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --helperror: no commands supplied ` thanks for supporting