mahil4711 / fiat_vehicle_mqtt

Access Fiat Uconnect vehicle data and send it periodically to an MQTT broker
MIT License
2 stars 0 forks source link

fiat password does have the character '!' #1

Closed dsigmoun closed 3 weeks ago

dsigmoun commented 3 weeks ago

Good morning.

I'm trying to set up docker under jeedom. The installation and configuration is well done. On the other hand, in the logs, I have these error messages. My fiat password does have the character '!'. At first glance, this seems to be a problem, right?

2024-09-28T08:00:45.620089581Z PHP Warning:  syntax error, unexpected '!' in ./fiat.cfg on line 9
2024-09-28T08:00:45.620138051Z  in /fiat/fiat_mqtt.php on line 194
2024-09-28T08:00:45.620093422Z 2024-09-28 10:00:45 reading config file './fiat.cfg'
2024-09-28T08:00:45.620159702Z 2024-09-28 10:00:45 GoogleApiKey is empty, unable to translate location address
2024-09-28T08:00:45.621450311Z PHP Notice:  Trying to access array offset on value of type bool in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621501016Z PHP Notice:  Trying to access array offset on value of type null in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621519804Z PHP Notice:  Trying to access array offset on value of type bool in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621532724Z PHP Notice:  Trying to access array offset on value of type null in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621468121Z 2024-09-28 10:00:45 forked child with pid 8
2024-09-28T08:00:45.621545366Z PHP Notice:  Trying to access array offset on value of type bool in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621558636Z 2024-09-28 10:00:45 child is starting subscriber for executing commands
2024-09-28T08:00:45.621561080Z PHP Notice:  Trying to access array offset on value of type null in /fiat/fiat_mqtt.php on line 128
2024-09-28T08:00:45.621595442Z PHP Fatal error:  Uncaught TypeError: Argument 1 passed to apiFiat::__construct() must be of the type string, null given, called in /fiat/fiat_mqtt.php on line 128 and defined in /fiat/fiat_vehicle/api.php:59
2024-09-28T08:00:45.621609271Z Stack trace:
2024-09-28T08:00:45.621621144Z #0 /fiat/fiat_mqtt.php(128): apiFiat->__construct()
2024-09-28T08:00:45.621631690Z #1 /fiat/fiat_mqtt.php(221): fiat_get_data()
2024-09-28T08:00:45.621650687Z #2 {main}
2024-09-28T08:00:45.621666961Z   thrown in /fiat/fiat_vehicle/api.php on line 59
2024-09-28T08:00:45.621684072Z PHP Notice:  Trying to access array offset on value of type bool in /fiat/fiat_mqtt.php on line 64
2024-09-28T08:00:45.625267451Z PHP Notice:  Trying to access array offset on value of type null in /fiat/fiat_mqtt.php on line 28
2024-09-28T08:00:45.625328004Z PHP Notice:  Trying to access array offset on value of type null in /fiat/fiat_mqtt.php on line 28
2024-09-28T08:00:45.625267451Z 2024-09-28 10:00:45 MQTT connection failed: Argument 1 passed to PhpMqtt\Client\MqttClient::__construct() must be of the type string, null given, called in /fiat/fiat_mqtt.php on line 28
2024-09-28T08:00:45.625352379Z 2024-09-28 10:00:45 Exception catched: Call to a member function subscribe() on null

here is my fiat.cfg file

[mqtt]
server =192.168.1.200
port =1883
username =XXXXXX
password =rXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXR

[fiat]
username =USERNAME
password =!PASSWORD!
PIN =PIN
sleep =300
sleep_charging =60

thank you for your help!

mahil4711 commented 3 weeks ago

Hi, is your password enclosed with '"'? Please try something like this:

password = "my_password!"

dsigmoun commented 3 weeks ago

I changed my password without '!'. The connection seems to be working fine, but now it seems to be unable to connect to my mqtt broker. I checked the settings, and they are fine though.

any idea of ​​the problem?

