I tried to get the ES200 unlock code from git running but the scooter never powered up.
) because the output on the serial monitor for the ESP32 never was the same as with my working Nano V3.
The code is very simple but convirmed working for an ES100D from Voi and an ESP32
Code: Select all/*
-- New project --
This source code of graphical user interface
has been generated automatically by RemoteXY editor.
To compile this code using RemoteXY library 2.4.3 or later version
download by link http://remotexy.com/en/library/
To connect using RemoteXY mobile app by link http://remotexy.com/en/download/
- for ANDROID 4.3.1 or later version;
- for iOS 1.3.5 or later version;
This source code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
*/
//////////////////////////////////////////////
// RemoteXY include library //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__ESP32CORE_BLE
#include <RemoteXY.h>
// RemoteXY connection settings
#define REMOTEXY_BLUETOOTH_NAME "My_Scooter" // The name you see the Scooter in the RemoteXY app
#define REMOTEXY_ACCESS_PASSWORD "password" // Put here the password to access the Scooter
// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
{ 255,2,0,0,0,49,0,8,8,1,
2,0,17,20,33,13,4,26,31,31,
79,78,0,79,70,70,0,129,0,37,
53,12,6,16,70,97,115,116,0,2,
0,10,50,22,11,1,26,31,31,79,
78,0,79,70,70,0 };
// this structure defines all the variables of your control interface
struct {
// input variable
uint8_t switch_1; // =1 if switch ON and =0 if OFF
uint8_t speed_switch; // =1 if switch ON and =0 if OFF
// other variable
uint8_t connect_flag; // =1 if wire connected, else =0
} RemoteXY;
#pragma pack(pop)
/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////
#include <Arduino.h>
////////////////////////////////////////////
// Scooter Command include //
///////////////////////////////////////////
byte slow[] = {0xA6, 0x12, 0x02, 0x65, 0x14, 0x86}; // Speed Limit to 20 km/h
byte fast[] = {0xA6, 0x12, 0x02, 0x35, 0xFF, 0x38}; // Maximum Speed
byte off[] = {0xA6, 0x12, 0x02, 0x00, 0xFF, 0xEA};
void setup()
{
RemoteXY_Init ();
Serial.begin(9600);
}
void loop()
{
RemoteXY_Handler ();
if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0))
{
Serial.write(slow, sizeof(slow));
}
else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1))
{
Serial.write(fast, sizeof(fast));
}
else
{
Serial.write(off, sizeof(off));
}
delay(200);
}
The delay at the end is necessary because otherwise the serial output is written too fast and the scooter won't start
The wiring is the same as for the Nano V3.