Koxx3 / SmartESC_STM32_v2

M365_MC_WB
115 stars 41 forks source link

SmartESC

SmartESC (aka SESC) is an alternative firmware for Xiaomi M365 and Ninebot G30 controller.

image

Overview

Avantage over other Xiaomi custom firmwares :

Cons :

It can interface :

Nota : this firmware is in beta.

You'll be able to setup and control the controller/motor from VESCTool interface with a simple USB/Serial adapter. With any small arduino, use analog acceleration/brake throttles to control any electic moving device like escooter, gokart, electric skateboard without using the stock display.

Download

Download the latest build for M365 : Package Control total downloads

Build

Last automatic build status : Build on commit

If you want to build it manually, for an easier build, you need git and docker.

Clone the project

git clone https://github.com/Koxx3/SmartESC_STM32_v2.git

Build on Linux

Launch from terminal:

chmod +x docker_build*; ./docker_build_m365.sh

chmod +x docker_build*; ./docker_build_g30.sh

Build on Windows

Double click :

docker_build_m365.sh

docker_build_g30.sh

Programming

You need a ST-Link device to reprogram the M365/G3O controller. It costs 3/4€ on Aliexpress.

Plug the st-link following this schematic : image

With STM32 ST-Link Utility, disable Re&d out protection.

Menu "Target" => "Option bytes" image

VescTool

Use VescTool to setup the motor and input properties.

Use a serial USB adapter to connect the Xiaomi controller as an USB VESC : image

Launch VESCTool and connect with COM port. image

Launcher Motor setup wizzard. image

Enter all your settings in the different windows.

Enable the keyboard control :

image

You're ready to test your M365 controller with your keyboard !

ESP32 test module

M365 connections : image

Use ESP32 prototype board with and ESP32-devkit-c module : image

Use the code provided in the serial-trottle-brake-esp32 folder with Platform.io

Error Code SESC (Smart ESC) in VESC Tool

Can read it in "VESC Terminal" (or others Serial Terminal)

Command available in VESCTool terminal