Azure / iot-edge-v1

Azure IoT Edge
http://azure.github.io/iot-edge/
Other
524 stars 258 forks source link

Error in java iot edge module -- (ble-converter) #650

Closed tanieee28 closed 6 years ago

tanieee28 commented 6 years ago

After executing --> mvn clean package. It showed build success and after that when executed --> mvn exec:execc Following error occur --> Please Help

[INFO] Scanning for projects... [INFO] [INFO] -------------< com.microsoft.azure.gateway:ble-converter >-------------- [INFO] Building ble-converter 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- exec-maven-plugin:1.6.0:exec (default-cli) @ ble-converter --- Error: Time:Mon Aug 13 11:06:08 2018 File:C:\agent_work\6\s\azure-iot-gateway-sdk\core\adapters\dynamic_library_windows.c Func:DynamicLibrary_LoadLibrary Line:17 Error Loading Library. Error code is: 126

Error: Time:Mon Aug 13 11:06:08 2018 File:C:\agent_work\6\s\azure-iot-gateway-sdk\core\src\module_loaders\dynamic_loader.c Func:DynamicModuleLoader_Load Line:72 DynamicLibrary_LoadLibrary() returned NULL for module simulated_device

Error: Time:Mon Aug 13 11:06:08 2018 File:C:\agent_work\6\s\azure-iot-gateway-sdk\core\src\gateway_internal.c Func:gateway_addmodule_internal Line:400 Failed to add module because the module could not be loaded.

Error: Time:Mon Aug 13 11:06:08 2018 File:C:\agent_work\6\s\azure-iot-gateway-sdk\core\src\gateway_createfromjson.c Func:Gateway_CreateFromJson Line:78 Failed to create gateway using lower level library.

Error: Time:Mon Aug 13 11:06:08 2018 File:C:\agent_work\6\s\src\gw\src\main.c Func:main Line:50 An error occurred while creating the gateway.

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.774 s [INFO] Finished at: 2018-08-13T11:06:08+05:30 [INFO] ------------------------------------------------------------------------

tanieee28 commented 6 years ago

I Myself found the solution to it. It requires the "simulated_device.dll" file to start the bluletooth module.

  1. So, what i did is cloned the iot-edge code from the repo --> git clone https://github.com/Azure/iot-edge.git

  2. Secondly, did the changes in the iot-edge/v1/tools/build.cmd , changes as following - set build-config = release -------- ( on line 23) set build-platform = x64 -------- ( on line 24)

  3. Then, built the code with VS Developer cmd ( start --> vs developer command prompt) Command --> $build.cmd --disable-native-remote-modules (--disable-native-remote-modules --->>> this option helps in building the code without libuv error which will be solved in next release)

4.after building the code go to build --> modules --> simulated_device --> Release --> simulated_device.dll Copy the dll to the java maven project home folder.

  1. At last, provide the path to dll file you just copied in the gw-config.json "module_path" : "..\simulate_device.dll" it is relative path to the target folder of the maven project.

Hurry, its done. You can now the run the project with mvn exec:exec .

Closing the issue. reply in case something in above statements seem wrong.