2024-09-28T08:30:20.035817036Z 2024-09-28 10:30:20 reading config file './fiat.cfg'
2024-09-28T08:30:20.035902872Z 2024-09-28 10:30:20 GoogleApiKey is empty, unable to translate location address
2024-09-28T08:30:20.036993663Z 2024-09-28 10:30:20 forked child with pid 8
2024-09-28T08:30:20.037197322Z 2024-09-28 10:30:20 child is starting subscriber for executing commands
2024-09-28T08:30:20.044973661Z 2024-09-28 10:30:20 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:20.045001807Z 2024-09-28 10:30:20 Exception catched: Call to a member function subscribe() on null
2024-09-28T08:30:20.735254214Z PHP Deprecated:  This installation of the SDK is using PHP version 7.4.33, which will be deprecated on January 13th, 2025.
2024-09-28T08:30:20.735314837Z Please upgrade your PHP version to a minimum of 8.1.x to continue receiving updates for the AWS SDK for PHP.
2024-09-28T08:30:20.735359326Z To disable this warning, set suppress_php_deprecation_warning to true on the client constructor or set the environment variable AWS_SUPPRESS_PHP_DEPRECATION_WARNING to true.
2024-09-28T08:30:20.735374342Z More information can be found at: https://aws.amazon.com/blogs/developer/announcing-the-end-of-support-for-php-runtimes-8-0-x-and-below-in-the-aws-sdk-for-php/
2024-09-28T08:30:20.735388869Z  in /fiat/vendor/aws/aws-sdk-php/src/ClientResolver.php on line 1456
2024-09-28T08:30:21.629343487Z 2024-09-28 10:30:21 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:21.629397405Z 2024-09-28 10:30:21 MQTT publish failed: Call to a member function publish() on null
2024-09-28T08:30:21.629416122Z 2024-09-28 10:30:21 updated data for (ZFAEFAC45NX094438)
2024-09-28T08:30:22.045641159Z 2024-09-28 10:30:22 child is restarting subscriber for executing commands
2024-09-28T08:30:22.045984083Z 2024-09-28 10:30:22 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:22.046010343Z 2024-09-28 10:30:22 Exception catched: Call to a member function subscribe() on null
2024-09-28T08:30:24.046417471Z 2024-09-28 10:30:24 child is restarting subscriber for executing commands
2024-09-28T08:30:24.047106252Z 2024-09-28 10:30:24 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:24.047186290Z 2024-09-28 10:30:24 Exception catched: Call to a member function subscribe() on null
2024-09-28T08:30:26.047894506Z 2024-09-28 10:30:26 child is restarting subscriber for executing commands
2024-09-28T08:30:26.048136299Z 2024-09-28 10:30:26 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:26.048162979Z 2024-09-28 10:30:26 Exception catched: Call to a member function subscribe() on null
2024-09-28T08:30:28.048611522Z 2024-09-28 10:30:28 child is restarting subscriber for executing commands
2024-09-28T08:30:28.049086657Z 2024-09-28 10:30:28 MQTT connection failed: [6] Establishing a connection to the MQTT broker failed: The configured broker responded with unauthorized.
2024-09-28T08:30:28.049121508Z 2024-09-28 10:30:28 Exception catched: Call to a member function subscribe() on null
mahil4711 commented 3 weeks ago

Looks like there are some issues with the authentication to your MQTT broker. Could you please try to surround your password with the sign "? Are there maybe some other restrictions on the MQTT broker? Maybe you could try to setup the MQTT broker without authorization for testing.

dsigmoun commented 3 weeks ago

It connects well without login and password by configuring mosquito like this allow_anonymous true

dsigmoun commented 3 weeks ago

do you think it is possible that it is compatible with ha/mqtt discovery?

mahil4711 commented 3 weeks ago

I have not checked this yet with mosquito configured with username/password. I will check this.

If you are using HA maybe this https://github.com/wubbl0rz/FiatChamp/tree/master/FiatChampAddon could help. I'm not using HA and could not answer your question concerning this.

dsigmoun commented 3 weeks ago

Sorry, I'm French and I have bad English. I already use HA for only this Fiatchamps add-on, but I would like to use only jeedom. That's why I'm very interested in your docker :-)

mahil4711 commented 3 weeks ago

was able to reproduce your error authentication error with moquitto. This seems to be something inside mosquitto. So the only solution I found was to set "allow_anonymous true" what you have also find out. I found similar issues when doing a google search.

So from my side there is nothing I could fix.

Will close this issue.