Live data from Hacker News

Writing a basic Linux device driver when you know nothing about Linux drivers

crescentro.se

11–20 of 72 posts

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#11

> I also thought I’d message the vendor and ask them if they could share any specifications or docs regarding their protocol. To my surprise, Nanoleaf tech support responded to me within 4 hours, with a full description of the protocol that’s used both by the Desk Dock as well as their RGB strips. How cool is that? Too many vendors still think that they have valuable intellectual property in such relative trivialitie…

I had the same reaction. Nano leaf is extremely cool for that.

This has to put them in the top 0.01% of companies that make consumer electronics.

I can think of only a few companies that bother to publish any details... And most of them are focused on industrial customers where it isn't unreasonable to need certain protocol details for integration or even just compliance with certain regulatory systems.

Maybe things are changing?

I have noticed that some of the LED light controllers you see on AliExpress are leaning in to open firmware standards. 5 years ago, you bought the controller and had to flash your own firmware. Now, there's an option at checkout to select an open source firmware. Some even have a USB port built in for flashing!

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#14

> I also thought I’d message the vendor and ask them if they could share any specifications or docs regarding their protocol. To my surprise, Nanoleaf tech support responded to me within 4 hours, with a full description of the protocol that’s used both by the Desk Dock as well as their RGB strips. How cool is that? Too many vendors still think that they have valuable intellectual property in such relative trivialitie…

I almost had that experience with one of the popular PC liquid cooling hardware vendors around 10 years ago.

I emailed them saying I'd be interested in developing drivers for their hardware for Linux as I was a happy customer and was immediately put in touch with one of the managers and their engineering team.

Made quite a bit of progress before the whole thing was shut down because one of their component vendors threatened them saying it'd be a breach of their contract with them.

Apparently that vendor sold a "datacenter" (non consumer) version of that hardware for which they charged a hefty license fee for the management software (which was Linux compatible).

Jokes on them, someone reverse engineered the whole thing with a USB analyzer years later and published it XD. (not me)

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#15
post #13

I wish this was done in C so I didn't have to learn Rust. But maybe it is time to learn Rust.

Rust isn't that difficult really. Easier in many ways than C if you're building normal software and not, like, a library of fancy data structures.

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#16

> I also thought I’d message the vendor and ask them if they could share any specifications or docs regarding their protocol. To my surprise, Nanoleaf tech support responded to me within 4 hours, with a full description of the protocol that’s used both by the Desk Dock as well as their RGB strips. How cool is that? Too many vendors still think that they have valuable intellectual property in such relative trivialitie…

Yeah that part of the article put a big smile on my face.

I did the same thing back in college, when I was in a lab. We wanted to do some research on Wi-Fi signals, and I happened to own a bunch of Wi-Fi adaptors produced by SomeSmallTech Co. Ltd., which featured relatively new Atheros chips and didn't have Linux drivers at the time.

So I sent an email to the company's public email address, asking for some datasheets, "for science". To my disappointment, presumably a PR person replied that they "don't have a company policy to collaborate with academic research". (But they did send a quick reply, kudos to that.)

Funnily enough, years later I ended up working for said company. Naturally, when I first logged into the company network, I searched for the datasheets I asked for. There were "classified" watermarks all over the PDFs :)

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#17

> I also thought I’d message the vendor and ask them if they could share any specifications or docs regarding their protocol. To my surprise, Nanoleaf tech support responded to me within 4 hours, with a full description of the protocol that’s used both by the Desk Dock as well as their RGB strips. How cool is that? Too many vendors still think that they have valuable intellectual property in such relative trivialitie…

I have a solar inveter from a company, aparticular German brand. I wanted to use home assistant with it so I needed rs232 data.. tried the support and they asked me to sign an NDA.

Okay, cool. I did with a fake name, address and everything and they sent a file..

Turns out the file is available online.

Facepalm pro Max.

So my question is, what kind of "IP" is in a data sheet that needs protection ? And this isnt even some secret product but a generic solar product sold by millions.

Rs-232 protocol ? Really ?

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#18

> I also thought I’d message the vendor and ask them if they could share any specifications or docs regarding their protocol. To my surprise, Nanoleaf tech support responded to me within 4 hours, with a full description of the protocol that’s used both by the Desk Dock as well as their RGB strips. How cool is that? Too many vendors still think that they have valuable intellectual property in such relative trivialitie…

It's not the IP, it's sadly how people react. Some folks will be appreciative of help, credit to them. Others will immediately get back how they tried it, it didn't work and now they need you to rewrite everything, or do their project for them, or redesign your product to match what they want it to be. And if you politely refuse, it quickly escalates to threats of trashing your business through every channel, and other things.

So, the safest thing to do is not give details at all, or "leak" them like another reply in this thread mentions.

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#19

I want to run FreeBSD on my laptop, but they don't have a [complete] driver for my wifi card. I've thought about diving into AI coding-assistant agents just to see if I could use one to finish throwing together a working driver... but figuring out the AI agents is frictiony enough that I'm leaving it be. (I'm not a VSCode user)

Claude code, being a CLI interface, might be more your style? Expensive though

Re: Writing a basic Linux device driver when you know nothing about Linux drivers

#20
Excellent post! I have a Nanoleaf 3d thing that I was hoping to use as an ambilight-like thing for the TV, but the experience was... meh. I know about the Hyperion project and hope to set it up one day, but meanwhile I think I could try to repurpose this code to control the strip from a Linux box.
Post reply on HN