Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP] Connectors RPC on UI setValue getValue dont work??? #1450

Closed
Jonnik84 opened this issue Jul 3, 2024 · 3 comments
Closed

[HELP] Connectors RPC on UI setValue getValue dont work??? #1450

Jonnik84 opened this issue Jul 3, 2024 · 3 comments
Assignees
Labels
bug can be closed If bug fixed or feature is implemented

Comments

@Jonnik84
Copy link

Jonnik84 commented Jul 3, 2024

Hi there
Im trying to understand is it possible to read any register or write any register manually from TB UI using conector RPC dashboard screen (attaching)
image

But when i try to setValue or getValue, errors in log appear:
image

Pls help how to use this or maybe its not working yet??

@tatuiot
Copy link

tatuiot commented Jul 4, 2024

Hi guys, I am facing the same issue here, but with mqtt connector. The good thing is I can send my attributes and telemetry from device -> mqtt -> gateway -> TB server. no issues with that I can dynamically create devices, which is GREAT. but I cannot get RPC working. I created a dumb dashboard with a round switch to set pin value to my device. I am stuck for over a week now... no luck so far, I created a whole new environment, with python installation for a new gateway... same issue,

here is my whole mqtt.json file just in case... but I cannot get any attribute or RPC update on the device side, actually I am not getting any mqtt msg from the gateway , becuase I am subscribed to # topic, so I can catch all msgs from all topics... and I never received anything coming from gateway... which is strange....

... thanks a lot for your help.

My config is the following
Gateway ver 3.5.1 - Raspberry Pi installed using the python method.
TB Server CE ver 3.6.4. Ubuntu 20.04 . running
Device for testing also the RPi simulating mqtt devices.

as a 3rd issue... I have this message in the LOGS Gateway dashboard table

Logging loading exception, logs.json is wrong: Unable to configure handler 'connectorHandler'

IMHO the main issue is that I cannot debug, I dont know what is blocking the message to reach the broker. It would be very helpful to log the gateway at its full so we can see what is happening.



{
 "broker": {
    "name": "Default Local Broker",
    "host": "127.0.0.1",
    "port": 1883,
    "clientId": "ThingsBoard_gateway",
    "version": 5,
    "maxMessageNumberPerWorker": 10,
    "maxNumberOfWorkers": 100,
    "sendDataOnlyOnChange": false,
    "security": {
      "type": "basic",
      "username": "tronador",
      "password": "123123"
    }
  },
  "mapping": [
    {
      "topicFilter": "sensor/data",
      "converter": {
        "type": "json",
        "deviceNameJsonExpression": "${serialNumber}",
        "deviceTypeJsonExpression": "${sensorType}",
        "sendDataOnlyOnChange": false,
        "timeout": 60000,
        "attributes": [
          {
            "type": "string",
            "key": "model",
            "value": "${sensorModel}"
          },
          {
            "type": "bool",
            "key": "pin0",
            "value": "${pin0}"
          },
          {
            "type": "bool",
            "key": "pin1",
            "value": "${pin1}"
          }
        ],
"timeseries": [
          {
            "type": "double",
            "key": "temperature",
            "value": "${temp}"
          },
          {
            "type": "double",
            "key": "humidity",
            "value": "${hum}"
          },
          {
            "type": "double",
            "key": "pdr",
            "value": "${pdr}"
          },
          {
            "type": "double",
            "key": "light",
            "value": "${light}"
          },
          {
            "type": "int",
            "key": "rssi",
            "value": "${rssi}"
          },
          {
            "type": "int",
            "key": "pin0",
            "value": "${pin0}"
          },
          {
            "type": "int",
            "key": "pin1",
            "value": "${pin1}"
          }
        ]
      }
    },

  {
      "topicFilter": "/sensor/+/data",
      "converter": {
        "type": "json",
        "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/data)",
        "deviceTypeTopicExpression": "Thermometer",
        "sendDataOnlyOnChange": false,
        "timeout": 60000,
        "attributes": [
          {
            "type": "string",
            "key": "model",
            "value": "${model}"
          }
        ],
        "timeseries": [
          {
            "type": "double",
            "key": "temperature",
            "value": "${temp}"
          },
          {
            "type": "double",
            "key": "humidity",
            "value": "${hum}"
          }
        ]
      }
    },
    {
      "topicFilter": "/sensor/raw_data",
      "converter": {
        "type": "bytes",
        "deviceNameExpression": "[0:4]",
        "deviceTypeExpression": "default",
        "sendDataOnlyOnChange": false,
        "timeout": 60000,
        "attributes": [
          {
  "type": "raw",
            "key": "rawData",
            "value": "[:]"
          }
        ],
        "timeseries": [
          {
            "type": "raw",
            "key": "temp",
            "value": "[4:]"
          }
        ]
      }
    },
    {
      "topicFilter": "/custom/sensors/+",
      "converter": {
        "type": "custom",
        "extension": "CustomMqttUplinkConverter",
        "cached": true,
        "extension-config": {
          "temperatureBytes": 2,
          "humidityBytes": 2,
          "batteryLevelBytes": 1
        }
      }
    }
  ],
  "connectRequests": [
    {
      "topicFilter": "/sensor/connect",
      "deviceNameJsonExpression": "${serialNumber}"
    },
    {
      "topicFilter": "/sensor/+/connect",
      "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/connect)"
    }
  ],
  "disconnectRequests": [
    {
      "topicFilter": "/sensor/disconnect",
      "deviceNameJsonExpression": "${serialNumber}"
 },
    {
      "topicFilter": "/sensor/+/disconnect",
      "deviceNameTopicExpression": "(?<=sensor/)(.*?)(?=/disconnect)"
    }
  ],
  "attributeRequests": [
    {
      "retain": false,
      "topicFilter": "v1/devices/me/attributes/request",
      "deviceNameJsonExpression": "${serialNumber}",
      "attributeNameJsonExpression": "${versionAttribute}, ${pduAttribute}, ${model}",
      "topicExpression": "devices/${deviceName}/attrs",
      "valueExpression": "${attributeKey}: ${attributeValue}"
    }
  ],
  "attributeUpdates": [
    {
      "retain": true,
      "deviceNameFilter": ".*",
      "attributeFilter": "model",
      "topicExpression": "/sensor/${deviceName}/${attributeKey}",
      "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}"
    }
  ],
  "serverSideRpc": [
    {
      "deviceNameFilter": ".*",
      "methodFilter": "set",
      "requestTopicExpression": "/sensor/${deviceName}/request/${methodName}/${requestId}",
      "responseTopicExpression": "/sensor/${deviceName}/response/${methodName}/${requestId}",
      "responseTimeout": 10000,
      "valueExpression": "${params}"
    },
    {
      "deviceNameFilter": ".*",
      "methodFilter": "no-reply",
      "requestTopicExpression": "/sensor/${deviceName}/request/${methodName}/${requestId}",
      "valueExpression": "${params}"
    }
  ],
  "id": "a209bf2b-f196-49a7-872f-d3877fbc5cc4"
}

@samson0v
Copy link
Contributor

samson0v commented Jul 11, 2024

Hi @Jonnik84 and @tatuiot, thanks for your interest in the ThingsBoard IoT Gateway!
We know about this bug and it was fixed, so you can use the version from the master branch or wait for the next release (expected today).

@Jonnik84
Copy link
Author

Thanks a lot seems to work now

@samson0v samson0v added the can be closed If bug fixed or feature is implemented label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug can be closed If bug fixed or feature is implemented
Projects
None yet
Development

No branches or pull requests

4 participants