For the complete documentation index, see llms.txt. This page is also available as Markdown.
Firmware Reference
A look at A0's preloaded firmware "ESP32RET"
Introduction to ESP32RET
What is ESP32RET?
ESP32RET is the name of the firmware that comes pre-loaded on your new Macchina A0. ESP32RET stands for ESP32 (based) Reverse Engineering Tool and provides two primary functionalities*: ELM327 emulation for use with apps like Torque, and Wi-Fi based connection to SavvyCAN.
*These functionalities are current as of version 0.1, however future versions may have expanded features.
Note: there was a previous version called A0RET that you might still see references to in code, documentation, etc.
ELM327 Emulation, Explained Extra Efficiently
Why would you want to emulate an ELM327 device? ELM327 is a closed-source black box interpreter chip (a PIC with some firmware) and you'd much rather know exactly what is being sent to and from your car, right?
Another answer is that now you can take advantage of the numerous existing, (semi) working and tested applications out there for every platform.
SavvyCAN
A Super Powerful CAN bus reverse engineering and capture tool written by Collin Kidder. Wireless Car Hacking!
LED Color Codes
RED - Not connected (In WIFIMODE=2 you are creating an AP with the A0, so it will go green immediately because you're the AP)
Green - Ready to connect to application
Blue - Connected to application
Purple - Update mode
Smartphone apps
A0 should be compatible with any ELM327 based app.
Android - Torque Lite can be found at the link below:
iOS - Software version 14 of iOS breaks support for A0. We are working to regain iOS support. For those interested in testing on 13 or older make sure your app settings are:
Visit this page for an extensive list of software compatible with ELM327, and by extension ESP32RET.
A0 System Menu
Many low level configurations can be done via a Serial Terminal (Real-Term, Tera Term, Arduino Serial Monitor, etc). This includes turning ON and OFF WIFI and Bluetooth, setting CAN speed, and setting the WIFI password.
Here is the system menu:
To enter A0 System Menu using the Arduino IDE Serial Monitor, follow these steps:
If you don't already have the Arduino IDE installed, download and install the Arduino IDE from here.
Connect A0 to your computer with a USB cable (A0's LED should turn green)
Open Arduino IDE.
Select the port (port numbers change frequently, your port number will likely be different than the one pictured).
Open an Arduino Serial Monitor: (button in the upper right corner)
Set your baud rate to 1000000 if it is not already
Send a question mark (?) to open the Menu
On the left is the current setting. On the right in parentheses are the options. For example, BTmode=0 means Bluetooth is currently off. Send "BTmode=1" in the top line to turn it on. Send another ? to make sure the change was made.
Re-Flashing ESP32RET
ESP32RET is the firmware shipped pre-loaded on A0, follow these steps to return it back to that state.
Short Commands:
h = help (displays this message)
R = reset to factory defaults
s = Start logging to file
S = Stop logging to file
Config Commands (enter command=newvalue). Current values shown in parenthesis:
SYSTYPE=0 - Set board type (0 = Macchina A0, 1 = EVTV ESP32 Board
LOGLEVEL=1 - set log level (0=debug, 1=info, 2=warn, 3=error, 4=off)
CAN0EN=1 - Enable/Disable CAN0 (0 = Disable, 1 = Enable)
CAN0SPEED=500000 - Set speed of CAN0 in baud (125000, 250000, etc)
CAN0LISTENONLY=0 - Enable/Disable Listen Only Mode (0 = Dis, 1 = En)
CAN0SEND=ID,LEN, - Ex: CAN0SEND=0x200,4,1,2,3,4
MARK= - Set a mark in the log file about what you are about to do.
BINSERIAL=0 - Enable/Disable Binary Sending of CANBus Frames to Serial (0=Dis, 1=En)
BTMODE=0 - Set mode for Bluetooth (0 = Off, 1 = On)
BTNAME=ELM327-A0RET - Set advertised Bluetooth name
LAWICEL=1 - Set whether to accept
LAWICEL commands (0 = Off, 1 = On)
WIFIMODE=2 - Set mode for WiFi (0 = Wifi Off, 1 = Connect to AP, 2 = Create AP
SSID=A0RETSSID - Set SSID to either connect to or create
WPA2KEY=aBigSecret - Either passphrase or actual key