Comments (5)
this issue is duplicated to #17 and fixed by #19
For device-mqtt, please set up MQTT broker first and modify configuration-driver.toml. The related to document will be available in the community web site soon
from device-mqtt-go.
but I have set up MQTT broker first:
This is the setting in configuration.toml:
# Pre-define Devices
[[DeviceList]]
Name = "MQTT test device"
Profile = "Test.Device.MQTT.Profile"
Description = "MQTT device is created for test purpose"
Labels = [ "MQTT", "test"]
[DeviceList.Addressable]
name = "Gateway address"
Protocol = "TCP"
Address = "127.0.0.1"
Port = 1883
Publisher = "CommandPublisher"
user = "admin"
password = "public"
topic = "CommandTopic"
# Pre-define Schedule Configuration
[[Schedules]]
Name = "mqtt-30sec-schedule"
Frequency = "PT30S"
[[ScheduleEvents]]
Name = "readRandnum"
Schedule = "mqtt-30sec-schedule"
[ScheduleEvents.Addressable]
HTTPMethod = "GET"
Path = "/api/v1/device/name/MQTT test device/testrandnum"
This is broker using with node.js
var mosca = require('mosca');
var settings = {
port: 1883
};
var server = new mosca.Server(settings);
server.on('clientConnected', function(client) {
console.log('client connected', client.id);
});
// fired when a message is received
server.on('published', function(packet, client) {
console.log('Published', packet.payload);
});
server.on('ready', setup);
// fired when the mqtt server is ready
function setup() {
console.log('Mosca server is up and running');
}
from device-mqtt-go.
@wangnuannuan The MQTT broker connection settings is under configuration-driver.toml
[Incoming]
Protocol = "tcp"
Host = "0.0.0.0"
Port = 1883
Username = "admin"
Password = "public"
Qos = 0
KeepAlive = 3600
MqttClientId = "IncomingDataSubscriber"
Topic = "DataTopic"
[Response]
Protocol = "tcp"
Host = "0.0.0.0"
Port = 1883
Username = "admin"
Password = "public"
Qos = 0
KeepAlive = 3600
MqttClientId = "CommandResponseSubscriber"
Topic = "ResponseTopic"
The driver can't define any new properties in configuration.toml so far, so we create another TOML file to store the driver specific properties. That is the part we should improve in the future.
from device-mqtt-go.
I also modify the setting in configurations-driver.toml: Host = "0.0.0.0"
to Host = "127.0.0.1"
from device-mqtt-go.
@wangnuannuan the 127.0.0.1
means the localhost of this MQTT Device Service container. You should modify it to the host name or IP address of your MQTT broker. If you run the broker on your host, the IP might look like 172.17.0.1
for the default docker network setting.
from device-mqtt-go.
Related Issues (20)
- Add "make lint" target and add to "make test" target
- Bump device-sdk-go version and update configuration.toml
- What will be the path to mqtt-scripts HOT 2
- How to receive another data frame. HOT 2
- Upgrade github.com/eclipse/paho.mqtt.golang from 1.3.5 to 1.4.1 HOT 1
- How to recognize the command from which devices. HOT 2
- Testping command returns EOF HOT 3
- ERROR: libcurl-7.80.0-r1: package mentioned in index not found. HOT 2
- fail to unmarshal event, AddEventRequest.Event.Readings[0].ValueType field validation failed on the edgex-dto-value-type tag HOT 6
- why started http2write command with mutil threads , but for many devices ,all of concur size of http is only 4? HOT 7
- How to run built image via docker run, and via docker-compose file HOT 6
- 编译2.3.0发行版本时,报错,无法完成编译 HOT 2
- Make multi-level topics the only implementation HOT 3
- Change configuration and device toml files to yaml
- device-mqtt leaks message bus credentials HOT 3
- {WIP BUG] New Async multi-reading support breaks handling of basic single reading
- No support for certificate based secure communication HOT 2
- bad device value need detail and response error message HOT 5
- Edgex mqtt error HOT 11
- jpeg images send to edgex HOT 2
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 device-mqtt-go.