Comments (3)
You seem to have the same issue as discussed in eclipse-ditto/ditto#1612
Please have a look there for the solution.
from ditto-examples.
thank you so much :) it fixed
is it possible to update the Readme file so others dont encounter it?
for anyone facing same error, here the Crud Connections template that worked
{
"id": "ed25e85e-a076-4e9e-9463-12ca5a1ca723",
"name": null,
"connectionType": "mqtt",
"connectionStatus": "open",
"uri": "tcp://test.mosquitto.org:1883",
"sources": [
{
"addresses": [
"ditto-tutorial/#"
],
"consumerCount": 1,
"qos": 0,
"authorizationContext": [
"nginx:ditto"
],
"headerMapping": {},
"payloadMapping": [
"javascript"
],
"replyTarget": {
"address": "{{header:reply-to}}",
"headerMapping": {},
"expectedResponseTypes": [
"response",
"error"
],
"enabled": true
}
}
],
"targets": [
{
"address": "ditto-tutorial/{{ thing:id }}",
"topics": [
"_/_/things/twin/events",
"_/_/things/live/messages"
],
"qos": 0,
"authorizationContext": [
"nginx:ditto"
],
"headerMapping": {}
}
],
"clientCount": 1,
"failoverEnabled": true,
"validateCertificates": true,
"processorPoolSize": 1,
"mappingDefinitions": {
"javascript": {
"mappingEngine": "JavaScript",
"options": {
"incomingScript": "function mapToDittoProtocolMsg(headers, textPayload, bytePayload, contentType) {\r\n const jsonString = String.fromCharCode.apply(null, new Uint8Array(bytePayload));\r\n const jsonData = JSON.parse(jsonString); \r\n const thingId = jsonData.thingId.split(':'); \r\n const value = { \r\n temp_sensor: { \r\n properties: { \r\n value: jsonData.temp \r\n } \r\n },\r\n altitude: { \r\n properties: { \r\n value: jsonData.alt \r\n } \r\n } \r\n }; \r\n return Ditto.buildDittoProtocolMsg(\r\n thingId[0], // your namespace \r\n thingId[1], \r\n 'things', // we deal with a thing\r\n 'twin', // we want to update the twin\r\n 'commands', // create a command to update the twin\r\n 'modify', // modify the twin\r\n '/features', // modify all features at once\r\n headers, \r\n value\r\n );\r\n}",
"outgoingScript": ""
}
}
},
"tags": []
}
from ditto-examples.
@thjaeckle can you tell me how can another device subcribe to the topic to read the devices live or twin value, does the above need to be edited for it, i tried subscribing to
"//things/twin/events",
"//things/live/messages"
i replace "_" with many permutations by not receiving data
from ditto-examples.
Related Issues (20)
- The message mapper configuration failed due to: unterminated regular expression literal HOT 2
- How can i get smartcoffee thing features via websocket? HOT 1
- websocket.send(msgtosend) is not giving any response. HOT 2
- Ditto connection lost on reloading the page HOT 4
- Module 'websocket' has no attribute 'WebSocketApp' HOT 5
- Can't see Captcha Image HOT 4
- Update 'timeout' query parameter usage
- Payload Mapping Function Fails due to Syntax Error HOT 1
- Add an example for connecting a device to Ditto via Azure IoT Hub
- 401 Unauthorized error when I try to create MQTT connection in Ditto explorer UI or via curl command in bash HOT 1
- Correct way for using Java Class RegisterForChanges HOT 3
- Issue with rest to websocket connection example HOT 2
- mqtt quick introduction example HOT 5
- mqtt sending data
- "Mqtt-bidirectional" example enhancement suggestion, after inability to recieve packets on IoT device.
- Warning on createConnection HOT 4
- How to run a rest to websocket example HOT 4
- Does one connect support only one mappingContext? HOT 1
- Issue with custom-ditto-java-payload-mapper HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ditto-examples.