IOT Edge V2 - Deploying and Debugging Python on the Edge Device - azure-iot-hub

I've been following the tutorial at https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module
On my development machine, the python lint in Visual Studio Code is reporting the error: E0401:Unable to import 'iothub_client' on main.py.
I wonder if I'm missing a pre-requisite step, or is this just an advisory that can be ignored on the development side of things and it should be ok once deployed - or do I need to fix this error on the development machine first?
I've successfully run the previous tutorial and have tempSensor running. filterSensor seems to terminate and go into a "backoff" state once deployed, with an error of 1. I don't know how I can find out on the Edge-side why it is failing - how do I go about debugging this? Can I see print statement output anywhere, for example?
I'm developing on Mac, and deploying to a Beaglebone running Ubuntu 16.04 LTS.

For the Python lint issue, yes you are right that this information is just advisory. The cause for it showing up is that you did not install Azure IoT Python SDK which is a pip package on your development machine. You can safely ignore it because the SDK will be installed when building the module image (there is a RUN pip install -r requirements.txt step in the Dockerfile).
If you want to resolve this lint information, you can install the SDK on your development machine manually by running pip install -r requirements.txt in the root folder of the module.

Related

Install Zenko Cloud Server on ubuntu 20.04 for development purpose

For a couple of days, I have been trying to install the Zenko cloud server for development purposes on my ubuntu 20.04 machine. I am new to Docker and definitely not very much comfortable with Kubernetes and Helm. I am trying to follow this instruction. During the installation stage when I am trying to follow this link, I am getting this error
Error: validation failed: [unable to recognize "": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1", unable to recognize "": no matches for kind "PodDisruptionBudget" in version "policy/v1beta1", unable to recognize "": no matches for kind "CronJob" in version "batch/v1beta1"]
while executing this command.
helm install
https://github.com/scality/Zenko/releases/download/1.2.5/zenko-1.2.5.tgz
I have also tried this link to install Zenko. I have successfully cloned Zenko from the git repository.
git clone https://github.com/scality/Zenko.git
But while executing cd ./zenko/charts, I am getting this error.
bash: cd: ./zenko/charts: No such file or directory
I have installed Minkube by following this link and also installed Helm2 by following this link. Also, I have tried to follow this Zenko documentation but did not quite understand it.
My current goal is to install the Zenko cloud server and upload files to Amazon S3 and also to my local directory where both can be managed via Zenko according to their documentation.
It will be very helpful if someone shows me some way to solve this issue. Thanks in advance.

Stencil - is not recognized as an internal or external command

I just got a new machine from IT and tried to install all the requirements on this page.
https://stencil.bigcommerce.com/docs/prerequisites-windows
Windows 7 | Git for Windows | node-v4.6.1 x64 | Python 2.7.13 x64 | Visual Studio Community 2015
I followed the steps. I installed every software (the versions specified in the instruction, 64bit). I ran the command on the page. Everything was smooth except I couldn't run stencil command. It says "stencil" is not recognized as an internal or external command.
I did some research on it and it looks like it has to do with Environment Variables but I don't know where to start with..
What am I missing?
Try a fresh node install and then npm install again. It sounds like a permission or installation issue.
After installing both Python and Node.js, you should configure Python within the Node.js runtime environment by running this npm command:
npm config set python python2.7

Error Installing Microsoft CNTK

During installation I received the following error:
This script will setup the CNTK prequisites and the CNTK Python
environment onto the machine. More help is given by calling 'get-help
.\install.ps1' in your powershell environment.
The script will analyse your machine and will determine which
components are required. The required components will be downloaded in
[C:\local\Scripts\windows\InstallCache] Repeated operation of this
script will reuse already downloaded components.
If required VS2012 Runtime and VS2013 Runtime will be installed
If required MSMPI will be installed
If required the standard Git tool will be installed
CNTK source will be cloned from Git into [c:\repos\CNTK]
Anaconda3 will be installed into [C:\local\Anaconda3-4.1.1-Windows-x86_64]
A CNTK-PY34 environment will be created in [C:\local\Anaconda3-4.1.1-Windows-x86_64\envs]
CNTK will be installed into the CNTK-PY34 environment
1 - I agree and want to continue Q - Quit the installation process
1 Determining Operations to perform. This will take a moment...
The following operations will be performed: * Setup/Update CNTK Wheel
* Clone CNTK from Github repository
Do you want to continue? (y/n) y Performing download operations
Download operations finished
Performing install operations Setup/Update of CNTK Wheel environment.
Please be patient.... You are using pip version 8.1.2, however version
9.0.0 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. Cloning CNTK (branch v2.0.beta2.0)
repository....
Fatal error during script execution!
System.InvalidOperationException: This command cannot be run due to
the error: The system cannot find the file specifie d. at
System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord
errorRecord)
PS C:\local\Scripts\windows>
I'm not familiar with powershell, so I am not sure where to go from here.
Couple of questions. Are you using beta1 or beta2?
If you are using beta1, just a reminder that there is a beta2 now available with bug fixes and also some improvements to the install script, but I don't think this particular problem has been addressed!
It looks like the clone of the cntk git repository is failing.
Was Git installed on your machine? Is there a GIT.EXE in c:\Program Files\Git\bin\?
I think the install found an existing git.exe (in a different location), and is now trying to call it at the 'wrong' location.
The easiest workaround for you (if you have git installed), from a command prompt:
cd c:/
md \repos
cd repos
clone --branch v2.0.beta1.0 --recursive https://github.com/Microsoft/CNTK
If you have moved to beta2, replace the v2.0.beta1.0 with v2.0.beta2.0

Ubuntu Appcelerator - Cannot install node on platforms other than windows or mac

Appc is successfully setup via terminal. Each prerequisite installed but on Studio launch Appcelerator cannot find/recognize installed node and tries to install node again and prompts "cannot install node on platforms other than windows or mac".
Since I am using the latest version of Titanium so it requires the latest Node.js (nodejs, node and npm). Appcelerator tries to install node because it does not find any compatible version.
Secondly Appcelerator tries to install all pending prerequisites and it cannot install node on platforms other than windows or mac so you have to install nodejs via terminal.
To debug issues try to run programs via terminal. Particular to Appcelerator in Ubuntu, go the directory and run it by command $ ./AppceleratorStudio
It will prompt all ERRORS, WARNINGS and NOTICES.

App Can't be installed

I'm trying to test installing my app and am having some issues. I built a .pkg using terminals productbuild command. Then I tried testing the installation using sudo installer on the .pkg I made with product build. When I try to run the sudo installer I get a message in terminal stating "theApp can't be installed on this computer". Any ideas why this could happen?
EDIT: Figured it out. Turns out there is a special installer command for running app store packages. For anyone who needs it the command is
sudo installer -store -pkg /Users/MyApp/ -target /DirectoryToInstallTo