Skip to content
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

Esp32 DevKit v1 - Autodetect.ino and hoverboard 2.1.1 master Uart.bin #74

Open
Dim4ik1992 opened this issue Mar 12, 2024 · 41 comments
Open

Comments

@Dim4ik1992
Copy link

Dim4ik1992 commented Mar 12, 2024

I'm using Esp32 DevKit v1 -
Autodetect.ino

and hoverboard 2.1.1 master Uart.bin

but when connected to UART I learn a bunch

z pͫz pͫz Jͫz (z pͫz pͫz Jͫz (z pͫz pͫz Jͫz (

Is it possible to connect PWM with these boards? I'm interested in the possibility of controlling forward backward directly from the RC remote control
Снимок
photo_2024-03-12_14-55-51
photo_2024-03-12_14-56-15

photo_2024-03-12_14-58-30
photo_2024-03-12_14-58-32

@RoboDurden
Copy link
Owner

If you have a 2.1.1 board you do not need autodetect.
First flash 2.1.1.dummy and see the motors spinning.
Then remoteUart and the testSpeed.ino

If you have an EspressLRS compatible rc receiver check this #26

Otherwise you will need an Arduino/Esp to receive pwm or ppm input.

@AILIFE4798
Copy link

your baud rate is probably wrong
you will need to figure it out sooner or later no matter if you trace the board manually or use auto detect
or you would not be able to control the board

it WOULD be possible to support pwm input directly, if the mcu have a pin with timer input, but we will NOT do it, you can add it your self all the code is open source

@RoboDurden
Copy link
Owner

He indeed go a 2.1.1 board.
He is simply using the wrong .ino

@AILIFE4798
Copy link

oh he using master uart with autodetect on esp

@RoboDurden
Copy link
Owner

@AILIFE4798
Copy link

you can ask @reed-dan to add pwm/ppm support to his newer and better esp control software

@Dim4ik1992
Copy link
Author

this is what I got but the engine is standing still
https://youtu.be/DsELgWZ_OAg

@RoboDurden
Copy link
Owner

Hall sensors are okay, I see iOdom change value when you rotate motor.

Please test the remoteDummy binary.
This will not output serial data but motor should spin.

Maybe the 2.1.1 binaries are too old.
It might help if you have Keil installed and compile 2.1.1 yourself.

@Dim4ik1992
Copy link
Author

video_2024-03-12_19-58-40.mp4

@RoboDurden
Copy link
Owner

Sorry I will answer tomorrow.

@Dim4ik1992
Copy link
Author

I installed Keil but I don't know how to compile 2.1.1 myself.

the default is

// LAYOUT_2_X is used in defines.h
#ifdef GD32F130 // TARGET = 1
#define LAYOUT 13
#define LAYOUT_SUB 0 // Layout 6 exits as 2.6.0 and 2.6.1
#elif GD32F103 // TARGET = 2
#define LAYOUT 1
#elif GD32E230 // TARGET = 3
#define LAYOUT 1
#elif MM32SPIN05 // TARGET = 4
#define LAYOUT 1
#endif

@Dim4ik1992
Copy link
Author

there are a bunch of boards on the service, different on different chips, both new and old, but no one knows how to flash them, this is a real breakthrough thanks to you)

@reed-dan
Copy link

you can ask @reed-dan to add pwm/ppm support to his newer and better esp control software

I currently support serial commands and adc potentiometer, it is designed so you can add any input method you would like though. I am working on wifi ap/tac with a webbased controller at this time hopefully it will be complete in the next few days. PWM is definately on my list just haven't gotten there yet.

Please proceed with caution as I haven't tested everything out.

https://github.com/reed-dan/hoverboard_hack_esp32_manualspeed/blob/beta/ManualSpeed_Improved.ino

@RoboDurden
Copy link
Owner

Select gd32f130 as target in the top left drop down list of Keil ide.

And change #define LAYOUT 13
to #define LAYOUT 1

Then f7
Then F8

@RoboDurden
Copy link
Owner

@Dim4ik1992 if you support the Russian war against Ukraine, please do NOT ask me to support you.

@Dim4ik1992
Copy link
Author

@Dim4ik1992 if you support the Russian war against Ukraine, please do NOT ask me to support you.

I don't support war!!! let's not talk about politics

@Dim4ik1992
Copy link
Author

https://youtu.be/CCCWToCRJsM
TestSpeed.ino and ManualSpeed_Improved.ino
The result is the same

@RoboDurden
Copy link
Owner

Now the three led flash according to motor rotation.
I don't know why motor is not spinning.

Activate remoteDummy here https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x-GD32/blob/0cfd2716866bae62987bb81a4427e7b3fb6dde70/HoverBoardGigaDevice/Inc/config.h#L43

You will not have serial output anymore but motor should spin without esp32.

@Dim4ik1992
Copy link
Author

video_2024-03-13_15-34-28.mp4

@RoboDurden
Copy link
Owner

Please post screenshots and code and a detailed description of what you have done or changed.
I can not watch all your videos.

@Dim4ik1992
Copy link
Author

Dim4ik1992 commented Mar 13, 2024

Now in this mode the wheel is spinning```


// LAYOUT_2_X is used in defines.h
#ifdef GD32F130		// TARGET = 1
	#define LAYOUT 1
	#define LAYOUT_SUB 0	// Layout 6 exisits as 2.6.0 and 2.6.1

	#define REMOTE_DUMMY
	//#define REMOTE_UART
	//#define REMOTE_UARTBUS	// ESP32 as master and multiple boards as multiple slaves ESP.tx-Hovers.rx and ESP.rx-Hovers.tx
	//#define REMOTE_CRSF		// https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/issues/26
That's all I changed. the rest is unchanged

@Dim4ik1992
Copy link
Author

when it was like this it displayed debugging in the UART but the wheel stood still

//#define REMOTE_DUMMY
#define REMOTE_UART
//#define REMOTE_UARTBUS // ESP32 as master and multiple boards as multiple slaves ESP.tx-Hovers.rx and ESP.rx-Hovers.tx
//#define REMOTE_CRSF // #26

@RoboDurden
Copy link
Owner

Okay, so the esp32 communication is the problem.
Try RemoteUartBus instead of RemoteUart.
You will also have to uncomment/activate RemoteUartBus in the Arduino code.

If you then still get log data from hoverboard this is proof that hoverboard has successfully received commands from esp32.

@Dim4ik1992
Copy link
Author

Dim4ik1992 commented Mar 13, 2024

I don't understand why when I'm in .\Inc\config.h
#define REMOTE_UARTBUS
in the file .\Src\remoteUartBus.c
lines are not active
#ifdef REMOTE_UARTBUS

12
123

and now he shows a cross on every library

1234

maybe there was an error in this, due to incorrect characters in the file path, moved the project to C:\Hoverboard-Firmware-Hack-Gen2.x-GD32-\HoverBoardGigaDevice
and everything became normal) I’ll try now

@AILIFE4798
Copy link

please check wiki pages first

@Dim4ik1992
Copy link
Author

Dim4ik1992 commented Mar 19, 2024

I think that on my version of the board the bluetooth module is interfering... it most likely sits on TX, because when I uploaded the Kickstarter version, I also could not connect to the uart remote, but I was very surprised when I uploaded the firmware to the additional board, which is without bluetooth and I was able to connect to it via uart (TTL)
IMG_20240318_224403

@AILIFE4798
Copy link

yes bluetooth module need to me removed, as ive already clearly stated in the wiki page, which nobody reads before asking stupid questions
image

@AILIFE4798
Copy link

if you do not want to remove the bluetooth module then use the comms masterslave connector like i sugested

@RoboDurden
Copy link
Owner

This firmware here is a fork of a fork!
The original firmware did contain Bluetooth communication.
But I was never able to test that.
So I removed the code when I was restricting the communication code to RemoteXy.

If you have a 2.1.1 board which is the original 2.0 in the original fork, you might be able to flash the original firmware and get the Bluetooth module working .
You might then be able to port that code to a RemoteBluetooth.c here.

But not many of the new layouts have a Bluetooth module and they might connect and work differently.

If the Bluetooth module indeed also connects to PB6 pb7, and interferes with esp32 communication,
You might need to use the RemoteUartBus protocol which connects booths board via pa2 pa3 master slave serial port.

@RoboDurden
Copy link
Owner

@hiliving , try autoflash.bat

And read the wiki pages.

@AILIFE4798
Copy link

on new board the bluetooth module is another microcontroller designed for bluetooth speaker and communicate through 1wire or softwsre serial, but you need the special app on android to generate the serial command because it identify as a speaker so it is not very easy to use, better use esp32 as a bluetooth module which would soon be supported by reed

@RoboDurden
Copy link
Owner

Sorry @AILIFE4798 , I should empty the read.me to force people go to wiki.

Will do that when i am back from my current outdoor trip.

@hiliving
Copy link

please check wiki pages first

thx very

@hiliving
Copy link

@hiliving , try autoflash.bat

And read the wiki pages.

Solved it, so Excellent project ,thx very much.

@MathMyne
Copy link

Hello, we are currently working on a project using hoverboard hardware, and we encountered some difficulties following your tutorial.
We flashed the 2.1.1 hoverboard card with “hoverboard 2.1.1 slave.bin” and hoverboard “2.1.1 master Dummy.bin” for the two cards and it works well.
We want to use an ESP32 WROOM to handle the hoverboard card. We flashed the master with “hoverboard 2.1.1 master Uart.bin” and connected the ESP32 with RX and TX according to the schematics and loaded the testSpeed.ino code.
It shows this error and we are blocked:
Capture_decran_2024-05-16_a_11 40 51
Pictures of the wiring:
20240516_115419
20240516_115445
Thanks in advance for your help.

@I-hate-2FA
Copy link

You need to use uartbus.bin

@RoboDurden
Copy link
Owner

RoboDurden commented May 16, 2024

No you can use Master_RemoteUart

But you have to comment //#define REMOTE_UARTBUS // one serial bus to control them all :-)

I have updated the hoverboard 2.1.1 master Uart.bin , maybe that old binary had some old protocol.
I also added hoverboard 2.1.1 master UartBus id0.bin and hoverboard 2.1.1 master UartBus id1.bin that With you can also try.
A 4-wheeler that way would have two masters controlled with UartBus that in turn control their slaves..

@MathMyne
Copy link

Hello, thanks for your response, we tried to put in comment the line “#define REMOTE_UARTBUS // one serial bus to control them all :-)” in your code TestSpeed, but there are some issues.
image
Also when we uncomment the precedent line and look at the serial port, the iDom changes when I turn the wheel. And it seems that the CD, AB and FFFF are :
image

@I-hate-2FA
Copy link

just use the uartbus firmware on hoverboard and leave esp code untouched
i have had same problem before

@RoboDurden
Copy link
Owner

Yes, old RemoteUart protocol was broken because of MM32 additions.
I have updated TestSpeed.ino .
This compiles now:

#define _DEBUG      // debug output to first hardware serial port
//#define DEBUG_RX    // additional hoverboard-rx debug output
#define ESP32       // comment out if using Arduino
// #define HOVERBOARD_MM32  // uncomment if a MM32 Hoverboard firmware is connected (and no GD32 or STM32)
//#define REMOTE_UARTBUS  // one serial bus to control them all :-)

@MathMyne
Copy link

Thank you, it works well !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants