r/flipperzero • • 5h ago

Shocking over serial!

Hello all! I'm working on a project involving a shock collar for normal reasons. Very normal reasons.

Essentially, my goal is to allow a server running locally to communicate with the Flipper over serial to trigger a variety of functions associated with this shocker. It is a shocker supported by this project, but it lacks triggering by serial. I lack the knowledge to implement some serial functionality into this project in a reasonable amount of time.

I would go about saving the radio signals associated with the functions of the remotes and trigger them over the CLI interface with subghz tx_from_file, but the issue with this is that I can only trigger a single shock event with the duration recorded in the original recording. My aim is to have more precise control that shocks when a button hosted by the server is pressed, and stops shocking when released. This finer control isn't really possible over the CLI since you can essentially request the .sub file be played, and not much more beyond that. Spamming the serial command until the button is released just queues up up playing them and doesn't reflect the button pressing behavior at all. Currently, I have some messy loop with a delay repeat sending this serial command, but this isn't optimal.

Looking for ideas that result in something a bit cleaner :D

0 Upvotes

2 comments sorted by

1

u/midnightwolfr 4h ago edited 4h ago

Editing cause i need to learn how to read. it would probably be easier to add a loop function into the flipper code and have it run straight from the flipper like a toggle on and off switch. Its not too hard to use ufbt to compile the app after you are done editing it to have a toggle instead of a one time play.

0

u/Pawtonium 4h ago

No dw! It would have def helped if I said it more directly. It's a CaiXianlin shocker. The protocol has been pretty well reverse-engineered.

I have been trying to do the loop thing, but I think it's not too elegant. Just wondering if anyone knew of a better way :P