Trying to Run the example in a Docker file #279
Replies: 2 comments 4 replies
-
you are using v3.1 for other services, so please try to use sdk v3.1, not v3.0 |
Beta Was this translation helpful? Give feedback.
-
@cloudxxx8 Thank you for the help. I'm sure that fixes that issue, but when I build the sdk v3.1 I get outputs to the release folder called 3.0.2. Is that expected? If I update the $CSDK_DIR to the new location (using 3.0.2), it can seem to find the configuration file. Are there changes to the example on the wiki that are needed with using 3.1.0? $ ./template
level=INFO ts=2024-05-31T13:08:26Z app=device-template msg="iot_threadpool_alloc (threads: 8 max_jobs: 0 default_priority: -1 affinity: -1)"
level=INFO ts=2024-05-31T13:08:26Z app=device-template msg="iot_scheduler_alloc (priority: -1 affinity: -1)"
level=ERROR ts=2024-05-31T13:08:26Z app=device-template msg="Cant open file (null)"
level=ERROR ts=2024-05-31T13:08:26Z app=device-template msg="Unable to load common config file: Unable to open configuration file"
Error: 1: Unable to open configuration file configuration.yaml Writable:
LogLevel: DEBUG
Reading:
ReadingUnits: true
Telemetry:
Metrics:
# All service's custom metric names must be present in this list. All common metric names are in the Common Config
ReadCommandsExecuted: true
Service:
Host: "127.0.0.1"
Port: 59999 # Device service are assigned the 599xx range
StartupMsg: device simple started
Clients:
core-metadata:
Host: "edgex-core-metadata"
Port: 59881
MessageBus:
Protocol: redis
Host: "edgex-redis"
Port: 6379
Type: redis
AuthMode: "usernamepassword" # required for redis messagebus (secure or insecure)
SecretName: redisdb
Optional:
ClientId: device-example
# Example overriding of Common Config settings
Device:
AsyncBufferSize: 1
# These have common values (currently), but must be here for service local env overrides to apply when customized
ProfilesDir: "./res/profiles"
DevicesDir: "./res/devices"
# Only needed if device service implements auto provisioning
ProvisionWatchersDir: ./res/provisionwatchers
# Example structured custom configuration
SimpleCustom:
OnImageLocation: ./res/on.png
OffImageLocation: ./res/off.jpg
Writable:
DiscoverSleepDurationSecs: 10 I pulled template.c from the tag v3.1.0, and am running it directly |
Beta Was this translation helpful? Give feedback.
-
So far I have run through the developer example and got it to work but am having trouble getting it to run with the device service inside of a docker container.
for the compose file, I replaced the example device-rest and device virtual with a new container called device-random that has the exact same configurations, but with port 59999
logs
Dockerfile:
docker-compose:
when I run the curl command standalone I get this...
Beta Was this translation helpful? Give feedback.
All reactions