New free Open Source Firmware for Xiaomi M365 Scooter available

djuke said:
for the dual motor drive line
I guess you better go with v2 then, it's prepared for multicontroller mode, as far as I know.

djuke said:
DownG connected to my BLE but complains that it could not get scooter information.
Hm, strange. Strange, I don't know if there are dashboard versions, that are not compatible with DownG

djuke said:
Is there another way to update the firmware?
Of course you can also flash the hex file that is generated with the method 2 described in the Readme of the repo by a STLink. For use of the CubeIDE you have to go with the branch v0.5. The master branch is for use with Visual Studio Code.

regards
stancecoke
 
Thanks, I will give v2 a try. The master branch with Visual Studio Code would be great. Btw, after flashing v2 with Stlink is there any chance to flash some original firmware again as I guess the bootloader will also be overwritten?

Is the UART protocol between ESC and display described somewhere?
 
djuke said:
Btw, after flashing v2 with Stlink is there any chance to flash some original firmware again as I guess the bootloader will also be overwritten

Yes, see here:
https://github.com/CamiAlfa/M365_DRV_STLINK

djuke said:
Is the UART protocol between ESC and display described somewhere?

Yes, there are several sources on the internet. Or just look at the code of v3
https://github.com/Koxx3/SmartESC_STM32_v3/blob/master/Core/Src/M365_Dashboard.c

V3 master uses Visual Studio Code, V2 master uses CubeIDE.

regards
stancecoke
 
Short update, I cloned the v2 repo, unfortunately could not build it due to some error (task_led.h not found). I was able to flash a released binary though on the ESC. Next thing would be to connect VESC tool, but need to order some JST PA connects first.
 
Just tried this firmware on a pro 2 scooter with the new controller, (maybe shouldn't have done that) and it is working great!
I love the improved torque at higher speeds. I ran in to a problem though when I wanted to flash a updated version with some more current. just as djuke wrote the DownG app connects to my BLE but can not get scooter information. It worked great the first time I flashed the firmware but now I'm stuck, can't flash any other firmware either. Is there any way to solve this other than flashing original firmware with STLink?
 
brolle96 said:
just as djuke wrote the DownG app connects to my BLE but can not get scooter information.

Hm, strange. I just downloaded your build_1 and build_2 versions and was able to flash them via downG one after the other.
Can you post a screenshot from your downG app, when it fails? See my screen after the successful OTA update.

Sometimes downG fails to connect, showing a countdown to press the scooter button. But after a few attempts (even without pressing the button) the app connects properly and shows the scooter information.

regards
stancecoke

Screenshot_20220306_145609.jpg
 
Thanks for your reply! As you can se in the screenshot it says that the scooter is connected and ready but gives me an error that it can't get scooter info when I try to press "OPEN BIN"

I can also mention a few more things that might be related to this:

- Headlight dos not turn on when pressing the power button.
- Unable to pair to scoterhacking app, it asks that I press the power button but does not pair when I press the button.

ST Link adapter is on order so I'll get it fixed one way or the other :)

Screenshot_20220306-184626_downG.jpg
 
stancecoke said:
brolle96 said:
it can't get scooter info

Ok, that seems to be a matter of the dashboard firmware version...

Yes that seams reasonable, do you happen to know what dashboard firmware version is compatible?
From your screenshot I can se that it says that your BLE version is 0 ?

I don't have the original BMS connected, if that makes a difference.
 
brolle96 said:
stancecoke said:
brolle96 said:
it can't get scooter info

Ok, that seems to be a matter of the dashboard firmware version...

Yes that seams reasonable, do you happen to know what dashboard firmware version is compatible?
From your screenshot I can se that it says that your BLE version is 0 ?

I don't have the original BMS connected, if that makes a difference.


I thought I would share some info regarding the dashboard versions, maybe it will be useful for the developers if it isn't already known.

As far as I have found there are 3 different versions of the dashboard or BLE as it is referred to. One without the display, that's the version in the original M365 scooter.

The dashboard with the display has 2 different version as you can se in the pictures below. The easy way to tell them apart is in how they show the mode select, the older dashboard from the PRO 1 scooter has "ECO" as the slowest mode. The newer dashboard the can be found in the PRO 2, 1s and Essential Xiaomi scooters instead has a picture of a person walking.

It apers also that all these dashboards run different firmware and are not compatible with each other as can be seen in the last picture (taken from a Spanish site: https://mp365.es/recursos/centro-de-descargas-de-firmwares-ble-drv-y-bms-para-m365-y-pro/ )

In theory then one should be able to connect one of the older dashboards to the new scooters and make it compatible with this awesome open source firmware.

61375c19ed14b.jpeg
61375a4fb0de1.jpeg
Untitled.png
 
brolle96 said:
I thought I would share some info regarding the dashboard versions

I just flashed my contoller to an original version to get the BLE-Version:

Screenshot_20220307_190008.jpg

So with BLE version 122 the OTA update works properly.
I guess it would be no big problem, to make our firmware compatible to other dashboard versions, we just would need to sniff the communication on the different original dashboard, then we could emulate this communication. That's the same procedure, like we did on the BLE 122 version.

regards
stancecoke
 
stancecoke said:
brolle96 said:
I thought I would share some info regarding the dashboard versions

I guess it would be no big problem, to make our firmware compatible to other dashboard versions, we just would need to sniff the communication on the different original dashboard, then we could emulate this communication. That's the same procedure, like we did on the BLE 122 version.


I don't have any experience making firmwares or much of any coding but I would be happy to help if there is anything I can do for the project.

Am I right in that the BLE uses UART protocol to communicate with controller?
I have a raspberry pi that can interface with UART, maybe that could be used to sniff the communication with the BLE?
I guess I would ned to log the commands and associate them with button presses and other interactions?
 
brolle96 said:
I have a raspberry pi that can interface with UART
No need for a rasp, you only need a simple USB-UART converter.

Then you can log the communication with your laptop, using a terminal program like HTerm.

Just connect Rx and GND of the converter to dataline and the GND of the Dashboard and connect the terminal at 115200 BAUD.

If it's easier, you can connect the Rx line at the controller instead of the dashboard, of course.

regards
stancecoke

Dashboard pinout.PNG
 
stancecoke said:
brolle96 said:
I have a raspberry pi that can interface with UART
No need for a rasp, you only need a simple USB-UART converter.

Then you can log the communication with your laptop, using a terminal program like HTerm.

Blew up two mosfets last week :/ Waiting for replacements but it's going to take a month... When they arrive I'll try to sniff the UART communication.
 
stancecoke said:
brolle96 said:
I have a raspberry pi that can interface with UART
No need for a rasp, you only need a simple USB-UART converter.

Then you can log the communication with your laptop, using a terminal program like HTerm.

Just connect Rx and GND of the converter to dataline and the GND of the Dashboard and connect the terminal at 115200 BAUD.

If it's easier, you can connect the Rx line at the controller instead of the dashboard, of course.

regards
stancecoke

Dashboard pinout.PNG


I'm still waiting on those mosfets but my controller does boot without errors on some occasions.

So I did manage to get a log from it but I can't really make any sense of it, I'm a bit outside my comfort zone...
I did spinn the wheel, toggle the headlight and change modes during the logging process. Throttle and break was already working since before.

The log was taken from CuteCom, both as the log file that it creates by itself and a text file that I created and copied the log directly from the output window in CuteCom.

I hope this can be useful for the development, If there is some other data that is needed I would be happy to give it another try.

I wan't able to attach the files directly to the post so here is a google drive link: https://drive.google.com/drive/folders/1a4paxtrFLIpjcLNp3_4uhckjds2doN9r?usp=sharing
 
Thank you for the feedback :thumb: . I would have to write a little python script to extract the single messages from the byte stream. Let's see when I find some time!

regards
stancecoce
 
I have issue to run v3 on easy DIY hardware (https://endless-sphere.com/forums/viewtopic.php?f=7&t=114537) but I can run the example of EBiCS_motor_FOC, which is based on your work, can be treated as a simplified v3 version. I would like to know if there is any APP or PC based software can talk directly via uart, send even simple command (start/stop/throttle position if possible), and pick up some data from the board like V/I etc, because this hardware has no dashboard connected.
 
flute2k3@hotmail.com said:
I have issue to run v3 on easy DIY hardware (https://endless-sphere.com/forums/viewtopic.php?f=7&t=114537) but I can run the example of EBiCS_motor_FOC, which is based on your work, can be treated as a simplified v3 version. I would like to know if there is any APP or PC based software can talk directly via uart, send even simple command (start/stop/throttle position if possible), and pick up some data from the board like V/I etc, because this hardware has no dashboard connected.
V3 is for M365 only and on M365 there are no such things you are asking, even because they would take space that is very limited on M365.

The best way to use V3 is to use the M365 throttle and brake.

To pickup data, you need to have knowledge to develop the firmware, as you can see, there are in the firmware tools to be enabled for send that data to UART. The app I use on PC is the "serialplot".
 
Hello,

I'm very interested in this and read the full thread.
But is there a G30D port still in progress? Beside the uC pins the Ninebot serial protocol is different from the Xiaomi.
And are there any informations beside this thread? Forum, Telegramm, Discord,... ?
Thanks!
Dirk
 
dirk.abel said:
But is there a G30D port still in progress?
not for V3. But the G30 is supported by V2
https://github.com/Koxx3/SmartESC_STM32_v2/tree/vesc_comp/g30p

There is a user help group for v2 on telegram.
https://t.me/+5ZUGjIWBmHg1ZDhk

regards
stancecoke
 
Thank You, I'll take a look.
Found the Telegramm Group Yesterday by myself and read AL messages back to end of janurary (was not possible to go further Info the past).
It looks very "special" by fumble the ST Controller sw into the VESC IDE and use, ignore and abuse the different Parameters.
Will take a look at the v3.
There should bei an own thread for the v3 here?
 
dirk.abel said:
There should be an own thread for the v3 here?

This thread focusses on v3, but there is some more information spread over various threads.
I'm no longer working on v3, Casainho has done the last work on the master at github. His idea is to have "microcosmos" of cheap DIY hardware for controller and display with an universal usable free FOC core for the firmware.

I am currently focusing on the original EBiCS project for Lishui controllers again.

So I think there is no one willing to port the v3 to the G30 pinout and protocol actually. It seem not to be too hard to do it, but would take several hours even for an experienced developer.

regards
stancecoke

G30 vs M365.png
 
stancecoke said:
It seem not to be too hard to do it, but would take several hours even for an experienced developer.
Much more then that!! You are an experienced developer but that is not enough!

What is needed is experienced developer that uses the scooter (so has real hardware to test), that takes value from it (so keep the interest on the project), and that will then be willing to maintain the project, not only doing the initial work.

I use a M365 several times a week. I also bought another M365 specifically to use on the development tests!!

But recently my priority shifted to the new EBike I am building with M500 mid drive motor.

Well, just today I received the OpenLog small device that I will connect to the M365 to record logs of system data, as next step I need to evaluate in realtime the system, as currently is not good, something seems wrong...
 
Hi,

I'm not looking for someone, who did it for me!
I only want to know if it is already done, before I start by myself and If the given HW is ok.

But first, i will test the 75100 to check, what it is possible.
And maybee, it will end in a smal additional HW which translates beetween VESC, Smart BMS, Dashboard and... Backlight.
 
Here is the logger (has a uSDCard on the back) that I will connect to the M365 to record logs of system data, to help me develop further:

 
Back
Top