FOC-Stim: a new approach to DIY stim hardware.

This is the place for all suggestions, releases and feedback regarding Milovana Hardware efforts.
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

puste wrote: Sat Jul 12, 2025 1:33 pm I have 3 questions about the foc box software.
1) Why do i get this error after version 1.30 OPENSSL_LH_set_thunks is not found in DLL library
2) In newer version it seems that it has to update firmware automatically is this correct.
3) With version 1.41 it can't work because the firmware needs to be updated. Do I have to do this manuely.
What does firmware update mean for existing FOC files.
1) I don't know. Does this prevent restim from starting? You may need to update openSSL libraries on your computer, but I never heard anyone else complain about this.

2) No, firmware needs to be updated manually. I want to integrate an updater in Restim, but it's not there yet.

3) Yes. To update the FOC-Stim firmware, download the new code from the FOC-Stim repository (https://github.com/diglet48/FOC-Stim) and build / upload using Visual Studio Code.

Old funscripts remain compatible with never versions of Restim/FOC-Stim.
User avatar
puste
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Dec 29, 2018 9:12 pm
Gender: Male
Sexual Orientation: Straight
I am a: Slave
Location: Europe

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by puste »

Thanks for clerify that Old funscripts remain compatible with never versions of Restim/FOC-Stim.

I have now manel opdated the firmware to newest. But Now I get some error. It seems to work up to Restim version 1.36.
After try to use newer version I get different errors.

Run Restim version 1.41.
INFO:restim.websocket:websocket server active at localhost:12346
INFO:restim.tcp_udp:TCP server active at localhost:12347
INFO:restim.tcp_udp:UDP server active at localhost:12347
INFO:restim.main:funscript mapping changed, re-linking scripts.
INFO:restim.focstim:Connecting to FOC-Stim at COM9
INFO:restim.focstim:connection established
INFO:restim.focstim:get firmware version...
INFO:restim.focstim:board: BOARD_FOCSTIM_V3 stm32_firmware_version: "1.0"
INFO:restim.focstim:get device capabilities...
INFO:restim.focstim:threephase: true potentiometer: true maximum_waveform_amplitude_amps: 0.15
INFO:restim.focstim:start signal...
CRITICAL:restim:Exception occurred
Traceback (most recent call last):
File "device\focstim\proto_device.py", line 197, in on_capabilities_response
File "device\focstim\proto_device.py", line 207, in start_signal_generation
File "device\focstim\proto_device.py", line 254, in transmit_dirty_params
AttributeError: 'NoneType' object has no attribute 'write'
WARNING:restim.main:Shutting down
INFO:restim.focstim:closing connection to FOC-Stim

Do I have upload the wrong firmware or is it the same for V1 and V3 board ?
But It seems to work ok with Restim version 1.36.
The OpenSSL is perhaps old on my PC. But the program runs fine without.
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

puste wrote: Fri Jul 18, 2025 9:10 pm
Thanks for the log. I see there is a bug, you can fix this by going into settings, tab FOC-Stim, check "Use teleplot". I will fix it in next release.

You have the correct firmware for your board. I know it says "BOARD_FOCSTIM_V3", that's also a bug, a harmless one.
User avatar
puste
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Dec 29, 2018 9:12 pm
Gender: Male
Sexual Orientation: Straight
I am a: Slave
Location: Europe

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by puste »

Thank you Use teleplot helped. I did also solve my problem withOPENSSL_LH_set_thunks is not found in DLL library.
I just copy the files: libcrypto-3-x64.dll and libssl-3-x64.dll to SysWOW64 and rename the 2 files in System32 to old.
This solve my problem with error when start the program.

One other thing I have seen is with the newer version is my boks sound like the buzzer of the sound.
It is not very loud but it seems somthing resonate in the box like hering the sound like estim.
I can not here this with Restim version 1.36. This sound is only head with the newer version.
What can couse this behavor.
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

The noise is probably from the inductors or transformers.

I don't know what caused the noise to increase in between versions, I don't think I made any changes that could result in extra noise.
Snakedoohh
Curious Newbie
Curious Newbie
Posts: 3
Joined: Sat Aug 17, 2024 5:19 am

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by Snakedoohh »

Do you see any possibility to make FOC-Stim possible for Webteases?
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

You can use this: viewtopic.php?t=27582

Which performs a translation from metronome sound to movement in Restim, compatible with all boxes Restim supports.

It is also possible to do real translation from stim audio to FOC, but I'm not super interested in building that because it's messy and I believe audio-based stim is on it's way out. I also don't play teases, so it's not something I would personally use.
saint337
Explorer
Explorer
Posts: 23
Joined: Mon Mar 04, 2013 9:48 am
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by saint337 »

Hi, Im trying to assemble the FOC box but have run into an obstacle. There are 3 audio jacks for output in the photos but i dont know how to connect them to the board, especially since most other boxes have 2 audio jacks for output. Bearing that in mind, i dont know how to connect the cables once im done with the box. I could dissassemble my triphase cable into something like - 2 positives that go into left and right and 2 negatives that would both connect to middle focstim output?
Sorry for being a noob, please help.
diglet
Explorer At Heart
Explorer At Heart
Posts: 390
Joined: Sun Dec 11, 2022 5:43 pm

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by diglet »

The box has 3 mono-pole outputs (4mm banana connector), which is a different concept than the 2 "channels" most boxes have. Have you ordered 3 audio jacks for your box? One stereo jack (trs) with a custom cable should be enough, although I prefer the 3 separate connectors.

I made three of these cables for my box. One end has a 4mm banana connector, and the other end is 2mm pin.
Image

Let me know if you're still unsure.
saint337
Explorer
Explorer
Posts: 23
Joined: Mon Mar 04, 2013 9:48 am
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by saint337 »

Thank you! Yeah, its clear now. Perhaps you can add that info to the list of things to buy - it didnt specify how many jacks to get so I figured 2, as in most boxes. Oh well, for now I will just connect cable-to-cable without jacks. Im anxious to feel the difference :)
saint337
Explorer
Explorer
Posts: 23
Joined: Mon Mar 04, 2013 9:48 am
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by saint337 »

And once again the FOC throws a challenge at me...
I finished assembling a box and only then tried to connect which was unsuccesful. Im having similar problem as DPL did and I have also ordered a different cable but I doubt it will solve the issue - I have 2 green and 1 flashing light on board no matter what cable i connect, but one of the two i have seems to give 0 reaction from my PC while the other cable says "unrecognised device". Chatgpt says that connecting the cable before installing drivers might have been wrong but having corrected that there is still "unrecognised" error that I get from the start. AI has some more sugestions- like trying DFU mode and STM32CubeIDE app. I'll do that after work and will say if it helped. If not the its new cables tomorrow... seems not even DIY stuff is free of charge ;) Gotta work for it.
User avatar
edger477
Experimentor
Experimentor
Posts: 1114
Joined: Mon Nov 29, 2021 8:24 pm
Location: underfloor

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by edger477 »

One of versions of firmware for esc1 board had a buggy debug portion that used to provide unstable com port.

I solved it by updating its firmware through stm cube programmer.
My estim creations: https://mega.nz/folder/73pxmBBQ#X6ylDzRafzTt9wanZ0dacw
And in E-Stim Index: viewtopic.php?t=27090

Try creating your own estims with my restim script generator!
Spoiler: show
You can also thank me with crypto: https://trocador.app/anonpay?ticker_to= ... e+a+coffee
saint337
Explorer
Explorer
Posts: 23
Joined: Mon Mar 04, 2013 9:48 am
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by saint337 »

Im inching closer and closer... But need help again.
So, new cables provided life. thats probably irrelevant now:
`
Spoiler: show
I managed to connect STM32CUBE and upgraded the firmware (when I open the USB folder there is newer file inside than there was before). I think I managed to upload something via VIsualStudio (it said "success" but when I manually go into USB folder then there are just same 2 files that were there after firmware update. And when I open restim the sound comes from my speakers. So... How to check if I indeed uploaded something through VIsualStudio? Can I select device in visual studio into which i want to upload files?
And assuming that went correctly - how to connect restim to the focstim? What output device should be chosen?
And once again - thank you people for all the help, you are great!

Although everything stated above is correct I think I might have uploaded 'nothing' onto the box. Even though upload is succesful I only now noticed that Im getting "fatal: repository 'https://github.com/diglet48/FOC-Stim/tree/master/' not found" at the start of visual studio. Im sure thats a problem that needs solving first... I have no idead what causes this, google search is not helping much :-/`
It all seems to be fine except i dont know how to get restim to work with it. It says :serial listener active on port: COM3. And that is where my usb for foc is connected. But whenever i play a funscript it goes to speakers anyway. How can i change that?
User avatar
edger477
Experimentor
Experimentor
Posts: 1114
Joined: Mon Nov 29, 2021 8:24 pm
Location: underfloor

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by edger477 »

saint337 wrote: Sat Aug 02, 2025 11:49 am when I manually go into USB folder then there are just same 2 files that were there after firmware update
That is normal, this "drive" is part of the debug board that you flashed (with STM tool, not VSCode), the actual microcontroller is just accessible through serial port and you can't see its contents here.
saint337 wrote: Sat Aug 02, 2025 11:49 am And when I open restim the sound comes from my speakers.
Your restim is configured for stereostim device. You need to redo device selection to chose FOC-stim (and in settings chose the com port for your esc board). Then you can try "start" and see in console/log if it works (it will mean you flashed it properly).

If not, just download foc-stim repository, open in visual studio and make sure you have platformio extension installed, once in loads you will have "build and upload" there. It figures com port automatically (at least it did for me, since I have multiple foc-stim boxes, I just make sure I only connect one at a time when flashing firmwares).
My estim creations: https://mega.nz/folder/73pxmBBQ#X6ylDzRafzTt9wanZ0dacw
And in E-Stim Index: viewtopic.php?t=27090

Try creating your own estims with my restim script generator!
Spoiler: show
You can also thank me with crypto: https://trocador.app/anonpay?ticker_to= ... e+a+coffee
User avatar
puste
Explorer At Heart
Explorer At Heart
Posts: 376
Joined: Sat Dec 29, 2018 9:12 pm
Gender: Male
Sexual Orientation: Straight
I am a: Slave
Location: Europe

Re: FOC-Stim: a new approach to DIY stim hardware.

Post by puste »

Hello edger477,

Thank you for your extensive work on FOC-Stim files — I've tried many of them, and I’m especially impressed with Euphoria. It’s incredibly well done.

I'm currently experimenting with creating my own files. I understand that the FOC-Stim software can convert a funscript into alpha and beta waveforms, but I'm very interested in how you generate the other parameters such as frequency, pulse_rise_time, pulse_width, pulse_frequency, and others.

While I have a general grasp of how volume works, I haven’t been able to achieve the same level of stimulation quality in my own test files. I would greatly appreciate any insight you're willing to share about your creative or technical process.

I also recognize that producing these files must be time-consuming, so thank you again for your dedication and the value you bring to the community.
Post Reply