sparky

package module
v0.0.0-...-2b0a249 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 0 Imported by: 0

README

Go Reference

sparky

Golang library for controlling the Dogtra 2300NCP shock collar using the HackRF SDR.

DISCLAIMER: This project is not affiliated with or endorsed by Dogtra.

Dependencies

  • hackrf_transfer

Pairing

To pair your collar to the software remote:

  1. Turn off the collar.

  2. Hold a magnet to the red dot on the collar until the green LED on the collar blinks rapidly.

  3. While the green LED on the collar is blinking rapidly, send a pairing command using the software remote.

    ./dt2300ncp --cmd=pairing --duration=5s
    
  4. The green LED should stop blinking rapidly. You should now be able to send other commands to the collar, e.g. vibrate.

    ./dt2300ncp --cmd=vibrate --duration=5s
    

CLI Examples

# Install dt2300ncp.
go install github.com/biribiribiri/sparky/cmd/dt2300ncp

# We're assuming your GOPATH is ~/go here.

# Maximum intensity nick.
~/go/bin/dt2300ncp --cmd=nick --intensity=127

# Continuous stimulation for 1 second.
~/go/bin/dt2300ncp --cmd=continuous --intensity=30 --duration=1s

# Vibrate for 5 seconds.
~/go/bin/dt2300ncp --cmd=vibrate --duration=5s

Reverse Engineering Details

The Dogtra 2300NCP is a shock collar with momentary stimulation, continuous stimulation, and vibration/pager functionality. It has a rheostat dial to control the stimulation intensity, which is displayed on the LCD screen as a value between 0 and 127.

Communication Protocol

The remote uses binary FSK (frequency-shift keying) to send commands to the collar.

The carrier frequency is 27.15 MHz.

Symbol definitions:

  • 0: 6.29 kHz, 0.75 milliseconds
  • 1: 1.76 kHz, 0.75 milliseconds

It is important for there to be no phase discontinuities in the modulating signal (Continuous Phase Frequency Shift Keying, CPFSK). See implementation for more detail.

Command format:

[Prefix] [Command][CollarID][Intensity] [Command][CollarID][Intensity] ...

When "nick" button is pressed on the remote, the [Command][CollarID][Intensity] sequence is repeated 3 times. For the continuous and vibrate commands, the [Command][CollarID][Intensity] sequence repeats until the button is released or until the 12s timeout is reached.

Prefix

Prefix (28 bits): 1111111000000011111110000000

Commands
Command Sequence (36 bits)
Nick 111100001001001101101001001101101001
Continuous 111100001001001101101101101001001001
Vibrate 111100001001001101101101001001101001
Pairing 111100001101101101101001001001001001
Collar ID

The 2300NCP remote has a "1-dog"/"2-dog" switch that allows it to control two collars. This changes the collar ID that is broadcast by the remote. A collar can be configured to particular collar ID by following the pairing instructions described above. Example collar IDs (36 bits):

  • 101001001001001101001001101001101001
  • 101001001001001101001001101001101101
Intensity

The intensity value affects the stimulation strength for the nick and continous commands. The intensity value as set by the rheostat dial is also transmitted for the vibrate command, but it doesn't affect the vibration.

Intensity Values
Intensity Sequence (30, 31, or 32 bits)
0 010100000000000000000000000000
1 011010000000000000000000000000
2 011101000000000000000000000000
3 011110100000000000000000000000
4 011111010000000000000000000000
5 011111101000000000000000000000
6 011111110100000000000000000000
7 011111111010000000000000000000
8 011111111101000000000000000000
9 011111111110100000000000000000
10 001010000000000000000000000000
11 001101000000000000000000000000
12 001111010000000000000000000000
13 001111110100000000000000000000
14 001111111010000000000000000000
15 001111111101000000000000000000
16 001111111110100000000000000000
17 001111111111010000000000000000
18 000101000000000000000000000000
19 000110100000000000000000000000
20 000111010000000000000000000000
21 000111101000000000000000000000
22 000111110100000000000000000000
23 000111111010000000000000000000
24 000111111101000000000000000000
25 000111111110100000000000000000
26 000111111111101000000000000000
27 000011010000000000000000000000
28 000011110100000000000000000000
29 000011111101000000000000000000
30 000011111111010000000000000000
31 000011111111110100000000000000
32 000001101000000000000000000000
33 000001111010000000000000000000
34 000001111110100000000000000000
35 000001111111101000000000000000
36 000001111111111010000000000000
37 000000110100000000000000000000
38 000000111101000000000000000000
39 000000111111010000000000000000
40 000000111111101000000000000000
41 000000111111110100000000000000
42 000000111111111010000000000000
43 000000010100000000000000000000
44 000000011101000000000000000000
45 000000011111010000000000000000
46 000000011111110100000000000000
47 000000011111111101000000000000
48 000000001010000000000000000000
49 000000001110100000000000000000
50 000000001111101000000000000000
51 000000001111111010000000000000
52 000000001111111101000000000000
53 000000001111111110100000000000
54 000000001111111111010000000000
55 000000000101000000000000000000
56 000000000111010000000000000000
57 000000000111110100000000000000
58 000000000111111101000000000000
59 000000000111111111010000000000
60 000000000010100000000000000000
61 000000000011101000000000000000
62 000000000011111010000000000000
63 000000000011111110100000000000
64 000000000011111111010000000000
65 000000000011111111101000000000
66 0000000000111111111101000000000
67 101010000000000000000000000000
68 101110100000000000000000000000
69 101111101000000000000000000000
70 101111111010000000000000000000
71 101111111110100000000000000000
72 100101000000000000000000000000
73 100111010000000000000000000000
74 100111110100000000000000000000
75 100111111101000000000000000000
76 100111111111010000000000000000
77 100010100000000000000000000000
78 100011101000000000000000000000
79 100011111010000000000000000000
80 100011111110100000000000000000
81 100011111111110100000000000000
82 100001110100000000000000000000
83 100001111110100000000000000000
84 100001111111110100000000000000
85 100000110100000000000000000000
86 100000111110100000000000000000
87 100000111111110100000000000000
88 100000010100000000000000000000
89 100000011111010000000000000000
90 100000011111110100000000000000
91 100000011111111101000000000000
92 100000001010000000000000000000
93 100000001110100000000000000000
94 100000001111101000000000000000
95 100000001111111010000000000000
96 100000001111111110100000000000
97 100000000101000000000000000000
98 100000000111010000000000000000
99 100000000111110100000000000000
100 100000000111111101000000000000
101 100000000111111111010000000000
102 100000000011010000000000000000
103 100000000011110100000000000000
104 100000000011111101000000000000
105 100000000011111111010000000000
106 1000000000111111111101000000000
107 100000000001101000000000000000
108 100000000001111010000000000000
109 100000000001111110100000000000
110 100000000001111111101000000000
111 10000000000111111111101000000000
112 110110100000000000000000000000
113 110111101000000000000000000000
114 110111111010000000000000000000
115 110111111111010000000000000000
116 110011010000000000000000000000
117 110011111010000000000000000000
118 110011111111010000000000000000
119 110001010000000000000000000000
120 110001111101000000000000000000
121 110001111111110100000000000000
122 110000111010000000000000000000
123 110000111111101000000000000000
124 110000010100000000000000000000
125 110000011111101000000000000000
126 110000001010000000000000000000
127 110000001111110100000000000000

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
dt2300ncp
Binary dt2300ncp is a simple tool for sending commands to a Dogtra 2300NCP collar using HackRF.
Binary dt2300ncp is a simple tool for sending commands to a Dogtra 2300NCP collar using HackRF.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL