(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=41021029

本文描述了一个复杂的 IoT(物联网)库,支持通过各种方法(例如蓝牙 LE、USB、串行或网络协议)连接的多个设备。 这些设备在制造商之间存在很大差异,由于不同的属性和通信要求,需要进行定制。 为了保持兼容性,该库将开发人员发送的通用命令转换为通过适当通道传输的设备特定指令。 该库支持多种操作系统,包括 Windows、Mac、Linux、Android、iOS 和 WASM/Web,每个操作系统都具有独特的硬件应用程序编程接口 (HWAPI)。 由于蓝牙无线电的差异,会出现兼容性和性能问题。 作者提到在 Firefox 设备接口团队工作,并与 Chrome 工程师合作开发以硬件为中心的 WebAPI。 然而,尽管熟悉基于浏览器的解决方案的复杂性,但他们无法解释与浏览器实现相比在库中观察到的延迟,这表明设计目标存在潜在差异。 此外,作者还强调了支持众多 DIY 设备(例如 OSR-2/SR-6/SSR-1)时面临的挑战,这些设备具有广泛的自定义功能,难以与库的通用命令集成。 问题包括处理特定于设备的怪癖、管理保活以及确保跨平台支持。 一些设备采用不寻常的通信机制,使其容易受到黑客攻击。 作者最后指出,该库目前支持超过 500 种不同的设备,其中许多设备质量较差,导致故障方面出现混乱。 此外,某些设备会表现出意想不到的行为,导致使用过程中的挫败感,特别是在处理电池电量低、音频故障、偶尔致命错误或导致视图卡住的错误时。 总体而言,本文深入探讨了维护包容性物联网库时遇到的挑战,以及了解用户期望和设备特性的重要性。

相关文章

原文


Oh hey it's been a while.

Hi, I'm qdot, founder of buttplug.io and author of Butts Are Difficult, the ethics page in the buttplug.io docs.

I also wrote the rest of the buttplug.io docs but this is the part that I'm proudest of, both because I was really happy how it turned out and also because unlike the parts of the docs involving the API, this one doesn't go out of date as quickly.

Ask me anything!



>If I'm REALLY turned on, how long does it take for me to go from "I wanna use this" to "I am using this"?

I'm glad this is a concern. I maintain software to the effect of buttplug.io and a particular inspiration to start the project was how difficult alternatives were to get going with. I don't want to install anything, or register anywhere, I just want to get my rocks off!

And thank you for buttplug.io. It's super easy to integrate!

I realise this isn't much of a question, sorry :)



I'm laughing so hard because the guidelines in that section track very closely with things that I'm constantly reminding people about with unmanned aviation software. You just need to s/turned on/in an emergency/.



Wow, that's awesome! Super curious what project it is you run. (If you don't want to link it to your HN account, feel free to poke me directly, my contact info is in my HN account bio :) )



I have heard that your project has one of the fastest bluetooth libraries in the industry, its so good DOD devs have tried to have the namespaces renamed or something to that effect.



I was telling my gf this yesterday as my car refused to pair with her phone (she had to unpaid it so that it wouldn't try to connect when we were driving both our cars nearby) which I guess is a necessary step of connecting (I am not sure I've ever successfully connected two Bluetooth things without pairing them) before the traffic light turned green and the car locked up the Bluetooth UI, so that the driver couldn't operate it, which meant that both the driver and the passenger spent loads of extra time fucking with it until giving up and playing the song directly from her phone's internal speaker

I have never ever seen Bluetooth work as intended



The Bluetooth experience varies wildly. The Bluetooth stack is pretty enormous and complicated these days, so there's a lot of space for software and hardware vendors to screw things up.

Apple-to-Apple seems to be dead reliable from everything I've heard. Samsung-to-Samsung seems almost as good. Apple or Android to random, Chinese car stereo might be a connectivity nightmare. Connecting to an OEM stereo with whatever implementation was poorly specified by the car company might also be a nightmare.



The problem with most automakers (good example, General Motors) and their electronics divisions (i.e ACDelco) is their centuries of experience with getting sued, so everything innovative gets reworked to satisfy the demands of the legal department, specifically as far as cars sold in the United States is concerned.



Yeah, my iPhone 13 hasn't worked reliably with the Bluetooth in my 2009 Prius for a year or longer. The Prius software is just too old, I think, and I'm not sure there's a way to upgrade.



