Huddly / sdk

Huddly's Software Development Kit (SDK) used to interact with the camera by third-party applications
MIT License
15 stars 8 forks source link

Trying to implement huddly SDK/API although doing the npm install #586

Open avassist opened 1 month ago

avassist commented 1 month ago

I am following the current instructions huddly-sdk

However I am getting the following errors from Node.js. stating that “MODULE NOT FOUND” and “Uncaught ReferenceError: sdk is not defined”

Here are the codes written in along with the errors below following below:

Welcome to Node.js v16.20.2. Type ".help" for more information.

const HuddlyDeviceAPIUSB = require('@huddly/device-api-usb').default; **Uncaught Ehuddly node js errorceApiIP = require('@huddly/device-api-ip').default; Uncaught Error: Cannot find module '@huddly/device-api-ip' Require stack:

at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15) at Function.Module._load (node:internal/modules/cjs/loader:873:27) at Module.require (node:internal/modules/cjs/loader:1100:19) at require (node:internal/modules/cjs/helpers:119:18) { code: 'MODULE_NOT_FOUND', requireStack: [ '' ] } const HuddlySdk = require('@huddly/sdk').default; Uncaught Error: Cannot find module '@huddly/sdk' Require stack: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15) at Function.Module._load (node:internal/modules/cjs/loader:873:27) at Module.require (node:internal/modules/cjs/loader:1100:19) at require (node:internal/modules/cjs/helpers:119:18) { code: 'MODULE_NOT_FOUND', requireStack: [ '' ] } const usbApi = new HuddlyDeviceAPIUSB(); Uncaught ReferenceError: HuddlyDeviceAPIUSB is not defined const ipApi = new HuddlyDeviceApiIP(); Uncaught ReferenceError: HuddlyDeviceApiIP is not defined const sdk = new HuddlySdk([usbApi, ipApi], [usbApi, ipApi]); Uncaught ReferenceError: HuddlySdk is not defined let cameraManager; undefined sdk.on('ATTACH', (newDevice) => { ... cameraManager = newDevice; ... }); Uncaught ReferenceError: sdk is not defined sdk.init(); Uncaught ReferenceError: sdk is not defined sdk.on('ATTACH', (newDevice) => { ... cameraManager = newDevice; ... cameraManager.getInfo().then(console.log); ... }); Uncaught ReferenceError: sdk is not defined
avassist commented 1 month ago

Please note that I am using the Windows 10 Enterprise Software.

Update:

Thus far, I was able to follow the github people count instructions and the camera is detecting and counting persons. The Huddly setup works only with Node.js version 12. Node versions 10, 11,13,14,15 and 16 are giving me errors.

I also see that there are issues in setting up the Google analytics account which is supposed to connect to the Huddly L1/iQ Camera.

Here is why I believe this may be the case:

  1. Since Google analytics has been updated to Google Analytics 4 the set up instructions needs to be updated.

  2. Google Analytics uses different names regarding Values. For instance, I don't see the "Avg. Value" metric and the Type "Explorer" in Google Analytics 4.

pkhansen commented 1 month ago

Hi there, Sorry for the slow response in this matter. We're currently in the process of fully switching our SDK support over to the .NET stack, and if possible we would recommend using that in the future. More information about the new SDK is available on developer.huddly.com. Samples for the .NET stack is also available over at sdk-dotnet-samples. All that being said I'd be happy to look into the issues you are facing.

Are you getting the same errors as before when using any other version of node than 12? If so I'm having difficulties reproducing that excact issue on my machine. Are you installing this in a project folder that already has npm packages in it? If not, you might want to run npm init -y to initialize a local package.json-file, before running npm i @huddly/sdk @huddly/device-api-usb.

avassist commented 1 month ago

Hello,

Please note that my main profession is an Audio Visual Technician and therefore I do have limited knowledge with regards to some of your suggestions. So I kindly ask that your team exercise extraordinary patience with me.

With that being said here are two videos on Google drive that I made regarding the issues that I am experiencing:

PART 1: https://drive.google.com/file/d/15uP8EyBWY3bp4AgUSi5hKHRvMBek_mxn/view?usp=sharing

PART2: https://drive.google.com/file/d/1vm6RjSRi65TkgUurLgY3UjDCKEwo5FfX/view?usp=sharing

pkhansen commented 3 weeks ago

If you have limited knowledge and experience, and especially if what technology you are going use doesn't matter, I would again urge you to use the .NET-SDK that I mentioned above. The javascript one will eventually stop function properly on windows machines (likely this year) and is no longer in developement. I can write up a short guide on how to go about getting started if you'd like that.

It seems like some, if not most, of the errors occurs as a result copy pasting directly into the node repl. I would suggest that you write and then separately run script files instead of entering the code directly into the node enviroment. To make that as easy as possible it's recommended to use some sort of text editor that has built in support for the syntax of the language in question. Personally I use Visual Studio Code. Once you have saved the script files you just run them from the terminal by using node <path-to-script-file>. You can read more about running javascript code in node here.

Lastly I would like to apologize for the lack of deprecation warnings in this repository and hope that you might have better luck using our newer SDK if you choose to test it out :)

avassist commented 3 weeks ago

Hi pkhansen,

Thanks much for responding. Since we will be starting again on implementing the new SDK(.NET-SDK), we would definitely accept your offer of writing up a short guide of this set up.

Also, with regards to the visual studio code, we will also have to do some learning as well. We will keep you posted on the developments and any further questions. Is it possible as well for your team(if it hasn't been done already) to put a disclaimer that "The javascript one will eventually stop function properly on windows machines (likely this year) and is no longer in development?"

avassist commented 2 weeks ago

Hi pkhansen,

Here is a video link of what I was able to do with regards to the .NET-SDK and using the Visual Studio Code.

https://drive.google.com/file/d/1YbxagSuxmIxIk6gHIzxTbyWrvfq8XWCK/view?usp=drive_link

Please let me know how we can proceed in getting this data on a platform like Tableau.