Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Problems setting types for mapping signals to VSS using MQTT #211

Closed
anntexx opened this issue Jul 6, 2021 · 7 comments · Fixed by #212 or #214
Closed

Problems setting types for mapping signals to VSS using MQTT #211

anntexx opened this issue Jul 6, 2021 · 7 comments · Fixed by #212 or #214
Labels
bug Something isn't working

Comments

@anntexx
Copy link
Contributor

anntexx commented Jul 6, 2021

When I configure kuksa.val to publish vehicle signals to a MQTT mosquitto broker, it seems that only some data points are published to the MQTT broker. It seems in the logs, that not every new signal triggers an update in the SubscriptionHandler as it happens with the "Vehicle.OBD.Speed" signal. @wenwenchenbosch: Is this related to a type check problem?

extract of the log of kuksa.val:

VERBOSE: Set request with id 899e5736-4304-4dee-8c39-2ac264e5bcc8 for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id 35ab08f9-f3d7-4a53-a482-904374ef5ca8 for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.519999999999996
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.519999999999996
VERBOSE: Receive action: set
VERBOSE: Set request with id ef137a98-326f-4dfa-a78f-58eaa0875d38 for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id b4d665fa-df4c-472d-9251-7293e7afa59e for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.60000000000001
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.60000000000001
VERBOSE: Receive action: set
VERBOSE: Set request with id 701f7eaf-6561-4354-bff1-a1a8c3c3ad4b for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id f882c94b-917f-4a49-83dd-1795a3f74037 for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.680000000000007
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.680000000000007
VERBOSE: Receive action: set
VERBOSE: Set request with id cc882e5f-1c0d-4a3a-80c2-cf650e33aaed for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id e65973bc-4d95-4466-a309-c4ba1abd4565 for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.760000000000005
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.760000000000005
VERBOSE: Receive action: set
VERBOSE: Set request with id 0ccca9aa-14d3-4f3e-8b25-c41097c41bba for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id c93464f1-5860-4bbe-8b68-9f19cb7f16fd for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.92
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.92
VERBOSE: Receive action: set
VERBOSE: Set request with id 078420b9-e67d-4779-aac2-000716a1a9c6 for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id 95a10658-d56e-4fad-bf3f-962e0ad598e6 for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.92
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.92
VERBOSE: Receive action: set
VERBOSE: Set request with id 4004bdb0-2de7-40dc-9590-cfed6124a963 for path: Vehicle.Drivetrain.Transmission.Gear
VERBOSE: Receive action: set
VERBOSE: Set request with id 5bc032f9-1d75-48a4-bab2-9e64f1def59c for path: Vehicle.OBD.Speed
VERBOSE: SubscriptionHandler::updateByPath: new value set at path Vehicle/OBD/Speed29.840000000000003
VERBOSE: MQTTPublisher::Publish topic vss/Vehicle/OBD/Speed
VERBOSE: SubscriptionHandler::updateByUUID: new value set at path 91ed0bb43eb054759813cd784b07176429.840000000000003
@SebastianSchildt
Copy link
Contributor

How did you start kuksa.val? (especially MQTT parameters)? When setting the
Vehicle.Drivetrain.Transmission.Gear (I assume those do not go to MQTT), is the value set at all? i.e. can you see the set value using the kuksa_viss_client command line?

@wenwenchenbosch
Copy link
Contributor

@SebastianSchildt I think it is bug, I can reproduce the issue. It is quite surprised, that log does not report any error. I will have a look at it later

@wenwenchenbosch wenwenchenbosch added the bug Something isn't working label Jul 6, 2021
@SebastianSchildt
Copy link
Contributor

I assume the root cause is, that the path Vehicle.Drivetrain.Transmission.Geardoes not exist in current VSS.

I did a PR that will provide more clear logging in the server #212

If in the usecase above a feeder was used (@anntexx ? ) , I think we should also fix it, to check whether a set suceeded or not and provide an error message there also (and maybe adapt our examples)

@wenwenchenbosch
Copy link
Contributor

@SebastianSchildt I found sth. strange:
After I comment out the RearPower266, kuksa.val is able to set the mapped siganal Vehicle.OBD.EngineLoad:
https://github.com/eclipse/kuksa.val/blob/master/kuksa_feeders/dbc2val/mapping.yml#L9-L12


Test Client> getValue Vehicle.OBD.EngineLoad 
{
    "action": "get", 
    "path": "Vehicle.OBD.EngineLoad", 
    "requestId": "63cf94ef-f90f-445d-9a09-b0a8f5c7984b", 
    "timestamp": "2021-07-07T13:29:04.1625660944Z", 
    "value": 0.0
}

I also found the log:

VERBOSE: Receive action: set
VERBOSE: Set request with id cc3140d2-2f8d-449c-b367-724d304bef68 for path: Vehicle.OBD.EngineLoad
VERBOSE: SubscriptionHandler::updateByPath: set value 0.0 in path Vehicle/OBD/EngineLoad
VERBOSE: SubscriptionHandler::updateByUUID: set value 0.0 for UUID a8fda8a1b4c6534aa49c447bafc1c7000.0

But I am not able to reproduce the error using the kuksa_viss_client:

Test Client> setValue Vehicle.OBD.EngineLoad 0.0
{
    "action": "set", 
    "error": {
        "message": "Value \"0.0\" can not be converted to defined type uint8. Reason: Invalid digit", 
        "number": 400, 
        "reason": "Value passed is out of bounds"
    }, 
    "requestId": "92ffe463-5f12-4082-b94b-b59e45ce12b4", 
    "timestamp": "2021-07-07T13:35:13.1625661313Z"
}

@wenwenchenbosch
Copy link
Contributor

@SebastianSchildt is it possible to map DIgear118? the value of this signal is park or drive. I do not know. if dbcfeeder.py do some conversion, or the value is really from the dbc file.

@SebastianSchildt
Copy link
Contributor

dbcfeeder currently does not do any conversion except those in the dbc file. This would be an important feature to write more flexible mapping files. The mapping of the Gear signal to strings is described in

VAL_ 280 DIgear118 3 "Neutral" 7 "Idle" 1 "Park" 2 "Reverse" 4 "Drive" ;

I ca not be naively mapped to Vehicle.Powertrain.Transnmission.Gear which is defined as

"Gear": {
                "datatype": "int8",
                "type": "actuator",
                "min": -1,
                "max": 16,
                "description": "Current gear. 0=Neutral. -1=Reverse",
                "uuid": "d72df16818e75f71b9fffdff8250e9b9"
              },

For "P" Vehicle.Chassis.ParkingBrake should be used additionally

          "ParkingBrake": {
            "type": "branch",
            "description": "Parking brake signals",
            "uuid": "3849d42292f4551590fa4bf716fc90f7",
            "children": {
              "IsEngaged": {
                "datatype": "boolean",
                "type": "actuator",
                "description": "Parking brake status. True = Parking Brake is Engaged. False = Parking Brake is not Engaged.",
                "uuid": "faa7f94e6a5555c6b2d62e3328520ce0"
              }
            }
          },

@wenwenchenbosch
Copy link
Contributor

wenwenchenbosch commented Jul 14, 2021

I will close this issue, this strange behavior with set 0.0 should be solved by solving #209

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
3 participants