-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for duration #5
Comments
I'm not too familiar with ESPs, but i think if the main loop takes too long to run, the wdt resets them? (been a few years since I've played with one). So I'd suggest trying something like this that avoids calling delay(): Basically it's the ColTxSerial.ino example modified to transmit for 7 seconds (set on line 161) |
Thanks will give it a try later on. Not sure what the max duration of the collar itself is. Did you experiment with it yourself? |
I honestly can't remember - I probably didn't experiment much with max duration. But I knew they could be on for a few seconds, but I can't remember if there's a limit or what it is |
Got it working, even with WiFi enabled and a webpage (remote control FTW) it stays stable until 10 seconds :) Maybe even more but I think 10 is a nice max. Made a few modifications to implement the timer in the commands Added int sec = atoi(&input_message[5]); under power = atoi(&input_message[2]); So the message should look something like this 1V15:05 for collar 1 vibrate at 15% for 5 seconds. Only thing I can't really figure out is the timing. It seems to be time + 1 second roughly. So 10 is 11 and 1 is 2. Also want to implement a pavlov mode. So vibrate first then shock. Guess it needs the modification inside the void loop at the check "if (_transmit_end_ms > 0)" so it will set to vibrate for 1-2 seconds (or 1/3 of the time or something? and then change the "_msg" so it will shock instead of vibrate. |
I'm not sure why it's triggering for an extra second - it might be just the response time of collar, or something like that? If it's always out by 1 second, i guess the easy approach is just to take 1 sec off seconds on transmit() 😂 Getting to vibrate first the shock is probably a bit more awkward. I guess you'd need to do something like add a _transmit_start_ms time, and a pavlov_mode flag. |
Do you by chance have the remote for it to test something? Perhaps the second is just the minimum trigger amount and every "loop" adds another second to it. So trigger + 1 loop is 2 seconds instead of 1 because the trigger already adds 1 second. |
Just found it and tried it... yeah, from pressing the button to the shock collar stopping, it does seem to be around a second |
I experimented a bit with the "type 1" collar. It seems to support longer/continuous vibration and shocks. Tested to 7 seconds.
I've hacked together a very crude method to let it trigger longer. If you call the function in a loop. With the loop count double the amount of seconds it seems to work about right with a delay of 250 in between.
But after a few seconds the ESP restarts so I guess it overloads the system doing it like this. Any idea how to implement this cleanly inside of the collarTX libary?
The text was updated successfully, but these errors were encountered: