initial fork update

This commit is contained in:
2024-06-10 18:23:54 -06:00
parent ffe57fbd30
commit 30691e90ce
17 changed files with 354 additions and 53 deletions
+1 -2
View File
@@ -5,8 +5,7 @@ cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake) include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(can2http) project(can2http)
# Create a SPIFFS image from the contents of the 'font' directory # Create a SPIFFS image from the contents of the 'csv' FLASH_IN_PROJECT indicates that
# that fits the partition named 'storage'. FLASH_IN_PROJECT indicates that
# the generated image should be flashed when the entire project is flashed to # the generated image should be flashed when the entire project is flashed to
# the target with 'idf.py -p PORT flash # the target with 'idf.py -p PORT flash
spiffs_create_partition_image(storage csv FLASH_IN_PROJECT) spiffs_create_partition_image(storage csv FLASH_IN_PROJECT)
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2021 nopnop2002 Copyright (c) 2024 PrincessPi3 and nopnop2002
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+32
View File
@@ -1,3 +1,35 @@
# Sillyfilly-CAN
A fork of [esp-idf-can2http](https://github.com/nopnop2002/esp-idf-can2http)
A CAN bus tool built for the esp32. It has a builtin web interface and works with nearly any CAN transceiver like the [N65HVD230](https://www.amazon.com/SN65HVD230-CAN-Board-Communication-Development/dp/B00KM6XMXO/) or the [TJA1050](https://www.amazon.com/Comimark-Transceiver-TJA1050-Controller-Schnittstelle/dp/B07W4VZ2F2/)
## Hardware needed
* esp32(-X) (My favorite esp32)[https://www.amazon.com/Espressif-ESP32-S3-DevKitC-1-N32R8V-Development-Board/dp/B09R4GSDJM]
* CAN transceiver like the [N65HVD230](https://www.amazon.com/SN65HVD230-CAN-Board-Communication-Development/dp/B00KM6XMXO/) or the [TJA1050](https://www.amazon.com/Comimark-Transceiver-TJA1050-Controller-Schnittstelle/dp/B07W4VZ2F2/)
some jumper wires
* Jumper wires
## Optional
* [ODB2 pigtail](https://www.amazon.com/iKKEGOL-Connector-Diagnostic-Extension-Pigtail/dp/B0828YHWFG/)
## Installation
1) install [esp-idf](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html#installation) if not installed on your computer already
2) open esp-idf terminal
3) plug in your esp32 to computer via USB cable
4) Run these commands:
```
git clone https://github.com/PrincessPi3/Sillyfilly-CAN.git
cd Sillyfilly-CAN
idf.py set-target esp32s3 # example idf.py set-target <your_esp32_ type>
idf.py menuconfig
```
5) Under "Sillyfilly-CAN Configuration" set your settings like wifi and CRX and CTX pins.
6) Wire transceiver to the pins: CRX->RX, CTX-TX, GND->GND
7) run this command
```idf.py flash monitor # ctrl+] to exit monitor```
<your_esp32_type> can be one of 'esp32', 'esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'
# Original README.md
# esp-idf-can2http # esp-idf-can2http
CANbus to http bridge using esp32. CANbus to http bridge using esp32.
It's purpose is to be a bridge between a CAN-Bus and a HTTP-Server. It's purpose is to be a bridge between a CAN-Bus and a HTTP-Server.
+79
View File
@@ -0,0 +1,79 @@
<h1>Sillyfilly CAN Interface</h1>
<form id="txform">
<div class="form-group">
<label for="canidi">CAN ID (decimal)</label>
<input type="text" name="canidi" class="form-control" value="257" />
</div>
<div class="form-group">
<label>Frame Type</label><br />
<label for="standard">Standard</label>
<input type="radio" id="standard" name="frame" value="standard" checked /><br />
<label for="extended">Extended</label>
<input type="radio" name="frame" id="extended" value="extended" />
</div>
<div class="form-group">
<label for="datai">Standard (decimal seperated by commas)</label>
<input type="text" id="datai" name="datai" value="16,17,18" />
</div>
<input type="button" id="send" value="Send >>" onclick="send_tx()" />
<h3>TX</h3>
<div id="output">none yet</div>
<h3>RX</h3>
<div id="frames">none yet</div>
</form>
<script>
var clearedtx = 0;
var clearedrx = 0;
function mapFn(element, index) {
return parseInt(element);
}
function send_tx() {
var form = document.getElementById('txform');
var datai = document.getElementById('datai').value;
var datai_arr = Array.from(datai.split(","), mapFn);
var xhr = new XMLHttpRequest();
var formData = new FormData(form);
//var txHTML = document.getElementById('output');
//open the request
xhr.open('POST','/api/twai/send');
xhr.setRequestHeader("Content-Type", "application/json");
//prepare da dataz
var obj = Object.fromEntries(formData);
//obj["data"] = datai.split(",");
obj["data"] = datai_arr;
obj["canid"] = parseInt(obj["canidi"]);
delete obj.datai;
delete obj.canidi;
console.log(obj);
var JSONstring = JSON.stringify(obj);
xhr.send(JSONstring);
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
if(clearedtx === 0) { document.getElementById('output').innerHTML=""; clearedtx = 1; }
clearedtx = 1;
document.getElementById('output').innerHTML += xhr.responseText+": "+JSONstring+"<br>";
}
}
return true;
}
function update_rx() {
var xhr = new XMLHttpRequest();
//var rxHTML = document.getElementById('frames');
xhr.open('GET','/api/twai/read');
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
if(clearedrx === 0) { document.getElementById('frames').innerHTML=""; clearedrx = 1; }
document.getElementById('frames').innerHTML += xhr.responseText;
}
}
}
setInterval(update_rx,1500);
</script>
+1 -1
View File
@@ -76,5 +76,5 @@ if __name__ == "__main__":
print("lines={}".format(args.lines)) print("lines={}".format(args.lines))
app.config['lines'] = args.lines app.config['lines'] = args.lines
#app.run() #app.run()
app.run(host='0.0.0.0', port=args.port, debug=True) app.run(host='127.0.0.1', port=args.port, debug=True)
+6 -6
View File
@@ -1,4 +1,4 @@
menu "Application Configuration" menu "Sillyfilly-CAN Configuration"
config GPIO_RANGE_MAX config GPIO_RANGE_MAX
int int
@@ -73,7 +73,7 @@ menu "Application Configuration"
config ENABLE_PRINT config ENABLE_PRINT
bool "Output the received CAN FRAME to STDOUT" bool "Output the received CAN FRAME to STDOUT"
default y default true
help help
Output the received CAN FRAME to STDOUT. Output the received CAN FRAME to STDOUT.
@@ -83,13 +83,13 @@ menu "Application Configuration"
config ESP_WIFI_SSID config ESP_WIFI_SSID
string "WiFi SSID" string "WiFi SSID"
default "myssid" default "wifi-name"
help help
SSID (network name) to connect to. SSID (network name) to connect to.
config ESP_WIFI_PASSWORD config ESP_WIFI_PASSWORD
string "WiFi Password" string "WiFi Password"
default "mypassword" default "wifi-password"
help help
WiFi password (WPA or WPA2) to connect to. WiFi password (WPA or WPA2) to connect to.
@@ -101,7 +101,7 @@ menu "Application Configuration"
config MDNS_HOSTNAME config MDNS_HOSTNAME
string "mDNS Hostname" string "mDNS Hostname"
default "esp32-server" default "esp32-can-server"
help help
The mDNS host name used by the ESP32. The mDNS host name used by the ESP32.
@@ -138,7 +138,7 @@ menu "Application Configuration"
config WEB_SERVER config WEB_SERVER
string "HTTP Server IP or mDNS" string "HTTP Server IP or mDNS"
default "http-server.local" default "esp32-can-server"
help help
The host name or IP address of the HTTP server to use. The host name or IP address of the HTTP server to use.
+1 -1
View File
@@ -91,7 +91,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
ESP_LOGI(TAG, "Last esp error code: 0x%x", err); ESP_LOGI(TAG, "Last esp error code: 0x%x", err);
ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err); ESP_LOGI(TAG, "Last mbedtls failure: 0x%x", mbedtls_err);
} }
break; break;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
case HTTP_EVENT_REDIRECT: case HTTP_EVENT_REDIRECT:
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT"); ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");
+64 -11
View File
@@ -8,6 +8,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <inttypes.h> #include <inttypes.h>
#include <string.h> #include <string.h>
@@ -23,36 +24,79 @@
#include "esp_chip_info.h" #include "esp_chip_info.h"
#include "cJSON.h" #include "cJSON.h"
#include "driver/twai.h" #include "driver/twai.h"
#include "twai.h" #include "twai.h"
static const char *TAG = "SERVER"; #define SCRATCH_BUFSIZE (1024)
//static SemaphoreHandle_t ctrl_task_sem;
#define TAG "HTTP_SERVER"
int pointer = 0;
static char *base_path = "/spiffs";
extern QueueHandle_t xQueue_twai_tx; extern QueueHandle_t xQueue_twai_tx;
extern char* twai_string_buf;
#define SCRATCH_BUFSIZE (1024) extern int twai_allocation_size;
extern char* file_read_buf;
extern int allocation_size;
typedef struct rest_server_context { typedef struct rest_server_context {
char base_path[ESP_VFS_PATH_MAX + 1]; // Not used in this project char base_path[ESP_VFS_PATH_MAX + 1]; // Not used in this project
char scratch[SCRATCH_BUFSIZE]; char scratch[SCRATCH_BUFSIZE];
} rest_server_context_t; } rest_server_context_t;
esp_err_t readFile(char *ifile) {
int c;
ESP_LOGI(TAG, "File read llocated memory confirmed!: %d bytes", allocation_size);
char *spiffspath = "/spiffs";
int buflen = strlen(spiffspath)+strlen(ifile)+1;
char buf[buflen];
snprintf(buf, sizeof(buf), "%s%s", spiffspath, ifile);
ESP_LOGI(TAG, "buflen: %d, spiffspath: %s, ifile: %s, buf: %s, base_path: %s",buflen,spiffspath,ifile,buf,base_path);
FILE* f = fopen(buf, "r");
ESP_LOGI(TAG, "Begin reading file");
int i = 0;
while ((c = fgetc(f)) != EOF) {
file_read_buf[i] = c;
i++;
};
file_read_buf[i] = '\0';
fclose(f);
ESP_LOGI(TAG, "Read File - Iterations: %d", i);
return ESP_OK;
}
/* Handler for roor get handler */ /* Handler for roor get handler */
static esp_err_t root_get_handler(httpd_req_t *req) esp_err_t root_get_handler(httpd_req_t *req)
{ {
ESP_LOGI(TAG, "root_get_handler req->uri=[%s]", req->uri); ESP_LOGI(TAG, "root_get_handler req->uri=[%s]", req->uri);
readFile("/index.html");
esp_err_t sendcheck = httpd_resp_send(req, file_read_buf, HTTPD_RESP_USE_STRLEN);
//httpd_resp_sendstr_chunk(req, NULL);
/* Send empty chunk to signal HTTP response completion */ if(sendcheck == ESP_OK) {
httpd_resp_sendstr_chunk(req, NULL); //free(file_read_buf);
memset(twai_string_buf, '\0', allocation_size);
ESP_LOGI(TAG, "malloc freed");
return ESP_OK;
} else {
return ESP_ERR_HTTPD_RESP_SEND;
}
return ESP_OK; return ESP_OK;
} }
static esp_err_t twai_read_handler(httpd_req_t *req)
{
httpd_resp_sendstr(req, twai_string_buf);
// Buffers returned by cJSON_Print must be freed by the caller.
// Please use the proper API (cJSON_free) rather than directly
//twai_string_buf = {0};
memset(twai_string_buf, '\0', twai_allocation_size);
return ESP_OK;
}
/* Handler for getting system information handler */ /* Handler for getting system information handler */
// curl 'http://esp32-server.local:8000/api/system/info' | python -m json.tool // curl 'http://esp32-can-server:8000/api/system/info' | python -m json.tool
static esp_err_t system_info_get_handler(httpd_req_t *req) static esp_err_t system_info_get_handler(httpd_req_t *req)
{ {
ESP_LOGI(TAG, "system_info_get_handler req->uri=[%s]", req->uri); ESP_LOGI(TAG, "system_info_get_handler req->uri=[%s]", req->uri);
@@ -225,7 +269,7 @@ static esp_err_t twai_send_handler(httpd_req_t *req)
if (xQueueSend(xQueue_twai_tx, &tx_msg, portMAX_DELAY) != pdPASS) { if (xQueueSend(xQueue_twai_tx, &tx_msg, portMAX_DELAY) != pdPASS) {
ESP_LOGE(TAG, "xQueueSend Fail"); ESP_LOGE(TAG, "xQueueSend Fail");
} }
httpd_resp_sendstr(req, "twai send successfully"); httpd_resp_sendstr(req, "CAN tx sent successfully");
} else { } else {
ESP_LOGE(TAG, "Request parameter not correct"); ESP_LOGE(TAG, "Request parameter not correct");
httpd_resp_sendstr(req, "Request parameter not correct"); httpd_resp_sendstr(req, "Request parameter not correct");
@@ -284,6 +328,15 @@ esp_err_t start_server(const char *base_path, int port)
}; };
httpd_register_uri_handler(server, &twai_send_post_uri); httpd_register_uri_handler(server, &twai_send_post_uri);
/* URI handler for send twai */
httpd_uri_t twai_read = {
.uri = "/api/twai/read",
.method = HTTP_GET,
.handler = twai_read_handler,
//.user_ctx = rest_context
};
httpd_register_uri_handler(server, &twai_read);
return ESP_OK; return ESP_OK;
} }
+8
View File
@@ -0,0 +1,8 @@
#define MAX_FILE_SIZE_KB 10
#define MAX_TWAI_SIZE_KB 5
#define MALLOCHI_TAG "INIT_MALLOCHI"
char* file_read_buf;
char* twai_string_buf;
int allocation_size;
int twai_allocation_size;
+39 -5
View File
@@ -27,9 +27,8 @@
#include "mdns.h" #include "mdns.h"
#include "lwip/dns.h" #include "lwip/dns.h"
#include "driver/twai.h" // Update from V4.2 #include "driver/twai.h" // Update from V4.2
#include "twai.h" #include "twai.h"
#include "init_malloci.h"
#define TAG "MAIN" #define TAG "MAIN"
static const twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL(); static const twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
@@ -70,6 +69,7 @@ static EventGroupHandle_t s_wifi_event_group;
#define WIFI_FAIL_BIT BIT1 #define WIFI_FAIL_BIT BIT1
static int s_retry_num = 0; static int s_retry_num = 0;
static char *base_path = "/spiffs";
QueueHandle_t xQueue_http_client; QueueHandle_t xQueue_http_client;
QueueHandle_t xQueue_twai_tx; QueueHandle_t xQueue_twai_tx;
@@ -77,6 +77,9 @@ QueueHandle_t xQueue_twai_tx;
TOPIC_t *publish; TOPIC_t *publish;
int16_t npublish; int16_t npublish;
//extern char* twai_string_buf;
//extern esp_err_t init_twai_read_malloc();
static void event_handler(void* arg, esp_event_base_t event_base, static void event_handler(void* arg, esp_event_base_t event_base,
int32_t event_id, void* event_data) int32_t event_id, void* event_data)
{ {
@@ -204,10 +207,9 @@ esp_err_t mountSPIFFS(char * partition_label, char * base_path) {
esp_vfs_spiffs_conf_t conf = { esp_vfs_spiffs_conf_t conf = {
.base_path = base_path, .base_path = base_path,
.partition_label = partition_label, .partition_label = partition_label,
.max_files = 5, .max_files = 4,
.format_if_mount_failed = true .format_if_mount_failed = true
}; };
// Use settings defined above to initialize and mount SPIFFS filesystem. // Use settings defined above to initialize and mount SPIFFS filesystem.
// Note: esp_vfs_spiffs_register is an all-in-one convenience function. // Note: esp_vfs_spiffs_register is an all-in-one convenience function.
esp_err_t ret = esp_vfs_spiffs_register(&conf); esp_err_t ret = esp_vfs_spiffs_register(&conf);
@@ -242,6 +244,7 @@ esp_err_t mountSPIFFS(char * partition_label, char * base_path) {
return ret; return ret;
} }
esp_err_t build_table(TOPIC_t **topics, char *file, int16_t *ntopic) esp_err_t build_table(TOPIC_t **topics, char *file, int16_t *ntopic)
{ {
ESP_LOGI(TAG, "build_table file=%s", file); ESP_LOGI(TAG, "build_table file=%s", file);
@@ -354,6 +357,35 @@ void dump_table(TOPIC_t *topics, int16_t ntopic)
} }
esp_err_t init_file_malloc() {
allocation_size = (MAX_FILE_SIZE_KB*1024*sizeof(char));
file_read_buf = (char*)malloc(allocation_size);
if (file_read_buf == NULL) {
ESP_LOGE(MALLOCHI_TAG, "File read memory not allocated.");
return ESP_FAIL;
} else {
ESP_LOGI(MALLOCHI_TAG, "File read malloc succeeded! %d bytes allocated", allocation_size);
return ESP_OK;
}
return ESP_OK;
}
esp_err_t init_twai_read_malloc() {
twai_allocation_size = (sizeof(char)*1024*MAX_TWAI_SIZE_KB);
twai_string_buf = (char*)malloc(twai_allocation_size);
if (twai_string_buf == NULL) {
ESP_LOGE(MALLOCHI_TAG, "TWAI memory not allocated.");
return ESP_FAIL;
} else {
ESP_LOGI(MALLOCHI_TAG, "TWAI malloc succeeded! %d bytes allocated", twai_allocation_size);
return ESP_OK;
}
return ESP_OK;
}
void http_client_task(void *pvParameters); void http_client_task(void *pvParameters);
void http_server_task(void *pvParameters); void http_server_task(void *pvParameters);
void twai_task(void *pvParameters); void twai_task(void *pvParameters);
@@ -371,6 +403,8 @@ void app_main()
ESP_LOGI(TAG, "ESP_WIFI_MODE_STA"); ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
wifi_init_sta(); wifi_init_sta();
initialise_mdns(); initialise_mdns();
init_twai_read_malloc();
init_file_malloc();
// Install and start TWAI driver // Install and start TWAI driver
ESP_LOGI(TAG, "%s",BITRATE); ESP_LOGI(TAG, "%s",BITRATE);
@@ -385,7 +419,7 @@ void app_main()
// Mount SPIFFS // Mount SPIFFS
char *partition_label = "storage"; char *partition_label = "storage";
char *base_path = "/spiffs"; //char *base_path = "/spiffs";
ret = mountSPIFFS(partition_label, base_path); ret = mountSPIFFS(partition_label, base_path);
if (ret != ESP_OK) { if (ret != ESP_OK) {
ESP_LOGE(TAG, "mountSPIFFS fail"); ESP_LOGE(TAG, "mountSPIFFS fail");
+53 -11
View File
@@ -18,8 +18,9 @@
#include "esp_err.h" #include "esp_err.h"
#include "esp_log.h" #include "esp_log.h"
#include "driver/twai.h" // Update from V4.2 #include "driver/twai.h" // Update from V4.2
#include "twai.h" #include "twai.h"
#include "cJSON.h"
//#include "init_malloci.h"
static const char *TAG = "TWAI"; static const char *TAG = "TWAI";
@@ -28,6 +29,10 @@ extern QueueHandle_t xQueue_twai_tx;
extern TOPIC_t *publish; extern TOPIC_t *publish;
extern int16_t npublish; extern int16_t npublish;
int str_iterator = 0;
extern char* twai_string_buf;
//extern esp_err_t init_twai_read_malloc();
void dump_table(TOPIC_t *topics, int16_t ntopic); void dump_table(TOPIC_t *topics, int16_t ntopic);
@@ -35,10 +40,14 @@ void twai_task(void *pvParameters)
{ {
ESP_LOGI(TAG,"task start"); ESP_LOGI(TAG,"task start");
dump_table(publish, npublish); dump_table(publish, npublish);
twai_message_t rx_msg; twai_message_t rx_msg;
twai_message_t tx_msg; twai_message_t tx_msg;
FRAME_t frameBuf; FRAME_t frameBuf;
char* ftype;
//char* fdata = (char*)malloc(32*sizeof(char));
//int iterator = 0;
char flags[4];
char identifier[4];
while (1) { while (1) {
esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(10)); esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(10));
if (ret == ESP_OK) { if (ret == ESP_OK) {
@@ -51,22 +60,55 @@ void twai_task(void *pvParameters)
#if CONFIG_ENABLE_PRINT #if CONFIG_ENABLE_PRINT
if (ext == STANDARD_FRAME) { if (ext == STANDARD_FRAME) {
printf("Standard ID: 0x%03"PRIx32" ", rx_msg.identifier); printf("Standard ID: 0x%03"PRIx32, rx_msg.identifier);
} else { } else {
printf("Extended ID: 0x%08"PRIx32, rx_msg.identifier); printf("Extended ID: 0x%08"PRIx32, rx_msg.identifier);
} }
printf(" DLC: %d Data: ", rx_msg.data_length_code); printf(" DLC: %d Data: ", rx_msg.data_length_code);
if (rtr == 0) {
for (int i = 0; i < rx_msg.data_length_code; i++) {
printf("0x%02x ", rx_msg.data[i]);
}
} else {
printf("REMOTE REQUEST FRAME");
}
printf("\n"); printf("\n");
#endif #endif
// JSON fun fun fun output for da api
if (ext == STANDARD_FRAME) {
ftype = "STANDARD_FRAME";
} else {
ftype = "EXTENDED_FRAME";
}
cJSON *twai_root = cJSON_CreateObject();
int charslen_each = 6;
int data_len_chars = rx_msg.data_length_code*charslen_each;
char tmp_buf[charslen_each+2];
char fdata[data_len_chars];
if (rx_msg.data_length_code != 0) {
for (int i = 0; i < rx_msg.data_length_code; i++) {
snprintf(tmp_buf, charslen_each, "0x%02x ",rx_msg.data[i]);
strcat(fdata, tmp_buf);
}
fdata[strlen(fdata)-1] = '\0';
cJSON_AddStringToObject(twai_root, "data", fdata);
}
snprintf(flags, sizeof(rx_msg.flags), "0x%"PRIx32, rx_msg.flags);
snprintf(identifier, sizeof(rx_msg.identifier), "0x%"PRIx32, rx_msg.identifier);
cJSON_AddStringToObject(twai_root, "type", ftype);
cJSON_AddStringToObject(twai_root, "id", identifier);
cJSON_AddStringToObject(twai_root, "flags", flags);
cJSON_AddNumberToObject(twai_root, "ext", ext);
cJSON_AddNumberToObject(twai_root, "rtr", rtr);
cJSON_AddNumberToObject(twai_root, "dlc",rx_msg.data_length_code);
char *string = cJSON_Print(twai_root);
char br[] = "<br>\n";
strcat(twai_string_buf,string);
strcat(twai_string_buf,br);
cJSON_free(string);
cJSON_Delete(twai_root);
// end json buffer funssss
for(int index=0;index<npublish;index++) { for(int index=0;index<npublish;index++) {
if (publish[index].frame != ext) continue; if (publish[index].frame != ext) continue;
+2 -2
View File
@@ -2,5 +2,5 @@
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs, data, nvs, 0x9000, 0x6000, nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000, phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x120000, factory, app, factory, 0x10000, 2M,
storage, data, spiffs, , 0xD0000, storage, data, spiffs, , 4M,
1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
3 nvs, data, nvs, 0x9000, 0x6000,
4 phy_init, data, phy, 0xf000, 0x1000,
5 factory, app, factory, 0x10000, 0x120000, factory, app, factory, 0x10000, 2M,
6 storage, data, spiffs, , 0xD0000, storage, data, spiffs, , 4M,
+1
View File
@@ -0,0 +1 @@
$Env:ESPPORT = "COM22"
+3
View File
@@ -0,0 +1,3 @@
idf.py set-target esp32s3
idf.py menuconfig
idf.py flash monitor
+20
View File
@@ -0,0 +1,20 @@
function Test-Delete {
param (
$file
)
if (Test-Path $file) {
rm -r -fo $file
Write-Output "$file DELETED"
} else {
Write-Output "$file NOT present"
}
}
idf.py erase-flash fullclean python-clean
Test-Delete -file .\managed_components
Test-Delete -file .\build
Test-Delete -file .\sdkconfig.old
Test-Delete -file .\dependencies.lock
Test-Delete -file .\sdkconfig.old
+20 -13
View File
@@ -1,16 +1,23 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Minimal Configuration
# #
# Partition Table CONFIG_IDF_TARGET="esp32s3"
# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_ENABLE_PRINT=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_DUMP_RTL_FILES=y
#
# mDNS
#
CONFIG_MDNS_STRICT_MODE=y
#
# HTTP Server
#
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
CONFIG_HTTPD_PURGE_BUF_LEN=100
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESP32S3_DATA_CACHE_64KB=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
+23
View File
@@ -0,0 +1,23 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.3.0 Project Minimal Configuration
#
CONFIG_IDF_TARGET="esp32s3"
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_ENABLE_PRINT=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_DUMP_RTL_FILES=y
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
CONFIG_HTTPD_PURGE_BUF_LEN=100
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_SPIRAM_SPEED_80M=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB=y
CONFIG_ESP32S3_DATA_CACHE_64KB=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y