Skip to content

adam-intel/device-mqtt-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Device MQTT Go

MQTT device service go version. The design is base on document .

Requisite

  • core-data
  • core-metadata
  • core-command

Predefined configuration

Incoming data listener and command response listener

Modify configuration-driver.toml file which under ./cmd/res folder

[Incoming]
Protocol = "tcp"
Host = "m12.cloudmqtt.com"
Port = 17217
Username = "tobeprovided"
Password = "tobeprovided"
Qos = 0
KeepAlive = 3600
MqttClientId = "IncomingDataSubscriber"
Topic = "DataTopic"

[Response]
Protocol = "tcp"
Host = "m12.cloudmqtt.com"
Port = 17217
Username = "tobeprovided"
Password = "tobeprovided"
Qos = 0
KeepAlive = 3600
MqttClientId = "CommandResponseSubscriber"
Topic = "ResponseTopic"

Device list

Define devices info for device-sdk to auto upload device profile and create device instance. Please modify configuration.toml file which under ./cmd/res folder

[[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 = "m12.cloudmqtt.com"
    Port = 17217
    Publisher = "CommandPublisher"
    user = "tobeprovided"
    password = "tobeprovided"
    topic = "CommandTopic"

Installation and Execution

make prepare
make build
make run

build image

docker build -t edgexfoundry/docker-device-mqtt-go:0.1.0 .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 94.3%
  • Shell 2.8%
  • Dockerfile 1.6%
  • Makefile 1.3%