-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
PR#3646 broke the 'file upload' function in ESPlorer #3648
Comments
Latest NodeMCU build for ESP32 and I have the same issue with upload files through ESPlorer and ChiliPeppr ESP32 Web IDE. https://nodemcu.readthedocs.io/en/dev-esp32/modules/file/ Also I have the same problem with "strange baudrate". If Lua scripts for certain buttons were external and not built into the application code, then this problem could be solved simply by replacing Lua scripts. Theoretically, you can take the source code and remake it yourself, but I’m more of an amateur programmer than a pro. |
If you build the firmware on the commit (before "Initial support for ESP32-C6 and ESP32-H2,..."), then ESPlorer will work, as it takes into account the changes associated with the io module. Commit 4cdebe7 does not allow you to install a uart.on() callback handler. |
I don't see a good way out of this other than to fix this on our end. @jmattsson could we maybe get the ability back to install a |
That would be great! One more question.
However, chipid is not applicable for esp32-s2, esp32-h6 etc. To ensure compatibility with the applications, I suggest making small changes to node.chipid()
OR
Which way do you think is the most correct? |
Breaking the |
Okay, I've submitted PR #3652 - please take a look. It should address:
For the latter, rather than try to overload Also, the |
I apologize for misunderstanding of the situation. The last time I worked with a real ESP32 project was about a year ago and since then I practically haven’t looked here because... I thought that the NodeMCU project was abandoned. Only a few days ago I saw that there is support for new crystals. By the way, I didn’t find any mention of |
This code fix "Upload..." button :-) log("sendPackets=" + Integer.toString(sendPackets.size()));
String cmd = "_up=function(n,l,ll)\n"
+ " local cs = 0\n"
+ " local i = 0\n"
+ " local open = file.open or io.open\n"
+ " print(\">\"..\" \")\n"
+ " uart.start(0)\n"
+ " uart.on(\"data\", l, function(b) \n"
+ " i = i + 1\n"
+ " local fh = open(\"" + UploadFileName + "\",'a+')\n"
+ " fh:write(b)\n"
+ " fh:close()\n"
+ " cs=0\n"
+ " for j=1, l do\n"
+ " cs = cs + (b:byte(j)*20)%19\n"
+ " end\n"
+ " uart.write(0,\"~~~CRC-\"..\"START~~~\"..cs..\"~~~CRC-\"..\"END~~~\")\n"
+ " if i == n then\n"
+ " uart.on(\"data\")\n"
+ " uart.stop(0)\n"
+ " end\n"
+ " if i == n-1 and ll>0 then\n"
+ " _up(1,ll,ll)\n"
+ " end\n"
+ " end,0)\n"
+ "end\n"
+ "file.remove(\"" + UploadFileName + "\")\n"; |
@serg3295 Thanks for rapid responce! If it works then I dont need more. |
I answer to myself. If you want to apply the changes from the pull request onto your current branch Yes. Button |
Unfortunatly button |
@bv73 This could potentially be because you still have the IDF-default CR/LF configuration in your sdkconfig file. I only changed the |
@jmattsson I changed --HexDump start for comparison with old ESP32 firmware: 00000000 89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52 �PNG........IHDR |
Huh. That should not be the case. According to the documentation all line ending translation should be disabled when the setting is at |
@jmattsson I tried all combinations of |
I've tried the same. |
@bv73 Okay, this was totally my fault for managing to hardcode line ending settings 😬 |
@jmattsson After your updated code I was able to upload favicon.png without any problem. Before that I've set Thanks a lot to you and of course to @serg3295 for your efforts! Some offtopic: Previously, there was a convenient setting in the menuconfig: |
@bv73 Excellent, great to hear it! Thank you for testing! |
This should now be fixed by PR #3652 having been merged. |
Expected behavior
Upload file to ESP
Actual behavior
After applying PR #3646, the 'file upload' function of ESPlorer does not work.
ESPlorer Log:
The VSCode NodeMCU-tools (marketplace) extension also stopped working. I guess that ESP now sends additional CRLFs over uart.write(0,....)
In the extension, the CR LF combination is used as a boundary delimiter and the additional CRLFs change the existing protocol.
Debug output:
// Before PR#3646
// With PR#3646. Unwanted crlf is marked with asterisks
Test code
Click the 'Upload...' button to upload a file to ESP
Another test case:
sending
uart.on(0,"data",3,function()print("kxyJ")end, 0)
hangs the console
strange baudrate
NodeMCU startup banner
NodeMCU startup banner:
Hardware
ESP32 DevKit v4 with USB port.
The text was updated successfully, but these errors were encountered: