seblucas / i2c2mqtt

Get values from sensors in your i2c bus and send it to your MQTT broker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MQTT User/Pass & Seperated values messages

dersch81 opened this issue · comments

commented

Hi,

i have a User/Pass protected MQTT Broker. How can pass the credentials with your script?

That's the way i found. Would you use another way?
if status: debug("Success with message (for current readings) <{0}>".format(jsonString)) if not args.dryRun: publish.single(args.topic, jsonString, hostname=args.host, auth={'username':"USER", 'password':"PASS"}) else: debug("Failure with message <{0}>".format(jsonString)) if not args.dryRun: publish.single(args.topicError, jsonString, hostname=args.host, auth={'username':"USER", 'password':"PASS"})

Besides i would like to have the values in seperated messages. Would you help me to change your script in that way?