WebUSB & Sex Toys

Selfbondage software and other kinky developments

Moderators: Riddle, Shannon SteelSlave

Post Reply
zappy1
*
Posts: 31
Joined: 28 Dec 2019, 06:37

WebUSB & Sex Toys

Post by zappy1 »

WebUSB makes connecting to UBS devices easy. Connecting to the USB port with WebUSB from Javascript can be done with about 15 lines of code. However, how can Javascript put a USB port to sleep? Supposedly there is no way to actually turn a USB port off, so putting it to sleep is supposedly the way to cut power to the USB port. The reason this is relevant is because it would make turning sex toys on and off from Javascript very easy. The goal is to make sex games easy to access and modify by anybody by keeping things simple. Turn sex toy on and off by cutting the power. Then any USB powered sex toy can be used, nothing special to buy,

The usb sleep is part of the power saving in Windows.

Here is someone that used JavaScript to control sex toys at https://github.com/buttplugio/buttplug- ... /master/js. The problem is it requires node.js with lots of code, thus being too complex.

Anyone here knows how to put a USB port to sleep with Javascript with or without WebUSB?
User avatar
Riddle
****
Posts: 1135
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: WebUSB & Sex Toys

Post by Riddle »

I am not familiar with turning USB ports on and off.

Have you considered using some sort of translation device between the computer and the sex toy? USB relay module? Arduino programmed to receive commands from the computer? If you can open a com port and send data to it, you can control a USB relay module or Arduino.
Resident timer maker. :hi:
Let’s make timers together!
gofc
*
Posts: 11
Joined: 07 May 2020, 13:57

Re: WebUSB & Sex Toys

Post by gofc »

I tried finding out how to turn ports on / off to control an USB powered vibrator, but I couldn't find an easy way to do this. In the end what worked best for me was using a wifi smart plug and a standard mobile charger: connect the vibrator to the charger, the charger to the smart plug, and then you can turn the plug on or off remotely.

The smart plug I have can be used with the "If This Then That" app, and that allows for different ways to trigger it on and off. One of them is using a webhook (essentially: an url that you can invoke from a browser, or anywhere, to turn it on and off). It's a bit of a roundabout way, but with that and a little coding you can control the vibrator from Javascript if you wish to. Just have your script do a web request for that url. You can even give the link to someone else and have them control it :D Only issue I found was a little lag from url request to actual activation (ranging from 1 to 5-10 seconds).

Depending on the smart plug, you might be able to interface with it more directly and not need the app. I eventually discovered a Python library for mine that could control it from a simple Python script, with no lag at all, so that's what I replaced the ITTT app with.
Last edited by gofc on 05 Dec 2021, 22:39, edited 1 time in total.
User avatar
Riddle
****
Posts: 1135
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: WebUSB & Sex Toys

Post by Riddle »

I am having trouble finding a USB powered massager. Any suggestions?
Resident timer maker. :hi:
Let’s make timers together!
User avatar
Shannon SteelSlave
Moderator
Posts: 6530
Joined: 03 Feb 2019, 19:49
Location: New England, USA

Re: WebUSB & Sex Toys

Post by Shannon SteelSlave »

Riddle wrote:I am having trouble finding a USB powered massager. Any suggestions?
Is there any way to remove the batteries from a USB charged version, hard wire the circuit, thus making it entirely reliant on a USB power feed, no battery to route to as secondary source?
Bondage is like a foreign film without subtitles. Only through sharing and practice can we hope to understand.
A Jedi uses bondage for knowledge and defense, never for attack.
I am so smart! I am so smart! S-M-R-T!....I, I mean S-M-A-R-T!
👠👠
User avatar
Riddle
****
Posts: 1135
Joined: 24 Sep 2008, 08:37
Location: Oregon, USA
Contact:

Re: WebUSB & Sex Toys

Post by Riddle »

Shannon SteelSlave wrote:
Riddle wrote:I am having trouble finding a USB powered massager. Any suggestions?
Is there any way to remove the batteries from a USB charged version, hard wire the circuit, thus making it entirely reliant on a USB power feed, no battery to route to as secondary source?
Yes and no. It is easy to cut one open and remove the battery. Doing so without ruining the waterproofing is impossible.
Resident timer maker. :hi:
Let’s make timers together!
User avatar
kinbaku
*****
Posts: 5050
Joined: 10 Jan 2020, 20:26
Location: Belgium

Re: WebUSB & Sex Toys

Post by kinbaku »

Riddle wrote:I am having trouble finding a USB powered massager. Any suggestions?
The Lovense Domi-2 is a good vibrator with a usb adapter, but I think it is only for loading the battery, not for the power.

This one is USB powered, because I read in the comments that it doesn't work when not put in an USB-port.
rezreal
*
Posts: 15
Joined: 10 Jan 2020, 01:20

Re: WebUSB & Sex Toys

Post by rezreal »

> Anyone here knows how to put a USB port to sleep with Javascript with or without WebUSB?
You simply can not (at least on the browser from a web page). You can iterate connected devices and use their interfaces, but you can not control such low level usb host features.
Post Reply