michaelabon / streamdeck-logitech-litra-lights

Control your Logitech Litra lights via your Elgato Stream Deck
GNU General Public License v3.0
9 stars 1 forks source link

Windows: unable to write bytes with lights off WriteFile: (0x00000001) Incorrect function #7

Open go0pey opened 8 months ago

go0pey commented 8 months ago

idk what most of this means some form of tutorial would be useful

michaelabon commented 7 months ago

Hey @go0pey. Thanks for checking it out. You've encouraged me to figure out how to build and release it on my own. Can you try to install the pre-built version and let me know what works and what doesn't work for you?

Installation instructions

  1. Download the .streamDeckPlugin file from the Releases page.
  2. In your Downloads folder, double-click that ca.michaelabon.logitech-litra-lights.streamDeckPlugin file. It should install in your Stream Deck application.
  3. If it installs correctly, there will be a new section called Logitech Litra. It will have two actions: one to set your light(s) to a particular temperature and colour, one to turn your light(s) off. Screenshot 2024-05-02 at 10 06 41
michaelabon commented 7 months ago

I found out that v1.0.4 won't actually run, in part because that was my first public release and I missed an important step. Try out v1.0.5.0 which I've confirmed works with my own setup.

Again, I'm eager for feedback. Let me know here or in a new issue if you have any questions or problems.

go0pey commented 6 months ago

its working now within the streamdeck software, but it doesnt seem to want to link to my actual lights, or idk how to do that

natessaxlife commented 6 months ago

I downloaded the plugin (v1.0.5.0) and I can see it in the streamdeck software. It also successfully added it to my plugins folder, but like go0pey said, it's not controlling the light.

Will there also be an option to turn on the light?

natessaxlife commented 6 months ago

Also, I just realized that you are on a mac, and I'm on windows... I wonder if that would change anything...

go0pey commented 6 months ago

wait is this meant for mac???? is that why it doesnt work??

michaelabon commented 6 months ago

Hmm... I do build it and use it in both macOS and Windows.

natessaxlife commented 6 months ago

That might not be the problem then, that's just something I noticed

michaelabon commented 6 months ago

@natessaxlife @go0pey Are you using Logitech Litra Glow or are you using Litea Beam lights?

natessaxlife commented 6 months ago

I'm using the litra glow

go0pey commented 6 months ago

im also using the litra glow

go0pey commented 6 months ago

it could be some step we are missing? could you give us some instructions on how you would install and use?

michaelabon commented 6 months ago

@natessaxlife @go0pey: Okay. I'm also using a pair of Litra Glows, so that isn't the issue. (I know that it won't work with Litra Beams or Beam LXs unless I modify it further).

Can you send me the latest file in %AppData%\Elgato\StreamDeck\Plugins\ca.michaelabon.logitech-litra-lights.sdPlugin\logs? I believe you can just drag and drop it into this comment box here.

(I'll almost certainly need to release an update with better logging to track down what's going wrong, but let's start with what we have.)

it doesnt seem to want to link to my actual lights, or idk how to do that it could be some step we are missing? could you give us some instructions on how you would install and use?

I'll upload a video in a few minutes, but there isn't any need for a "linking" step. The plugin basically asks the system for every Logitech Litra light and it sends instructions to them.

michaelabon commented 6 months ago

i dont have a file in there? when searching there are no results

Hmm, that's helpful info. In the %AppData%\Elgato\StreamDeck\logs folder, is there any file that starts with ca.michaelabon or similar? If so, can you include those here?

natessaxlife commented 6 months ago

It wont let me upload the 3 files I have in the log folder, but I'll try to send a screenshot image

natessaxlife commented 6 months ago

%AppData%\Elgato\StreamDeck\logs for me doesn't have anything with ca.michaelabon

natessaxlife commented 6 months ago

image This is the log from %AppData%\Elgato\StreamDeck\Plugins\ca.michaelabon.logitech-litra-lights.sdPlugin\logs

michaelabon commented 6 months ago

@natessaxlife: Okay! Hmm, I'll start diving into that. Thanks for copying and pasting that.

%AppData%\Elgato\StreamDeck\logs for me doesn't have anything with ca.michaelabon

This doesn't really matter to anyone using it, but in case you're curious, there are two different directories based on whether the plugin even starts or not.

  1. %AppData%\Elgato\StreamDeck\Plugins\ca.michaelabon.logitech-litra-lights.sdPlugin\logs is my own plugin's logs after it successfully starts.
  2. %AppData%\Elgato\StreamDeck\logs means that the Stream Deck doesn't like how I packaged it or doesn't like something in the manifest.

Not all Stream Deck plugins do it like this, but this is how I've built it out.

go0pey commented 6 months ago

its pretty cool getting to see how it worls

go0pey commented 6 months ago

image this is what i get every time

go0pey commented 6 months ago

image okay nvm im stupid, i got this

go0pey commented 6 months ago

and also a .gitkeep file

michaelabon commented 6 months ago

Ah, okay, same issue for both of you. I think I have an idea of what the problem might be, but I don't know off the top of my head how to fix it.

The .gitkeep file is totally ignoreable for our purposes!

natessaxlife commented 6 months ago

@michaelabon Any updates yet? thanks!

michaelabon commented 4 months ago

@michaelabon Any updates yet? thanks!

@natessaxlife @go0pey I haven't forgotten about this; I just don't have a lot of free time to dive into a fix for it.

I think that the issue stems from the fact that I'm using https://github.com/sstallion/go-hid as an interface into the HID API, which is how OSes communicate with USB devices.

That Go library itself relies upon https://github.com/libusb/hidapi to actually do the USB communication. That is a C-based library. I think the problem is that my pre-built releases are not also including the C-based library.


If you want to noodle on this in your own time, I think that trying to successfully install go-hid would be a good start. I suspect that if you can get go-hid to install, then the rest of this plugin will install just fine. The hidapi library has a page on prerequisites that might be a good place to start.