i'd think the prius software being old and not upgradable would guarantee that it would work; apple can't have possibly tested their iphone 13 with the models tesla brings out next year, but a 2009 prius ought to be an extremely well characterized platform for their compatibility testing



> You are either speaking hyperbolicly or lying. Bluetooth is very stable these days.

Bluetooth as a network protocol, that might be stable. Bluetooth interactivity is not stable or even usable in many cases.

It's not just in cars and other non-computer interfaces, good luck trying to pair a non-Apple device with an Apple device. If you say "it works on my computer", congrats, you're the only one. And also speaking hyperbolically.



I have no interest in BPs but your post is very informative, and your writing is insightful and funny. I wish I wrote that well!

Are you aware of any uses of your software in other domains, e.g., health?



I don’t really have a ton of interest in maintaining a ble library, it’s just required for my main library. Theres a lot of weirdness around Bluetooth implementations between platforms and now I’m on the hook to either support them or tell users nope. I’d rather be doing neither and just be the user or someone else’s nice cross platform Bluetooth rust library. (Luckily we do have some fantastic contributors)



> its so good DOD devs have tried to have the namespaces renamed or something to that effect.

Hilarious and impressive; I’d love to hear more, do you have more details, context or source?



Source was me, from some friends that were trying to use the library and the name was causing issues with contracts. Btleplug was named the way it is because I am horrible, and the name alone has caused it to have to be wrapped or just not used at least a few times.

Which hey, less support for me.



I tried to use buttplug years ago but I found it to be difficult to work with and introduce too much latency into play. My partner and I have replaced it with 37 lines of javascript that give us more realtime control of our toys (albeit only Lovense, by just spamming .writeValueWithoutResponse()).

I'm curious what your background is that you approached the problem in the way that you did? I appreciate that you're covering all the edge cases for a lot of different toys, but it also really feels like you use 1000 lines of code where 10 will do.



> it also really feels like you use 1000 lines of code where 10 will do.

Ok. Let's break this down.

The library currently handles support for 523 different devices from at least 40-50 manufacturers. (https://iostindex.com/?filter0Availability=Available,DIY&fil...).

These devices can connect over bluetooth le, usb (both raw and HID), serial, or one of several network protocols. We support windows, mac, linux, android, iOS, and WASM/web, each having their own HW APIs (or in the case of the mac/iOS crossover, specializations within the API). On several of these platforms there are also massive variations in bluetooth radios, which can cause a huge array of issues.

Each device may have variable actuators, or may also have sensors to take input. They may also require their own keepalives or other specializations specific to their protocol or brand to manage connections.

We then have to generalize commands to make life easier on developers. They send us those generalized commands, from whatever language they like since we abstract into an IPC system and provide a language-agnostic protocol spec, from whatever interconnect they want to use because our connector system is also violently flexible, and we have to convert them into the correct protocol and ship that over the correct bus.

So, since you're curious about why your solution for one device from one brand running through a web browser differs from my library, there you go. It's just a matter of different goals.

Now, if you can do all that in 10 lines, fantastic, I look forward to your library as competition in the future. :3

While I'm glad you've found a solution that works for your case, I can't tell you why you were seeing latency in our library that wasn't also in the browser. I'm well aware of the JS-to-IPC-to-hardware chain in the browser (I'm the ex-device interfaces lead on firefox, worked with some of the chrome engineers on the development of the hardware focused WebAPIs too) and it's even more complicated than ours.



Also, if you're curious about web focused solutions to these issues, this is the perfect time to bring up a friend of our project, XToys: https://xtoys.app.

It's a fully web based (though closed source) toy control application that supports about as many devices as I do, plus a bunch of others that I don't, and has Blockly scripting and WebRTC for remote sessions.

It's neat as hell.



Best: Funny enough, it's for a (set of) device(s) that constantly causes me issues, the OSR-2/SR-6/SSR-1.

Here's a background video I did on the hardware: https://www.youtube.com/watch?v=MFcrNk33_io

It's DIY, 3d-printed hardware that's incredibly extensible, and has a decently designed abstract communication protocol that I've ended up pointing other DIY creators at. Keeping up with everything the hardware can do while also trying to make it work with our generalized commands is a challenge, but it's a good challenge, because we don't see a ton of innovation from the large commercial manufacturers.

Least enjoy: We support over 500 devices now, so this is just a whole classes of devices at this point heh. There's a lot of hardware we support that's just not very good to begin with, and users can't tell whether it's our library or the hardware hardware that sucks. Then there's the hardware that makes very... odd decisions about how to do things. For instance, there was a brand known as MuSE or Lovespouse that's been popular for the past couple of years. Instead of creating a bluetooth connection to the device, the device acts as a host and listens for advertisements w/ specialized data in order to set vibrator power. Not only is this easily hackable (there was a bunch of articles about someone doing exactly that with a flipper zero last year), it's damn near impossible for us to implement cross platform support for, as advertisement creation in BLE is wildly different across platforms, and doesn't even exist on iOS (the company themselves only shipped on android, where buttplug works on win/mac/linux/android/iOS). On top of that, the Lovespouse devices were extremely cheap ($10-30US sometimes), so we had users buying them then asking if we supported them, and all we could say was "nope".



I used to work in the Group Fitness (gym electronics) space and this is exactly how some BLE heart rate monitors get around the problems with otherwise requiring the host to connect to 20+ devices to capture their data. Put heart rate into the Manufacturer-Specific region of the advertising packet and boom, no one needs a connection.

Problem is that it's non-standard, so every device packages the data a different way.



Oh lord do I have some stories there. Way back in the nascent Quantified Self days, I ran http://openyou.org, which was basically "Buttplug for consumer health devices" (I mean I guess Buttplug is Buttplug for a specific type of consumer health device but, well, you get the idea).

There's a god damned heart rate profile standard in the bluetooth spec AND YET I'm not sure I ever actually worked on a device that used it. :|



Cool to see someone quoting Cex 20+ years later. I listened to his stuff a ton back in the day and actually revisited only just a few months ago. Holds up just fine.



I’ve got a few friends who worked at CeX in their teens, and “sex” is the correct pronunciation. Reinforced by their open guest WiFi being called “Unprotected CeX” and the staff calling themselves “CeX workers”.



I love your ethics statement. TBH, this mindset ought to be the bottom line for any serious software (non-demoscene / non-fun-and-games type). Without pervasive empathy for the user, it's kind of hard to do the right thing in the first place. Especially within the strange organisms that are organisations.



1000s at least. We don’t have any detailed metrics because the data privacy issues there are… a lot, but going by download numbers and knowledge of platforms and some of the larger applications, it’s a decent number.



I was expecting lulz but this was actually very well written and gets into a lot of the softer aspects of human-computer interaction.

Also the double entendre of "plug" in technology contexts, subtly brilliant.



"Having a CoC in place guides moderation of situations where interests may conflict.

As for which CoC to use (if looking for a prewritten one), you can check out ours as an example."

Haha, not sure if intentional.



I’ve loved the Buttplug project. I was hitting an issue with their Bluetooth library controlling a we-vibe, and someone offered to drive over from the other side of the bay to help debug it. Bluetooth sniffer, and all.



One of the best posts of the year!

Tech, caring and humor in butt one in and out

And there's even an acceptable self-plug!



This is actually a think that Oculus / Meta feels like they didn't consider and still don't, even tho by their own statics it's the number one use for VR

Some of this I'm sure is my particular usage but still...

Examples: When the controller batteries are low I get a warning in the middle of my session and it sticks around way too long. If a battery dies in a controller the message is undismissible. The software I use works fine with one controller but instead I have to stop what I'm doing, remove the headset, find a battery, install it, put the headset back on, resume the software, and often reset the view because anytime you take the headset off it resets it's orientation.

There are also times where it just says "Fatal Error" and exits when the battery dies.

Another issue is I have 2d software I use in VR because having a giant screen is nice. But, Oculus insists on playing some annoying hum sound in the home screen with the built in desktop viewer. Note: I'm not using the 3D environments as my home screen because that ads more time to get stated. So, in any case, I have to launch something to get rid of the sound. I usually pick a video viewer app because it's very small and then pop up the desktop over it without selecting a video. But, Oculus is apparently unaware of this use case because they break this in some new way every few releases.

The latest is, if you bring up the desktop in the middle of an app, after about 5 seconds it automatically takes you back to the VR app. It's almost like they forgot the feature exists. Other issues in this area are it went from a fairly rock solid feature to one out of 3 times entering into some bug loop where it flips between paused mode (desktop) and VR app mode. Being able to get out of this loop bug has about a 1 in 4 chance. Fixing it removing the headset and restarting the Oculus software on the PC. Then starting whatever apps you were in.

Note that I'm using a Rift-S. I tried using a Quest 3 with Link which tries to give you the same experience but the Link was way way too flaky, crashing 1 of 3 times, when I pulled up the desktop.

Another feature that broke, which I used frequently, was pulling up the desktop and pinning it so it stays visible while a VR app is running. It was a great way to goon.

And, all of this is using porn software which makes it hard to make bug report that will be taken seriously.



I really wish more headsets had eye tracking available, I've wanted to play with UX for multi-video/image gooning interfaces with gaze direction. Unfortunately headsets with that available built-in aren't cheap and the DIY solutions are still somewhat tedious.

Would love to discuss these use cases more though, feel free to contact me via one of the methods in my HN bio!



The hard thing about this is that it's not all software. Just look up what can go wrong with "the handy."

The thing is a pinch hazard and a user could get their scrotum sucked into the slit of the machine, or get pinched as it vigorously slides back down.

Just look up the reports of what can go wrong --it's not pretty. ("do not press it on your scrotum" is the frequent community refrain.)

AFAIK, most of these devices do not have pressure sensors and feedback mechanisms. They're output only.

No amount of software develpper empathy will help as when things go wrong it will happily slice your genitals off and keep chugging away.



Yup, you are completely correct on the sensor side. I try to be fairly choosy in what we support, but yeah some strokers and machines definitely do not have the safety features I’d like.

Many years ago, there was another device that relied on a lubrication pump, but the pump never worked very well (building a pump for unspecified body safe lubricants is difficult on several levels).

The term “degloving” got used in relation to the hardware a couple of times.



In this context… well.

I'm going to Rot13 this so I don't make people faint.

Vg'f jurer gur fxva vf gbgnyyl erzbirq. V haqrefgnaq guvf vf gur svefg fgrc va n erny znyr-gb-srznyr traqre punatr bcrengvba, bayl va guvf pnfr vg jbhyq or n fhecevfr naq jvgubhg nanrfgurgvp



Depends on where I'm sending the CV! It's always on there in some form, but I can recontextualize the library as a "haptic device management system" if necessary. I've also just basically repeated the design of the system verbatim in architecture focused interviews before.



From reading the docs I see a pretty generic device fleet management framework. What makes this software specific to sex toys besides the intention of the authors and the name? Couldn't you just as well manage - i dunno - a fleet of corporate e-scooters with it?



Thinking this thought further made me giggle. Imagine devs deciding it's the best option for managing some enterprise device, onboarding would be so funny. "Yeah and now you need to enter the address of our buttplug server [..]"



You're absolutely correct! I mention this elsewhere in the documentation even. Buttplug really is just a userland HID manager at its core. The only specialized part is the context of commands we send to devices.

The original plan (and it may still happen, who knows) was to figure out a way to chop off that top message layer and create a generalized system for doing exactly what you've said. That was going to be called 'deviceplug', and it's why btleplug is under the 'deviceplug' org on github (https://github.com/deviceplug/btleplug). I've just never gotten around to it because I'm not quite ready for the additional support burden yet.

All that said, Buttplug is also a haptics experimentation project aimed at finding out what it's like to create a way to communicate about a very specific type of touch via technology and programming. There are specific goals within the project related to that, but the amount of tech required to actually pull that off means I end up with what basically amounts of a fleet management framework. :)



Hah I've worked with the creators of both of those platforms.

Funny enough, using those sensors to relay information to things like events on avatars in VR virtual worlds has had some interesting results!



I'm sure you've seen substantial growth from working on hard problems, identifying key tentpoles, finding an opening, and moving fast to ensure user satisfaction via quick syncs and fluid processes.

In all seriousness, good on you. It's nice to see tech being used for unambiguous let-humans-have-more-fun purposes. (I look forward to eating my words in five years when you pivot to enterprise SaaS for growth purposes and Cisco is offering you as an employee benefit.)



I dunno about you guys, but about a decade ago, I just stopped having to _absolutely know_ the truth value of statements, webpages, satire, ignorance , conspiracy the, and other aberrations that appear on the internet.

This is one of those times.



> These hopes have to be tempered by the issues of the general sterility of software, though. GitHub, StackOverflow, Glitch, and other community sites were not really made with NSFW content in mind.

Yes and I hope it stays that way. Teenagers or even children may use those platforms and I think we're oversexualizing everything too much already.

Maybe that's an opportunity for a new developer platform focused on NSFW uses.



> we're oversexualizing everything too much already.

We're really not. Most platforms are way too strict with NSFW things, especially the recent LLMs which won't even write spicy fan fiction. There's no point in NSFW which is completely out of context and unnecessary, but a genuine buttplug controller? What's wrong with that?



By and large, we all get horny, and we all like to get our rocks off. A good thing too, or the species would have died out ages ago.

It's sad that even in 2024 it is taboo to talk about it in the eyes of some, or apparently to even publish tangentially related source code to GitHub. I very much doubt that any curious teenager is going to get turned on from reading the buttplug.io source code. And if they do: props to them.

On the one hand, we seem to sexualize the weirdest things (beauty pageants for kids, anyone?) without anyone seeming to care. But on the other hand, we're weirdly prude & defensive about perfectly natural processes (sex, masturbation, sexual curiosity & experimentation) to the point that we have to censor them on the internet. I still can't grok that.



I'm pretty conservative but i f I found my teenage son browsing the buttplug.io library on github I wouldn't be very upset. It's funny and midly erotic with no visual cues, something that is not a problem for teens.



In Europe this is often attributed to American cultural imperialism.

TV, at least in The Netherlands, has become a lot more prudish, Music censored, etc.

I've worked (in the internet branches of) Dutch National media organizations, for magazines and publishers. All lament, that "back in the days, a pair of its, or a penis flopping through a scene was normal." All due to American influence. It's certainly not imposed top down.

A dutch beach club owner told me it used to be rather normal for women to be topless on the beach, up to the early 2000s. And that nowadays it's almost unheard of.



I don't know how else to say this, but American institutions, and Americans, are profoundly uninterested in what nudity taboos you may or may not have over there. American tourists might care, if they're looking to see some tits on a beach.

Have you at least considered the possibility that Europe has its own prudes?



They may be uninterested and unaware and yet very powerful in propagating their own hangups all over the place. For example through movie and TV production. For example through movie, TV and video distribution. For example through legal models and specific texts. For example through organizations active in the hangup propagation business (so, they are certainly not ALL uninterested). For example through credit card networks and banking. And it goes on and on. I nearly forgot to mention technology companies and (currently) their "app" markets.

Some countries like the UK seem to be ahead of the pack in the hangup department but they also don't have the global footprint / influence that the US have.



And, not to forget, the all-powerfull tech monopolies. E.g. Facebook and Instagram have a very US -centric idea of what content is allowed. Nudity, not even a hint of a nipple, is banned. Youtube is rather similar.

And generations are influenced by social media. They will form (at least a part of) their world views, values, behaviours from social media.

Another reason why it's such a d*mn shame that Europe doesn't manage to keep it's own tech giants that could compete with the US ones.



Hear hear.

The fact that (for the most part) 2 American credit card companies determine what porn people can and cannot watch on-line world-wide is an embodiment of this very problem.



I am afraid you misunderstood me. Sorry for that.

I specifically said "American Cultural Imperialism" and mentioned "bottom up". So there's absolutely no US institute that would be even remotely interested in what people on a Dutch beach wear or how much boobs there are in a French movie shown in a French home.

It's the general "way of life" and "culture" that is exported, embraced and then lived by. Making new generations "more American" and therefore, also more prude. At least, that's the idea.



Not just more prude but shifting it. In the past it was normal to see naked people at the beach or changing rooms. Now that's been stamped out, but porn is massive. The only naked people the majority see are porn actors.

It's not more prude, it's just more sexualised.



I used to share your opinion, but I had to do with the adult content world for work related stuff and it was the filthiest thing I've ever had to deal with in my life. Sex work is an ugly thing, built upon the exploitation of both workers and customers. Nothing freeing or emancipating about that.

Yes we shouldn't treat sex as a taboo and children should be educated to avoid STDs, unwanted pregnancies, etc. No, we shouldn't expose children to the filth of the adult content world.



You could also have been referring to retail or low-cost manufacturing.

For others, sex work is validating, empowering, exciting, beautiful, freeing, independent, a way to be seen (that means recognized for who they are - rather than societal conformance pressures), a direct interaction with people who truly appreciate and are thankful for the work, flexible, personal (as opposed to impersonal / replaceable cog), creative, and something that they can get up for in the morning.

What you are describing is not rooted in, or equivalent to "sex work". You can be depressed and want to kill yourself at the perspective of going to the office. That it's an "office" is not the root of it.

联系我们 contact @ memedata.com