Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training Radar model causes python script to crash (AEGHB-916) #218

Open
3 tasks done
zathlute opened this issue Dec 15, 2024 · 9 comments
Open
3 tasks done

Training Radar model causes python script to crash (AEGHB-916) #218

zathlute opened this issue Dec 15, 2024 · 9 comments

Comments

@zathlute
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

I expect esp_csi_tool.py to run without issue when the radar model is trained.

Actual behavior (suspected bug)

Instead it will crash shortly after recording the training the radar model.

Error logs or terminal output

json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: DkcQRhBED0cRRRNDFEQUQRZCF0AbQx4/HUAePR0+JD4jOyI6JTklOyM8JjsnOS44LDssOy08Kz8qPis9Jj4mQSRBIT8hPiA7ID0aOxk7FTsUOhM4DgONQs0CDIIMQQwAi4BLv8r+yg=
Traceback (most recent call last):
  File "C:\Espressif\frameworks\esp-idf-v5.3.2\esp-csi\examples\esp-radar\console_test\tools\esp_csi_tool.py", line 554, in show_curve_subcarrier
    str_values = self.tableView_values[g_radio_header_pd.columns.values[j]][int(
                                                                            ^^^^
ValueError: invalid literal for int() with base 10: ''
Traceback (most recent call last):
  File "C:\Espressif\frameworks\esp-idf-v5.3.2\esp-csi\examples\esp-radar\console_test\tools\esp_csi_tool.py", line 554, in show_curve_subcarrier
    str_values = self.tableView_values[g_radio_header_pd.columns.values[j]][int(
                                                                            ^^^^
ValueError: invalid literal for int() with base 10: ''
Exception: Incorrect padding, data: xDTDNsc2wjjGNsc1yjXNNM000DTON9I50TnTN9I41znYOtk12jzaOto53DveON4/3T7dPt0+3D3aP9s62DzZOdk52DbXMtox1zHXLdcr1irXJtYmiPYIdkd2hvaGNoX2hTaEtsP2wo=
json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: xDTDNsc2wjjGNsc1yjXNNM000DTON9I50TnTN9I41znYOtk12jzaOto53DveON4/3T7dPt0+3D3aP9s62DzZOdk52DbXMtox1zHXLdcr1irXJtYmiPYIdkd2hvaGNoX2hTaEtsP2wo=
Exception: Incorrect padding, data: QvND8ULvQ/A/7z3wPe877zztOes76jjmOOQ25DfmNOMy4jLlMd8x4DLhMN0w4C7aMtoy2zPaMtoy2jLMt4y3jPfMuI04jLlMuUv6C7oMOov7TDxLvAs8SvyJ/go9yr4JPwl/iMAIwM=
json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: QvND8ULvQ/A/7z3wPe877zztOes76jjmOOQ25DfmNOMy4jLlMd8x4DLhMN0w4C7aMtoy2zPaMtoy2jLMt4y3jPfMuI04jLlMuUv6C7oMOov7TDxLvAs8SvyJ/go9yr4JPwl/iMAIwM=
Exception: Incorrect padding, data: BLcDuAK5A7gCuQC8/rz9vv29/L/6vPe++L/3wfjB8cDww/LE8MTuxPDE7cPuxOrE68HpwujC7MDrwOrC7LuwvDB8sPyw/TF9cT6yPrI+8j8yv7MAMsA0AHRAtQF1AfVCNgL2gvcDt8=
json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: BLcDuAK5A7gCuQC8/rz9vv29/L/6vPe++L/3wfjB8cDww/LE8MTuxPDE7cPuxOrE68HpwujC7MDrwOrC7LuwvDB8sPyw/TF9cT6yPrI+8j8yv7MAMsA0AHRAtQF1AfVCNgL2gvcDt8=
Traceback (most recent call last):
  File "C:\Espressif\frameworks\esp-idf-v5.3.2\esp-csi\examples\esp-radar\console_test\tools\esp_csi_tool.py", line 1024, in run
    radar_data_handle(self, series)
  File "C:\Espressif\frameworks\esp-idf-v5.3.2\esp-csi\examples\esp-radar\console_test\tools\esp_csi_tool.py", line 945, in radar_data_handle
    g_radar_status_array[-1][taget_index] = data[f"{RADAR_targetS_NAMES[taget_index]}_status"]
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
Exception: Incorrect padding, data: uAO6A7kGuQW6B70EvgW/CL8GwAu+DMEQwBHDEMMPwhHGEsUQxhXGFcYUxRXGFMccxBrFGcQYwRfDF8MWBLCE8MSxQ/EDMYMxQzICckIygXKAswBzQHR/9L91fzU+tf42Pja9tz04PI=
json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: uAO6A7kGuQW6B70EvgW/CL8GwAu+DMEQwBHDEMMPwhHGEsUQxhXGFcYUxRXGFMccxBrFGcQYwRfDF8MWBLCE8MSxQ/EDMYMxQzICckIygXKAswBzQHR/9L91fzU+tf42Pja9tz04PI=
Exception: Incorrect padding, data: ugC6AbwEuQK8BL4CvwLABL8FwgjBCMENwg7DD8MNxBDFEccPyBTIE8cRxhTIE8oaxRjFGMUYxRfEGMYWxhPFE8URxw/FDckNyA3LCswJzAfOBM4D0ALSANT/1/7X/Nj72vrb+N324P=
json.JSONDecodeError: cannot access local variable 'bin_data' where it is not associated with a value, data: ugC6AbwEuQK8BL4CvwLABL8FwgjBCMENwg7DD8MNxBDFEccPyBTIE8cRxhTIE8oaxRjFGMUYxRfEGMYWxhPFE8URxw/FDckNyA3LCswJzAfOBM4D0ALSANT/1/7X/Nj72vrb+N324P=

Steps to reproduce the behavior

  1. C:\Espressif\frameworks\esp-idf-v5.3.2\esp-csi\examples\esp-radar\console_test\tools>python esp_csi_tool.py -p COM7
  2. Under train, Delay = 10sec, Duration = 1min
  3. Select start
  4. Select Yes

Project release version

latest version

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Windows

Operating system version

Windows 11 Home

Shell

CMD

Additional context

The errors in the log are persistent directly after starting the application, although the program still seems to run okay with a slight lag as time run time progresses. When you try to train the radar model it will work for around a minute before completely crashing

@github-actions github-actions bot changed the title Training Radar model causes python script to crash Training Radar model causes python script to crash (AEGHB-916) Dec 15, 2024
@NingYuxiang
Copy link

I suspect that the data format output by the chip is inconsistent with the one in the esp_csi_tool.py file. Could you provide the chip's log for analysis?

@zathlute
Copy link
Author

zathlute commented Jan 7, 2025

Here is the Log Data for the chip from console_test/tools/log/log_data.txt

run on a surface 7 (Windows Device Related to this ticket)

log_data.txt

Log from Mac (Different computer with the same issue)

log_data.txt

Let me know if there are any other logs that you would like to see

@NingYuxiang
Copy link

NingYuxiang commented Jan 7, 2025

I have observed that the error logs you provided indicate missing information, which may be caused by the console_test project using a UART baud rate of 921600. This places a performance requirement on the UART-to-USB adapter, and currently, your adapter may not meet the necessary specifications.

There are two solutions for you to choose from:

1. Replace with a higher-quality UART-to-USB adapter, such as one based on the CP2102 chip.

2. Switch to using usb_serial for data transmission:

  • In app_main.c, modify the following code:
    esp_console_dev_uart_config_t uart_config = ESP_CONSOLE_DEV_UART_CONFIG_DEFAULT();
    repl_config.prompt = "csi>";
    ESP_ERROR_CHECK(esp_console_new_repl_uart(&uart_config, &repl_config, &repl));

to

    esp_console_dev_usb_serial_jtag_config_t hw_config = ESP_CONSOLE_DEV_USB_SERIAL_JTAG_CONFIG_DEFAULT();
    repl_config.prompt = "csi>";
    ESP_ERROR_CHECK(esp_console_new_repl_usb_serial_jtag(&hw_config, &repl_config, &repl));
  • In menuconfig, select ESP_CONSOLE_USB_SERIAL_JTAG.
  • Connect the hardware board using usb_serial.

@zathlute
Copy link
Author

zathlute commented Jan 7, 2025

The board that I'm using has the UART chip CH340c, looking at the data sheet it should be able to provide a baud rate of 921600. I've downloaded the latest driver for that specific and that fixed the issues I had with flashing at 921600.

I managed to test it on my Mac, although i don't know if that was sufficient as there is still issues accessing bin_data. This output is continuous while the python app is running see terminal output below:

bash_output_CSI.txt

I will try switching to using usb_serial for data transmission tomorrow when i get a chance

@NingYuxiang
Copy link

Your output is continuous, but characters are missing, such as a comma missing in the yellow circle in the image, causing a parsing error in the Python application.
image

@zathlute
Copy link
Author

zathlute commented Jan 8, 2025

Using the usb_serial for data transmission option works great! Thankyou for your help.

I have one more question, I'm planning on basing my university final year project on using CSI data to track movement. My supervisors recommended that using two antennas on the receiver would enable much more accurate tracking as the phase shift between the antennas would allow for pin pointing locations. From what i can find there is no way to have more than one antenna on the ESP32, Do you have any advice on how to get around this limitation? if not i may need to research alternative hardware.

@NingYuxiang
Copy link

Thank you very much for your feedback. I'm glad to hear that you've had good results using usb_serial for data transmission!

Regarding the antenna phase synchronization issue, we have a multi-chip RF phase synchronization solution. If you're interested in further communication, could you please share your email address? We look forward to engaging in a deeper discussion and providing you with support.

@zathlute
Copy link
Author

zathlute commented Jan 8, 2025

Sure, you can contact me at [email protected]

@NingYuxiang
Copy link

Sure, I have already contacted you via email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants