add command documentation

This commit is contained in:
interfisch 2024-07-14 10:34:29 +02:00
parent e11ec8c5f5
commit b2245f83f6
2 changed files with 83 additions and 23 deletions

View File

@ -0,0 +1,60 @@
# Bobbycar Controller
## Serial Commands
If Vusb jumper on PCB is soldered, do not connect USB while LiPo is connected!
**echo off**
Turn off serial command echo.
Useful for automated transfer.
**echo on**
Turns on serial command echo.
Useful for manual command execution.
**test**
Returns "OK"
**ls**
List files on SD card in a machine readable way.
One file per line with full path.
**la -a**
List files tab formatted. With file sizes.
**cat FILENAME**
Print out the contents of a specified file.
If no filename given, the current active logfile is used.
**get FILENAME**
Sends the contents of a specified file in chunks.
Waits for the checksum of the send chunks before sending the next chunk.
Exits with an error message when checksum does not match.
Used for automated transfer of files.
**sizeof FILENAME**
Returns the size in bytes of the specified file.
**chunksize SIZE**
Sets the size of chunks for file transmission. See **get** command.
Default is 128.
**rm FILENAME**
Deletes file from sd card.
**log off**
Turns off logging flag.
**log on**
Turns on logging flag.
**show stats**
Prints some current stats values.
One variable per line.
Format: parametername<Tab>value
**show sensors**
Prints some sensor values that are useful in standstill.
One variable per line.
Format: parametername<Tab>value

View File

@ -356,30 +356,30 @@ void serialCommandLoop(unsigned long loopmillis,ESCSerialComm& escFront, ESCSeri
writeLogComment(loopmillis, "Datalogging enabled by serial command");
Serial.print("Log enabled: "); Serial.println(datalogging_filename);
}else if(smessage.equals("show stats")) {
Serial.print("overallTrip="); Serial.println(overallTrip);
Serial.print("overallCurrentConsumed="); Serial.println(overallCurrentConsumed);
Serial.print("overallWatthoursConsumed="); Serial.println(overallWatthoursConsumed);
Serial.print("voltage="); Serial.println(getBatteryVoltage(escFront,escRear));
Serial.print("overallTrip\t"); Serial.println(overallTrip);
Serial.print("overallCurrentConsumed\t"); Serial.println(overallCurrentConsumed);
Serial.print("overallWatthoursConsumed\t"); Serial.println(overallWatthoursConsumed);
Serial.print("voltage\t"); Serial.println(getBatteryVoltage(escFront,escRear));
}else if(smessage.equals("show sensors")) {
Serial.print("loopmillis(s) \t"); Serial.println(loopmillis/1000.0,3);
Serial.print("temp_ESCFront \t"); Serial.println(escFront.getFeedback_boardTemp());
Serial.print("temp_ESCRear \t"); Serial.println(escRear.getFeedback_boardTemp());
Serial.print("vbat_Front \t"); Serial.println(escFront.getFeedback_batVoltage());
Serial.print("vbat_Rear \t"); Serial.println(escRear.getFeedback_batVoltage());
Serial.print("throttle \t"); Serial.println(throttle_pos);
Serial.print("brake \t"); Serial.println(brake_pos);
Serial.print("trip_Front \t"); Serial.println(escFront.getTrip());
Serial.print("trip_Rear \t"); Serial.println(escRear.getTrip());
Serial.print("trip \t"); Serial.println(trip);
Serial.print("currentConsumed_Front \t"); Serial.println(escFront.getCurrentConsumed(),3);
Serial.print("currentConsumed_Rear \t"); Serial.println(escRear.getCurrentConsumed(),3);
Serial.print("currentConsumed \t"); Serial.println(currentConsumed,3);
Serial.print("watthoursConsumed \t"); Serial.println(watthoursConsumed,3);
Serial.print("temp_Front \t"); Serial.println(temp_ESCFront,3);
Serial.print("temp_Rear \t"); Serial.println(temp_ESCRear,3);
Serial.print("temp_Air \t"); Serial.println(temp_Air,3);
Serial.print("looptime_duration_min \t"); Serial.println(looptime_duration_min);
Serial.print("looptime_duration_max \t"); Serial.println(looptime_duration_max);
Serial.print("loopmillis\t"); Serial.println(loopmillis);
Serial.print("temp_ESCFront\t"); Serial.println(escFront.getFeedback_boardTemp());
Serial.print("temp_ESCRear\t"); Serial.println(escRear.getFeedback_boardTemp());
Serial.print("vbat_Front\t"); Serial.println(escFront.getFeedback_batVoltage());
Serial.print("vbat_Rear\t"); Serial.println(escRear.getFeedback_batVoltage());
Serial.print("throttle\t"); Serial.println(throttle_pos);
Serial.print("brake\t"); Serial.println(brake_pos);
Serial.print("trip_Front\t"); Serial.println(escFront.getTrip());
Serial.print("trip_Rear\t"); Serial.println(escRear.getTrip());
Serial.print("trip\t"); Serial.println(trip);
Serial.print("currentConsumed_Front\t"); Serial.println(escFront.getCurrentConsumed(),3);
Serial.print("currentConsumed_Rear\t"); Serial.println(escRear.getCurrentConsumed(),3);
Serial.print("currentConsumed\t"); Serial.println(currentConsumed,3);
Serial.print("watthoursConsumed\t"); Serial.println(watthoursConsumed,3);
Serial.print("temp_Front\t"); Serial.println(temp_ESCFront,3);
Serial.print("temp_Rear\t"); Serial.println(temp_ESCRear,3);
Serial.print("temp_Air\t"); Serial.println(temp_Air,3);
Serial.print("looptime_duration_min\t"); Serial.println(looptime_duration_min);
Serial.print("looptime_duration_max\t"); Serial.println(looptime_duration_max);
}
message_pos = 0;