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

Two small problems that need to be solved. #1

Open
Walkline80 opened this issue Jul 26, 2024 · 3 comments
Open

Two small problems that need to be solved. #1

Walkline80 opened this issue Jul 26, 2024 · 3 comments

Comments

@Walkline80
Copy link

After two days of debugging, there is still no way to add the binary file to the firmware, I can only use the most common method, which is to use three quotes to save the web page and other files as python files, compile the firmware and then decompress the web page file, in order to reduce the file size so the .js and .css file is compressed, the first problem was found in debugging, this line is missing a semicolon, which will lead to abnormal operation after compression.

Another problem appeared here, when using download software (I'm using NDM) to download the file will always fails, after analysis, found that the http response header is missing the Content-Length field, after adding can solve this problem.

I've already forked this repo, but I think it would be more convenient to leave an issue directly rather than submitting a pr?

@Walkline80
Copy link
Author

BTW, although the prompt shows the space available, the progress bar shows progress that doesn't quite make common sense.

image

I think it's more acceptable to change it to this.

1722004350667

@mispacek
Copy link
Owner

After two days of debugging, there is still no way to add the binary file to the firmware, I can only use the most common method, which is to use three quotes to save the web page and other files as python files, compile the firmware and then decompress the web page file, in order to reduce the file size so the .js and .css file is compressed, the first problem was found in debugging, this line is missing a semicolon, which will lead to abnormal operation after compression.

Another problem appeared here, when using download software (I'm using NDM) to download the file will always fails, after analysis, found that the http response header is missing the Content-Length field, after adding can solve this problem.

I've already forked this repo, but I think it would be more convenient to leave an issue directly rather than submitting a pr?

Sorry for problems in my code.
Can you send me updated source code of your changes in Content-Length ?

@Walkline80
Copy link
Author

Here's my code, by replace this line.

client.send(f"HTTP/1.1 200 OK\r\nContent-Type: application/octet-stream\r\nContent-Disposition: attachment; filename=\"{file_name}\"\r\nContent-Length: {os.stat(file_path)[6]}\r\n\r\n")

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