An Electric Scooter Community on a Mission to Stamp out Transportation Mediocrity.

Changing mobility one trip at a time.
#19492
Buddasticks wrote:
Wed Jan 29, 2020 11:36 pm
mayaku wrote:
Wed Jan 29, 2020 10:10 am
The OTA Update is finally working!!! :mrgreen: :mrgreen: :mrgreen:
Code: Select all
// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP32CORE_BLE

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_BLUETOOTH_NAME "Your Scooter"
#define REMOTEXY_ACCESS_PASSWORD "password"


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,4,0,0,0,155,0,8,8,1,
  2,0,6,16,22,11,4,26,31,31,
  79,78,0,79,70,70,0,129,0,8,
  8,18,6,16,80,111,119,101,114,0,
  2,0,36,18,18,8,1,26,31,31,
  79,78,0,79,70,70,0,129,0,39,
  10,12,6,16,70,97,115,116,0,3,
  3,13,48,9,25,3,26,129,0,14,
  38,15,6,16,76,105,103,104,116,0,
  129,0,27,49,8,6,16,79,110,0,
  129,0,27,58,9,6,16,79,102,102,
  0,129,0,27,66,24,6,16,66,108,
  105,110,107,105,110,103,0,2,0,7,
  89,14,7,14,26,31,31,79,78,0,
  79,70,70,0,129,0,24,90,28,5,
  16,79,84,65,32,85,112,100,97,116,
  101,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 
  uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ... 
  uint8_t ota_update; // =1 if switch ON and =0 if OFF 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/**
   httpUpdate.ino

    Created on: 27.11.2015

*/

#include <Arduino.h>

#include <WiFi.h>
#include <WiFiMulti.h>
#include <ArduinoOTA.h>
#include <HTTPClient.h>
#include <HTTPUpdate.h>
const char* ssid = "SSID";
const char* password = "PASSWORD";


byte slow[] = {0xA6, 0x12, 0x02, 0x35, 0x14, 0xF1};   // Speed Limit to 20 km/h
byte fast[] = {0xA6, 0x12, 0x02, 0x35, 0xFF, 0x38};   // Maximum Speed
byte off[] = {0xA6, 0x12, 0x02, 0x00, 0xFF, 0xEA};
byte fast_stealth[] = {0xA6, 0x12, 0x02, 0x31, 0xFF, 0x03};
byte fast_blinking[] = {0xA6, 0x12, 0x02, 0x33, 0xFF, 0x92};
byte slow_stealth[] = {0xA6, 0x12, 0x02, 0x31, 0x14, 0xCA};
byte slow_blinking[] = {0xA6, 0x12, 0x02, 0x33, 0x14, 0x5B};

int run_once = 0;

void setup() {
  Serial.begin(9600);
  RemoteXY_Init ();
  
}

void loop() {
    ArduinoOTA.handle();
   if((RemoteXY.ota_update == 1) && (run_once == 0))
   {
    
      Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  ArduinoOTA.setHostname("Your Scooter");

  // No authentication by default
  ArduinoOTA.setPassword((const char *)"password");

  ArduinoOTA.onStart([]() {
    Serial.println("Start");
  });
  ArduinoOTA.onEnd([]() {
    Serial.println("\nEnd");
  });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
    Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
  });
  ArduinoOTA.onError([](ota_error_t error) {
    Serial.printf("Error[%u]: ", error);
    if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
    else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
    else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
    else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
    else if (error == OTA_END_ERROR) Serial.println("End Failed");
  });
  ArduinoOTA.begin();
  Serial.println("Ready");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  run_once = 1;
   }

   
  if((RemoteXY.ota_update == 0) && (run_once == 0))
{

   RemoteXY_Handler ();
  
   if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 0))
   {
    Serial.write(slow, sizeof(slow));    
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 1))
   {
    Serial.write(slow_stealth, sizeof(slow_stealth));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 2))
   {
    Serial.write(slow_blinking, sizeof(slow_blinking));
   }


   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 0))
   {
    Serial.write(fast, sizeof(fast));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 1))
   {
    Serial.write(fast_stealth, sizeof(fast_stealth));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 2))
   {
    Serial.write(fast_blinking, sizeof(fast_blinking));
   }
    
   else
   {
      Serial.write(off, sizeof(off));     
   }
   delay(200);
}
 

}
The ESP32 is connecting to a SSID when turning the OTA switch on. If the specified SSID is not present the ESP32 will reboot. If connected you can upload your sketch through the Arduino IDE over the new port ;)
i get an error while compiling

Sketch uses 1388490 bytes (105%) of program storage space. Maximum is 1310720 bytes.
Global variables use 62020 bytes (18%) of dynamic memory, leaving 265660 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board DOIT ESP32 DEVKIT V1
I just had the same problem but here is the solution:

