<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I’ve released what I have so far at:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><a href="https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3" class="">https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3</a></div></blockquote><div class=""><br class=""></div><div class="">From now on, I’ll push directly to there, and accept pull requests.</div><div class=""><br class=""></div><div class=""><u class=""><b class="">DEVKIT-C</b></u></div><div class=""><br class=""></div><div class="">To get it up and running on a DEVKIT-C style device, you will have to ‘make menuconfig’, and change (a) flash size to 1MB, (b) partition table to just a single factory image (no OTA). That will break when we bring the config system and SPIFS filesystem in flash online, but is workable for the moment. Our OTA and config flash will just rely on the partition table contents, so should continue to work with this (although you will need a custom partition table to work in 4MB).</div><div class=""><br class=""></div><div class="">A better solution is to use an external 16MB flash chip, on a breadboard with the DEVKIT-C. Not hard to do.</div><div class=""><br class=""></div><div class="">Physical wiring (for W25R128 and DEVKIT-C):</div><div class=""><ul class="MailOutline"><li class="">#1 -> IO22 (FL_CS2)</li><li class="">#2 -> SD0 (FL_SD0)</li><li class="">#3 -> SD3 (FL_WP)</li><li class="">#4 -> GND</li><li class="">#5 -> SD1 (FL_SD1)</li><li class="">#6 -> CLK (FL_CLK)</li><li class="">#7 -> SD2 (FL_HOLD)</li><li class="">#8 -> 3.3v</li></ul></div><div class=""><br class=""></div><div class="">Fuse blowing (take great care - this is a one-time operation):</div><div class=""><ul class="MailOutline"><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse XPD_SDIO_REG 1</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse XPD_SDIO_TIEH 1</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse XPD_SDIO_FORCE 1</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse SPI_PAD_CONFIG_CLK 6</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse SPI_PAD_CONFIG_Q 7</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse SPI_PAD_CONFIG_D 8</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse SPI_PAD_CONFIG_HD 9</li><li class="">espefuse.py -p /dev/tty.SLAB_USBtoUART burn_efuse SPI_PAD_CONFIG_CS0 22</li></ul></div><div class=""><br class=""></div><div class="">If you do it right, it will look like this:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Config fuses:</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">XPD_SDIO_FORCE Ignore MTDI pin (GPIO12) for VDD_SDIO on reset = 1 R/W (0x1)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">XPD_SDIO_REG If XPD_SDIO_FORCE, enable VDD_SDIO reg on reset = 1 R/W (0x1)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">XPD_SDIO_TIEH If XPD_SDIO_FORCE & XPD_SDIO_REG, 1=3.3V 0=1.8V = 1 R/W (0x1)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPI_PAD_CONFIG_CLK Override SD_CLK pad (GPIO6/SPICLK) = 6 R/W (0x6)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPI_PAD_CONFIG_Q Override SD_DATA_0 pad (GPIO7/SPIQ) = 7 R/W (0x7)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPI_PAD_CONFIG_D Override SD_DATA_1 pad (GPIO8/SPID) = 8 R/W (0x8)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPI_PAD_CONFIG_HD Override SD_DATA_2 pad (GPIO9/SPIHD) = 9 R/W (0x9)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPI_PAD_CONFIG_CS0 Override SD_CMD pad (GPIO11/SPICS0) = 22 R/W (0x16)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">DISABLE_SDIO_HOST Disable SDIO host = 0 R/W (0x0)</span></font></div></div></blockquote><div class=""><br class=""></div><div class=""><u class=""><b class="">FIRST TIME BOOT</b></u></div><div class=""><br class=""></div><div class="">You should see something like this:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">rst:0x1 (POWERON_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (85) boot: SPI Speed : 40MHz</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (85) boot: SPI Mode : DIO</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (94) boot: SPI Flash Size : 16MB</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (106) boot: Partition Table:</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (118) boot: ## Label Usage Type ST Offset Length</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (140) boot: 0 nvs WiFi data 01 02 00009000 00004000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (164) boot: 1 otadata OTA data 01 00 0000d000 00002000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (187) boot: 2 phy_init RF data 01 01 0000f000 00001000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (210) boot: 3 factory factory app 00 00 00010000 00400000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (233) boot: 4 ota_0 OTA app 00 10 00410000 00400000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (257) boot: 5 ota_1 OTA app 00 11 00810000 00400000</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (280) boot: 6 store Unknown data 01 82 00c10000 00100000</span></font></div></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising COMMAND Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising METRICS Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising OVMS Peripherals...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> SPI bus...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> MAX7317 I/O Expander...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> ESP32 CAN...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> ESP32 ADC...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> MCP2515 CAN 1/2...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> MCP2515 CAN 2/2...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""> SD CARD...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising TEST Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising SD CARD Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising MAX7317 EGPIO Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising VFS Framework</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Registering Vehicle: Tesla Roadster</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Initialising HOUSEKEEPING Framework...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (1657) cpu_start: Starting scheduler on PRO CPU.</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">I (509) cpu_start: Starting scheduler on APP CPU.</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><b class="">Welcome to the Open Vehicle Monitoring System (OVMS) - async console</b></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><b class="">OVMS ></b></span></font></div></blockquote><div class=""><br class=""></div><div class=""><u class=""><b class="">CONSOLE</b></u></div><div class=""><br class=""></div><div class="">First thing you’ll see if we’ve unified everything into a command console. This console can be accessed over USB, and in future we’ll support WIFI, BLUETOOTH, SMS, GPRS, etc. The point is that all console commands work the same, no matter where they are called from. All core functionality will be exposed via console commands.</div><div class=""><br class=""></div><div class="">Here is an example session (live from my test system):</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Welcome to the Open Vehicle Monitoring System (OVMS) - async console</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > sd mount</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Name: SD</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Type: SDHC/SDXC</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Speed: default speed</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Size: 15120MB</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">CSD: ver=1, sector_size=512, capacity=30965760 read_bl_len=9</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SCR: sd_spec=2, bus_width=5</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Mounted SD CARD</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > vfs ls /sdcard</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">SPOTLI~1</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">VFS.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">COMMAND.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">COMMAND.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">COMPON~1.MK</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">CONSOL~1.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">CONSOL~1.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">METRICS.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">METRICS.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS_M~1.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">PERIPH~1.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">PERIPH~1.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">TERMINAL.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">TERMINAL.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">TEST_F~1.CPP</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">TEST_F~1.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > vfs rm /sdcard/OVMS.H</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">VFS File deleted</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > egpio output 1 255</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">EGPIO port 1 set to output level 255</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > sd unmount</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">Unmounted SD CARD</span></font></div></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > metrics list<br class="">m.version<br class="">v.b.12v 0<br class="">v.b.cac<br class="">v.b.range.e<br class="">v.b.range.i<br class="">v.b.soc<br class="">v.b.soh<br class="">v.b.temp.ambient<br class="">v.b.temp.charger<br class="">v.b.temp.motor<br class="">v.b.temp.pem<br class="">v.p.altitude<br class="">v.p.direction<br class="">v.p.latitude<br class="">v.p.longitude<br class="">v.p.odometer<br class="">v.p.speed<br class="">v.p.trip<br class="">v.tp.fl.p<br class="">v.tp.fl.t<br class="">v.tp.fr.p<br class="">v.tp.fr.t<br class="">v.tp.rl.p<br class="">v.tp.rl.t<br class="">v.tp.rr.p<br class="">v.tp.rr.t<br class="">v.type<br class="">v.vin</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">OVMS > ?<br class="">egpio EGPIO framework<br class="">help Ask for help<br class="">metrics METRICS framework<br class="">sd SD CARD framework<br class="">test Test framewor</span></font><span style="font-size: 14px; font-family: 'Andale Mono';" class="">k</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">vfs VFS framework</span></font></div></blockquote><div class=""><br class=""></div><div class="">Tab completion is not done yet, but you can do a “?” to see what is available.</div><div class=""><br class=""></div><div class=""><u class=""><b class="">METRICS</b></u></div><div class=""><br class=""></div><div class="">You’ll see these metrics as a new thing in OVMS v3. The idea is that rather than having hard-coded items, we have a dynamic extendable list of metrics. Some are standard (look in metrics_standard.h), but others can be added by vehicle modules (or any part of the system, really).</div><div class=""><br class=""></div><div class="">These metrics will be used for MQTT, but also joined back together into groups for OVMS v2 protocol.</div><div class=""><br class=""></div><div class=""><u class=""><b class="">LANGUAGE</b></u></div><div class=""><br class=""></div><div class="">The code is in C++. The choice there was because (a) I wanted collections (maps, arrays, etc), (b) I wanted components to be able to self-register without having to change the framework (you just put the component in the right place and it merges itself into the system). Most of the code itself is basic C.</div><div class=""><br class=""></div><div class=""><u class=""><b class="">CODE STRUCTURE</b></u></div><div class=""><br class=""></div><div class="">The ‘main’ directory contains the framework itself. Only people playing with the framework should have to change that.</div><div class=""><br class=""></div><div class="">The ‘components’ directory contains the extension components. This is where the system is extended.</div><div class=""><br class=""></div><div class="">Within ‘main’, we have:</div><div class=""><div class=""><ul class=""><li class="">command.cpp - the console command processor</li><li class="">config.cpp - the configuration system</li><li class="">console_async.cpp - an async console for USB port</li><li class="">housekeeping.cpp - housekeeping tasks (e.g. measuring the 12v level every few seconds and updating the v.b.12v metric)</li><li class="">metrics.cpp - the metrics system</li><li class="">metrics_standard.h - the standard metrics</li><li class="">ovms_main.cpp - the main entry point</li><li class="">peripherals.cpp - access to all the peripherals in the system</li><li class="">terminal.cpp - an experiment that didn’t work and will go soon</li><li class="">test_framework.cpp - test framework for QC</li><li class="">vfs.cpp - access to the virtual filesystem (from console)</li></ul></div></div><div class="">Within ‘components’, we have:</div><div class=""><ul class=""><li class="">can - a unified interface to CAN buses</li><li class="">esp32can - CAN bus native to the ESP32</li><li class="">mcp2515 - CAN bus on the MCP2515 chips, controlled by SPI</li><li class="">esp32adc - The ADC (for measuring 12v voltage level)</li><li class="">max7317 - The extended GPIO (EGPIO), controlled by SPI</li><li class="">microrl - A command line processing library</li><li class="">pcp - Power Controlled Peripheral (a base layer for all out peripherals so we can power control them in a unified way)</li><li class="">sdcard - SD CARD control</li><li class="">spinodma - A SPI master driver that doesn’t use DMA (suitable for the small transfers we do) and is extendable beyond the hardware limit of 3 devices per SPI bus</li><li class="">vehicle - The base vehicle layer</li><li class="">vehicle_teslaroadster - An example project to add vehicle support for Tesla Roadster</li></ul><div class="">There are some code consistency issues at the moment. Things like lowercasevariables vs ThoseLikeThis. I’m trying to clean that up, as the code has come from lots of different places.</div></div><div class=""><br class=""></div><div class=""><u class=""><b class="">CHANGES.TXT</b></u></div><div class=""><br class=""></div><div class="">There is a CHANGES.TXT file. As I make changes (or incorporate other people’s changes), I’ll update it.</div><div class=""><br class=""></div><div class=""><u class=""><b class="">TODO.TXT</b></u></div><div class=""><br class=""></div><div class="">There is a list of tasks outstanding in TODO.TXT. If anything interests you, please let me know and I’ll be happy to assign it to you (as well as extremely grateful :-).</div><div class=""><br class=""></div><div class="">I’m still trying to validate all the hardware, and ensure everything works. That means moving over the test code I have into proper libraries in this framework, and implement test_framework, or other, commands to allow them to be tested. Some are stubs, but most in the OVMS.V3 github are now live and working. See TODO.TXT for the latest status.</div><div class=""><br class=""></div><div class="">Enjoy,</div><div class="">Mark.</div><div class=""><br class=""></div></body></html>