Closed TheRealSvc closed 1 year ago
@TheRealSvc Thanks for your feedback. We will investigate and update the thread.
Hello @TheRealSvc , in the tutorial step:
On the lower layer device, it will ask for the hostname and parent's hostname. Supply the appropriate IP or FQDN for each prompt. You can use either, but be consistent in your choice across devices.
Can you share what you selected for hostname and parent_hostname ?
Thanks!
Hi, sure, on the lower-layer device i chose:
hostname: lower-layer parent_hostname: top-layer
I can ping top-layer
without problem from the lower-layer host device.
also, when i do sudo iotedge check,
i get this
Configuration checks
--------------------
√ aziot-edged configuration is well-formed - OK
√ container engine is installed and functional - OK
√ config.yaml has correct hostname - OK
√ config.yaml has correct parent_hostname - OK
× config.yaml parent hostname is resolvable from inside container - Error
Failed to resolve parent hostname top-layer
× config.yaml has correct URIs for daemon mgmt endpoint - Error
Unable to find image 'top-layer/azureiotedge-diagnostics:1.2.0-rc4' locally
docker: Error response from daemon: pull access denied for top-layer/azureiotedge-diagnostics, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
× container time is close to host time - Error
Could not query local time inside container
One thing is interesting: I added a custom python module to the lower-layer device and that works. So telemetry is send to the Iothub. Mhhh.
× config.yaml parent hostname is resolvable from inside container - Error
Most probably the error is here. Your container (simulatedTemperatureSensor Module) does not recognize parent_hostname FQDN. You can check Docker container create options and my hint is that you will need to configure the DNS to be able to find that FQDN inside your container. See also: How to configure container create options for IoT Edge modules.
Can you also check the simulatedTemperatureSensor logs?
iotedge logs <container name>
Thanks.
I tried to use the IP as the parent_hostname. No success. Most of the simulatedTemperatureSensor logs i've provided above. Sorry if that wasn't clear. Today i'am a bit limited. Tomorrow i'll try to modify the DNS settings. But since my own module runs, i probably won't spend too much time to get the simulatedTemperatureSensor module running.
@TheRealSvc thank you! I will try this on my side as well. Will let the case open for 1-2 more days so we can validate if this is an issue in the doc or in the product. @PatAltimore fyi.
@asergaz thank you, i just fiddled a bit with the DNS settings but to no avail. I will leave it, since i have no trouble with my own modules. Anyways here's the log-output when i manually start the docker container:
sudo docker run 8be190288a00
[2022-05-27 08:16:28 +00:00]: Starting Module
SimulatedTemperatureSensor Main() started.
Initializing simulated temperature sensor to send 500 messages, at an interval of 5 seconds.
To change this, set the environment variable MessageCount to the number of messages that should be sent (set it to -1 to send unlimited messages).
[Information]: Trying to initialize module client using transport type [Amqp_Tcp_Only].
Unhandled exception. System.AggregateException: One or more errors occurred. (Environment variable IOTEDGE_WORKLOADURI is required.)
---> System.InvalidOperationException**: Environment variable IOTEDGE_WORKLOADURI is required.**
at Microsoft.Azure.Devices.Client.Edge.EdgeModuleClientFactory.CreateInternalClientFromEnvironmentAsync()
at SimulatedTemperatureSensor.Program.<>c__DisplayClass18_0.<<CreateModuleClientAsync>b__1>d.MoveNext() in /home/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 293
--- End of stack trace from previous location where exception was thrown ---
at SimulatedTemperatureSensor.Program.CreateModuleClientAsync(TransportType transportType, ITransientErrorDetectionStrategy transientErrorDetectionStrategy, RetryStrategy retryStrategy) in /home/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 272
at SimulatedTemperatureSensor.Program.MainAsync() in /home/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 79
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at SimulatedTemperatureSensor.Program.Main() in /home/vsts/work/1/s/edge-modules/SimulatedTemperatureSensor/src/Program.cs:line 48
Maybe it's of use for you.
Hi @TheRealSvc,
I'm doing some cleanup of old open issues. We've rewritten the nested tutorial to use a new az iot edge devices create command. It's reduced several issues with configuration. Just an FYI. I'm going to close this issue.
Thanks, Pat
I followed the above tutorial with two raspberry-pi's as top-layer and lower-level devices. I didn't connect using symmetric key but X.509 This is my iotedge_config.yaml:
I created the two zip-bundles and copied the certificates over to the devices. After deploying both deploymentTopLayer.json and deploymentLowerLayer.json, the top-layer device seems fine. Also the lower-layer devices fetches all modules using the ApiProxi module. However the simulatedTemperatureSensor module stops with an error:
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.