Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKGS = balance blacktip_dpv refloat tnt vbms32 vbms32_micro
PKGS = balance blacktip_dpv refloat tnt x1_unlocker vbms32 vbms32_micro
PKGS += lib_files lib_interpolation lib_nau7802 lib_pn532
PKGS += lib_ws2812 logui lib_code_server lib_midi lib_disp_ui
PKGS += vdisp lib_tca9535 vbms_harmony32 vbms_harmony16
Expand Down
1 change: 1 addition & 0 deletions res_all.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<file>refloat/refloat.vescpkg</file>
<file>logui/logui.vescpkg</file>
<file>tnt/tnt.vescpkg</file>
<file>x1_unlocker/x1_unlocker.vescpkg</file>
<file>vbms32/vbms32.vescpkg</file>
<file>vbms32_micro/vbms32_micro.vescpkg</file>
<file>lib_ws2812/ws2812.vescpkg</file>
Expand Down
11 changes: 11 additions & 0 deletions x1_unlocker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
VESC_TOOL ?= vesc_tool

all: x1_unlocker.vescpkg

x1_unlocker.vescpkg:
$(VESC_TOOL) --buildPkg "x1_unlocker.vescpkg:script.lisp::0:README.md:X1-Unlocker"

clean:
rm -f x1_unlocker.vescpkg

.PHONY: all clean
51 changes: 51 additions & 0 deletions x1_unlocker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# X1-Unlocker

Automatically sends a "magic" message, to unlock the CAN-port of INNOTRACE X1 controllers.

INNOTRACE was a brand that sold aftermarket controllers for chinese Bafang Ultra M620/G510 mid-drive motors with integrated torque-sensor. Their X1-Controller and X1-Tool were basically a commercialized copy of the VESC-Project. It was tied to a subscription service and overpriced USB-FTDI-cable, which connected via UART to the motor, like the stock Bafang-Controller does. With this package a magic CAN-message is sent, which makes the X1-Controller show up as VESC-CAN-device and accessible.

<br/><br/>

---
## Disclaimer
This is experimental and mostlikely not intended by Innotrace! Functions are limited and you should be very careful with changing unknown parameters! It works with X1-FW 2.4.x.x and 2.5.x.x. Things you can do with this:

* Rotor-Calibration
* Max Current
* Max Wattage

<br/><br/>

---
## Usage
The package is made to be used with VESC-Express, but can run it on any VESC that supports lispBM. The script automatically runs one time at boot, therefore please exactly follow these steps, to prepare your setup correctly:

1. Download the latest VESC-Tool beta from https://vesc-project.com/vesc_tool
2. Connect the CAN-H and CAN-L of the VESC-Express with your X1 motor. (see pinout below)
3. Turn on the battery.
4. Turn on the display. (**Important! Do not skip!**)
5. Plug the VESC-Express into your computer.
6. Connect via VESC-Tool beta.
7. Wait until LED changes from RED to BLUE.
8. Now click "Scan CAN" and click on "X1".
9. There you go!

<br/><br/>

---
## Locate Connector
With Bafang this connector is normally for optional battery communication via UART. On X1, this connector is repurposed and has CAN-Bus accessible from the outside, without opening the motor: [plug_location.png](https://github.com/Tomblarom/vesc_pkg/blob/main/x1_unlocker/plug_location.png)\
[image source: [https://www.greenbikekit.com](https://www.greenbikekit.com)]
<br/><br/>

---
## Pinout Connector
Copied from [@dedo](https://forums.electricbikereview.com/threads/archon-x1-programming-thread-questions-and-experiences.40034/page-16#post-627685). Thanks for providing! [plug_pinout.png](https://github.com/Tomblarom/vesc_pkg/blob/main/x1_unlocker/plug_pinout.png)\
Female: 04R-JWPF-VSLE-S\
Male: 04T-JWPF-VSLE-S

<br/><br/>

---
### Version
- X1-Unlocker v1.0
Binary file added x1_unlocker/plug_location.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added x1_unlocker/plug_pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions x1_unlocker/script.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(gpio-configure 3 'pin-mode-out) ; LED Blue
(gpio-configure 2 'pin-mode-out) ; LED Red

(print "scanning..")
(gpio-write 3 0)
(gpio-write 2 1)

(defun avl nil
(progn
(print "X1 available")
(gpio-write 3 1)
(gpio-write 2 0)
)
)

(conf-set 'can-baud-rate 1)
(can-send-eid 0x00D431FF (list 0x14 0x78 0x00 0x00 0x00 0x00 0x00 0x00))
(if (can-scan) (avl)
(progn
(conf-set 'can-baud-rate 2)
(can-send-eid 0x00D431FF (list 0x14 0x78 0x00 0x00 0x00 0x00 0x00 0x00))
(if (can-scan) (avl)
(progn
(print "not found")
)
)
)
)