Arduino Nano ESP32 - Paste mode dropping characters after 200ish chars #13274
Replies: 3 comments 7 replies
-
For pasting code to the board you have to use paste mode or raw mode. The are made for that purpose. Normal REPL mode will not work for several reasons. One is the speed of processing oncoming characters, the other is the automatic indentation, and more. |
Beta Was this translation helpful? Give feedback.
-
Can you reproduce the issue in a smaller piece of code? Does it only repro with compiled code, or also with plain Python? Do you have a minimal repro? It's hard to need to reverse engineer your code on both the host and MCU. If you can isolate the issue in sending / receiving a block, that would make it simpler to help What I've found useful in debugging other espxx serial issues is to connect a logic analiser to the RX/TX pins to watch what is actually going over the wire. Also pretty sure your tool will not work well on windows as the tool appears to omit some dtr/rts handling needed for Esp reliable hard/ soft resets. |
Beta Was this translation helpful? Give feedback.
-
Sorry for not reading carefully. Obviously your device is conuming the data slower that it is sent. Then, the data rate has to be lowered. Usual method are
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I recently received an Arduino Nano ESP32 in order to test using a ublox NORA-W106 with a different project. Any attempts I try to get code to the device via paste mode are failing miserably. I can get about 250 or so bytes across before it starts dropping characters like crazy. For example, here is the code that I tried to send vs what the board saw:
I discovered this because my tool uPyFile wasn't able to get the stub program (the above code I tried to send) sent to the board. It works by starting paste mode (Ctrl+E), sending the raw Python code, and running it (Ctrl+D). With other ESP32s the uart buffer size has been capped at 64 bytes, so uPyFile has an option to limit the number of bytes it sends before flushing the serial port. Here's a sample of that code:
The problem is,
port.flush()
doesn't appear to actually be flushing the port. It's supposed to wait until there are no characters left in the TX buffer so that the receiving device can consume them all before being bombarded with new data. However, it doesn't appear to be. The latest version of uPyFile (v3.2.1) was built with PySerial 3.5 on Ubuntu 20.04 LTS (the same machine I'm using right now).I'm just trying to figure out if this is caused by something I messed up or by weird behavior with the Arduino board. If it's a problem on my end I want to fix it so my tool works. If it's not I still want to create a workaround so my tool works. 😝
If anyone would like to try replicating this, you'll need to download uPyFile from https://github.com/AwesomeCronk/uPyFile/releases and run this command:
upyfile -p /dev/ttyACM0 -B 64 -v init
. It will print out a bunch of verbose messaging detailing what exactly it is sending over the serial port and what it is receiving when it listens. If you're on Windows I don't have a binary built yet for 3.2.1, sorry about that!Beta Was this translation helpful? Give feedback.
All reactions