(F*** Google Drive... I will upload the pic somewhere else...)
Image
Last edited by mayaku on Sun Feb 02, 2020 12:58 pm, edited 2 times in total.
#19503
today I managed to remove part of the protective foam, so below we have photos of the interior of the ESC, I will try to find out which component is short-circuited, I also have the JTAG ports, I don't know, I can give some help to the community with this.
Any ideas where to start looking for the component?

Image
Image
#19504
A while ago I did the same thing you are working on. The four small pins are st-link for a STM32. What happened to me is the STM32 was locked out. Which sucks so I wasn't able to pull the firmware off. It does open up the possibility for writing a new firmware. If you would like to go down that road I can get you the pinout. But it isn't with me. I can get it in a fews days. I have some more information on the subject at https://hackaday.io/project/168667-es-2 ... r-unlocker It is possible that the firmware on yours wasn't lock.
Good Luck
Mr. Spriggs
PTbig wrote:
Sat Feb 01, 2020 1:24 pm
today I managed to remove part of the protective foam, so below we have photos of the interior of the ESC, I will try to find out which component is short-circuited, I also have the JTAG ports, I don't know, I can give some help to the community with this.
Any ideas where to start looking for the component?

Image
Image
#19505
MrSpriggs1 wrote:
Sat Feb 01, 2020 3:12 pm
A while ago I did the same thing you are working on. The four small pins are st-link for a STM32. What happened to me is the STM32 was locked out. Which sucks so I wasn't able to pull the firmware off. It does open up the possibility for writing a new firmware. If you would like to go down that road I can get you the pinout. But it isn't with me. I can get it in a fews days. I have some more information on the subject at https://hackaday.io/project/168667-es-2 ... r-unlocker It is possible that the firmware on yours wasn't lock.
Good Luck
Mr. Spriggs
PTbig wrote:
Sat Feb 01, 2020 1:24 pm
today I managed to remove part of the protective foam, so below we have photos of the interior of the ESC, I will try to find out which component is short-circuited, I also have the JTAG ports, I don't know, I can give some help to the community with this.
Any ideas where to start looking for the component?

Image
Image
firmware already on the m365. but experience suggests communicating with ninebot need to rewrite stm8 (BLE)
#19506
vik sinikov wrote:
Sat Feb 01, 2020 4:11 pm
MrSpriggs1 wrote:
Sat Feb 01, 2020 3:12 pm
A while ago I did the same thing you are working on. The four small pins are st-link for a STM32. What happened to me is the STM32 was locked out. Which sucks so I wasn't able to pull the firmware off. It does open up the possibility for writing a new firmware. If you would like to go down that road I can get you the pinout. But it isn't with me. I can get it in a fews days. I have some more information on the subject at https://hackaday.io/project/168667-es-2 ... r-unlocker It is possible that the firmware on yours wasn't lock.
Good Luck
Mr. Spriggs
PTbig wrote:
Sat Feb 01, 2020 1:24 pm
today I managed to remove part of the protective foam, so below we have photos of the interior of the ESC, I will try to find out which component is short-circuited, I also have the JTAG ports, I don't know, I can give some help to the community with this.
Any ideas where to start looking for the component?

Image
Image
firmware already on the m365. but experience suggests communicating with ninebot need to rewrite stm8 (BLE)
https://electro.club/forum/razborka_pro ... 365?page=6
#19519
mayaku wrote:
Fri Jan 31, 2020 7:56 pm
Buddasticks wrote:
Wed Jan 29, 2020 11:36 pm
mayaku wrote:
Wed Jan 29, 2020 10:10 am
The OTA Update is finally working!!! :mrgreen: :mrgreen: :mrgreen:
Code: Select all
// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP32CORE_BLE

#include <RemoteXY.h>

// RemoteXY connection settings 
#define REMOTEXY_BLUETOOTH_NAME "Your Scooter"
#define REMOTEXY_ACCESS_PASSWORD "password"


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,4,0,0,0,155,0,8,8,1,
  2,0,6,16,22,11,4,26,31,31,
  79,78,0,79,70,70,0,129,0,8,
  8,18,6,16,80,111,119,101,114,0,
  2,0,36,18,18,8,1,26,31,31,
  79,78,0,79,70,70,0,129,0,39,
  10,12,6,16,70,97,115,116,0,3,
  3,13,48,9,25,3,26,129,0,14,
  38,15,6,16,76,105,103,104,116,0,
  129,0,27,49,8,6,16,79,110,0,
  129,0,27,58,9,6,16,79,102,102,
  0,129,0,27,66,24,6,16,66,108,
  105,110,107,105,110,103,0,2,0,7,
  89,14,7,14,26,31,31,79,78,0,
  79,70,70,0,129,0,24,90,28,5,
  16,79,84,65,32,85,112,100,97,116,
  101,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 
  uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ... 
  uint8_t ota_update; // =1 if switch ON and =0 if OFF 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/**
   httpUpdate.ino

    Created on: 27.11.2015

