kamiKAC / leaf2mqtt

Pull in data from the Nissan Connect platform for the LEAF and publish over MQTT
GNU General Public License v3.0
9 stars 5 forks source link

fix: update to dartnissanconnect v1.0.5 #14

Closed kamiKAC closed 5 months ago

antonhagg commented 5 months ago

Tried to rebuild image but still get errors when logging in. Any idea why?

WARNING: 2024-05-21 10:52:34.822520: main: An error occured while logging in. Please make sure you have selected the right LEAF_TYPE, LEAF_USERNAME and LEAF_PASSWORD. Retrying in 5 seconds.
FINE: 2024-05-21 10:52:34.822587: main: FormatException: Unexpected character (at character 1)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
^

FINE: 2024-05-21 10:52:34.822754: main: #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383)
#1      _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250)
#2      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915)
#3      _parseJson (dart:convert-patch/convert_patch.dart:35)
#4      JsonDecoder.convert (dart:convert/json.dart:610)
#5      JsonCodec.decode (dart:convert/json.dart:216)
#6      CarwingsSession.request (package:dartcarwings/src/carwings_session.dart:72)
<asynchronous suspension>
#7      CarwingsSession.login (package:dartcarwings/src/carwings_session.dart:94)
<asynchronous suspension>
#8      CarwingsWrapper.login (file:///app/src/leaf/carwings_wrapper.dart:21)
<asynchronous suspension>
#9      _login (file:///app/src/leaf_2_mqtt.dart:87)
<asynchronous suspension>
#10     main (file:///app/src/leaf_2_mqtt.dart:63)
<asynchronous suspension>

WARNING: 2024-05-21 10:52:34.822795: main: Could not execute request.
FINEST: 2024-05-21 10:52:34.822826: MqttClientWrapper: Publishing message lastErrorDateTimeUtc 2024-05-21T10:52:34.822811Z
kamiKAC commented 5 months ago

Hi Did it work before Nissan changed client id and secret? Did you try to use my prebuilt image?

I had to stop container, execute docker pull kamikac/leaf2mqtt and start it again to make it work. If you still have problem please open issue (now it's enabled), try to be more descriptive what you've done to get this error message.

antonhagg commented 5 months ago

I got it to work after removing the pubspec.lock file. It had some old reference to dependencies. I have my own fork because I use a secure MQTT broker and also I have removed the code that handles the the car location since it created some error.