sshoecraft / jbdtool

JBD BMS Linux utility
BSD 3-Clause "New" or "Revised" License
46 stars 10 forks source link

MQTT user and password are not applied #4

Closed foxriver76 closed 1 year ago

foxriver76 commented 3 years ago

When providing mqtt user and password it is not transmitted to the Server making auth not possible.

foxriver76 commented 3 years ago

I am not much into C but maybe it’s because of https://github.com/sshoecraft/jbdtool/blob/d113835a5675c9aa2148743758fce8243f39dedf/mqtt.c#L72

dalklein commented 3 years ago

I think it's working for me, at least the mqtt messages are going through, and I think I have mosquitto set up requiring user & pwd. As follows:

printf "\n%s\n" "Starting JBD BMS mqtt reader instances, multiple in background" jbdtool -t ip:192.168.15.34,23 -m 192.168.15.15:BMS_ETR:JBD_ET_rear:mqtt_user:mqtt_user_pw -i 180 & sleep 2 jbdtool -t ip:192.168.15.35,23 -m 192.168.15.15:BMS_ETF:JBD_ET_front:mqtt_user:mqtt_user_pw -i 181 &

foxriver76 commented 3 years ago

I‘ve used the same formatting and no credentials were transmitted to my mqtt broker, where the credentials are logged if incorrect, user as well as password were undefined. W/o credentials everything works fine.

Currently not that important but would be nice if it works.

sshoecraft commented 3 years ago

I updated the source and tested. Please refresh your local copy, compile & test.

foxriver76 commented 3 years ago

Connection to the server now works with auth, but no data is sent to the broker anymore

sshoecraft commented 2 years ago

I apologize I simply did not get notified that you responded

I'll test against mosquitto with user and pass enabled on the mosq server

sshoecraft commented 2 years ago

Hi did this ever get resolved? I just tested using a username/password on my mosquitto server and it worked.

sshoecraft commented 2 years ago

Can you check out the latest version and verify if this issue was resolved or not?