*/

#include <Arduino.h>

#include <WiFi.h>
#include <WiFiMulti.h>
#include <ArduinoOTA.h>
#include <HTTPClient.h>
#include <HTTPUpdate.h>
const char* ssid = "SSID";
const char* password = "PASSWORD";


byte slow[] = {0xA6, 0x12, 0x02, 0x35, 0x14, 0xF1};   // Speed Limit to 20 km/h
byte fast[] = {0xA6, 0x12, 0x02, 0x35, 0xFF, 0x38};   // Maximum Speed
byte off[] = {0xA6, 0x12, 0x02, 0x00, 0xFF, 0xEA};
byte fast_stealth[] = {0xA6, 0x12, 0x02, 0x31, 0xFF, 0x03};
byte fast_blinking[] = {0xA6, 0x12, 0x02, 0x33, 0xFF, 0x92};
byte slow_stealth[] = {0xA6, 0x12, 0x02, 0x31, 0x14, 0xCA};
byte slow_blinking[] = {0xA6, 0x12, 0x02, 0x33, 0x14, 0x5B};

int run_once = 0;

void setup() {
  Serial.begin(9600);
  RemoteXY_Init ();
  
}

void loop() {
    ArduinoOTA.handle();
   if((RemoteXY.ota_update == 1) && (run_once == 0))
   {
    
      Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  ArduinoOTA.setHostname("Your Scooter");

  // No authentication by default
  ArduinoOTA.setPassword((const char *)"password");

  ArduinoOTA.onStart([]() {
    Serial.println("Start");
  });
  ArduinoOTA.onEnd([]() {
    Serial.println("\nEnd");
  });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
    Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
  });
  ArduinoOTA.onError([](ota_error_t error) {
    Serial.printf("Error[%u]: ", error);
    if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
    else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
    else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
    else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
    else if (error == OTA_END_ERROR) Serial.println("End Failed");
  });
  ArduinoOTA.begin();
  Serial.println("Ready");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  run_once = 1;
   }

   
  if((RemoteXY.ota_update == 0) && (run_once == 0))
{

   RemoteXY_Handler ();
  
   if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 0))
   {
    Serial.write(slow, sizeof(slow));    
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 1))
   {
    Serial.write(slow_stealth, sizeof(slow_stealth));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 0) && (RemoteXY.select_1 == 2))
   {
    Serial.write(slow_blinking, sizeof(slow_blinking));
   }


   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 0))
   {
    Serial.write(fast, sizeof(fast));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 1))
   {
    Serial.write(fast_stealth, sizeof(fast_stealth));
   }

   else if((RemoteXY.switch_1 == 1) && (RemoteXY.speed_switch == 1) && (RemoteXY.select_1 == 2))
   {
    Serial.write(fast_blinking, sizeof(fast_blinking));
   }
    
   else
   {
      Serial.write(off, sizeof(off));     
   }
   delay(200);
}
 

}
The ESP32 is connecting to a SSID when turning the OTA switch on. If the specified SSID is not present the ESP32 will reboot. If connected you can upload your sketch through the Arduino IDE over the new port ;)
i get an error while compiling

Sketch uses 1388490 bytes (105%) of program storage space. Maximum is 1310720 bytes.
Global variables use 62020 bytes (18%) of dynamic memory, leaving 265660 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board DOIT ESP32 DEVKIT V1
I just had the same problem but here is the solution:

(F*** Google Drive... I will upload the pic somewhere else...)
Image


Thanks for the pic .. got it uploaded but it does not turn on the scooter
#19523
Hello, I have read the whole discussion, but I have some doubts, I use a translator to read and I may have missed it, I have a jump es200b, and I want to turn it on, I still have not done anything because I never touched Arduino and I want to have it more or less clear, the issue of turning off the skate when parked a few hours is resolved with the converter to power the Arduino or that is something else is that I do not know
#19539
p_humanes wrote:
Mon Feb 03, 2020 5:58 am
Hello, I have read the whole discussion, but I have some doubts, I use a translator to read and I may have missed it, I have a jump es200b, and I want to turn it on, I still have not done anything because I never touched Arduino and I want to have it more or less clear, the issue of turning off the skate when parked a few hours is resolved with the converter to power the Arduino or that is something else is that I do not know

you do not got there. you need to shop and then there Buder socket which then have to stick it and then go
  • 1
  • 59
  • 60
  • 61
  • 62
  • 63
  • 80
LIME 3.GEN PERSONAL.....

Hi alecxs, the main Version from Emile ist runni[…]

No they's no gps in the big , removable battery yo[…]

As this was a rental version whos overstock was […]

Any one got any info on beryl bikes I seen a few[…]