wubbl0rz/FiatChamp

Error on FIAT APIand MQTT

skybarberom opened this issue · 3 comments

Hello,
I'm trying to set up the integration using a standalone container. I've launched the container with the following variables:

version: "3.9"
services:
FiatChamp:
image: ghcr.io/wubbl0rz/image-amd64-fiat-champ:latest
environment:
- 'STANDALONE=True'
- 'FiatChamp_FiatUser=xxxxxx'
- 'FiatChamp_FiatPw=xxxxx'
- 'FiatChamp_FiatPin=xxxx'
- 'FiatChamp_SupervisorToken=XXXXXXXXXXXXXXXXXXX'
- 'FiatChamp_StartDelaySeconds=1'
- 'FiatChamp_Region=Europe'
- 'FiatChamp_Brand=Jeep'
- 'FiatChamp_CarUnknownLocation=Unknown'
- 'FiatChamp_ConvertKmToMiles=False'
- 'FiatChamp_MqttUser=mqtt'
- 'FiatChamp_MqttPw=xxxxxx'
- 'FiatChamp_MqttServer=192.168.0.91'
- 'FiatChamp_MqttPort=1883'
- 'TZ=Europe/Rome'
- 'FiatChamp_HomeAssistantUrl=http://192.168.0.91:8123'

After sping up the container I got two problems:

  • WRN] Error connecting to the FIAT API. (but the car is found - It's a JEEP)
  • Mqtt connection failed

'''[14:44:42 INF] Now fetching new data...
[14:44:51 INF] FOUND CAR: ZAXXXXXXXXXXXXXXXXX
[14:45:02 WRN] Error connecting to the FIAT API.
This can happen from time to time. Retrying in 15 minutes.
[14:45:02 INF] Fetching COMPLETED. Next update in 15 minutes.
[14:46:22 INF] Mqtt connection failed: System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at MQTTnet.Implementations.MqttTcpChannel.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.ReconnectIfRequiredAsync(CancellationToken cancellationToken)
[14:46:50 INF] REFRESH SESSION
[14:48:07 INF] Mqtt connection failed: System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at MQTTnet.Implementations.MqttTcpChannel.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.ReconnectIfRequiredAsync(CancellationToken cancellationToken)'''

I tested from inside the container the reachability of HA and MQTT and it's ok. HA is integrated with MQTT with no problem.
Is there anything I'm missing?

Thank you

hm looks ok. i dont really use the dockerized variant but i dont think the error is docker related 🤔 maybe its a jeep thing again where some values are a bit different. you can set FiatChamp_Debug=true to see more output. but dont post it here without clearing anything sensitive. the mqtt settings look alright too.

hm looks ok. i dont really use the dockerized variant but i dont think the error is docker related 🤔 maybe its a jeep thing again where some values are a bit different. you can set FiatChamp_Debug=true to see more output. but dont post it here without clearing anything sensitive. the mqtt settings look alright too.

I corrected some typo and now the information are retrieved from the API and seems sent to HA, but still problem with MQTT (in HA I don't see anything even if it says it's announcing sensors - but I understood they should come from MQTT)

.......
}
[11:14:32 DBG] Announce sensor: {
"Name": "ChargeNOW"
}
[11:14:32 DBG] Announce sensor: {
"Name": "DeepRefresh"
}
[11:14:32 DBG] Announce sensor: {
"Name": "Blink"
}
[11:14:32 DBG] Announce sensor: {
"Name": "UpdateLocation"
}
[11:14:32 DBG] Announce sensor: {
"IsOn": false,
"Name": "DoorLock"
}
[11:14:32 DBG] Announce sensor: {
"Name": "RefreshBatteryStatus"
}
[11:14:32 INF] Fetching COMPLETED. Next update in 15 minutes.
[11:14:44 INF] Mqtt connection failed: System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.CancellationToken.ThrowIfCancellationRequested()
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
at MQTTnet.Implementations.MqttTcpChannel.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
at MQTTnet.Extensions.ManagedClient.ManagedMqttClient.ReconnectIfRequiredAsync(CancellationToken cancellationToken)
[11:15:30 INF] REFRESH SESSION

For some reason the network the container was on couldn't talk with MQTT port. I recreated the container on another network and it seems to be working.