Serial1 does not send data when RX is connected on boot. #3474
Replies: 5 comments
-
Posted at 2020-09-15 by @gfwilliams How are you saving this code to Espruino? If you're uploading to RAM and then doing save() then the Saving to flash should work fine, but I would try removing the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-09-15 by JohanWinas I always use the "save to flash". The reason I run "require("Storage").eraseAll();reset()" before every upload is that uploads have a tendency to fail half way if not. I am guessing the BLE update instruction running every 2s might interrupt the BLE transfers?? I removed the "Attempt to clear" section and re did the same tests. No change, still cant have the RX pin connected. Just to point out. The status of the TX pin on the ESP32 will be unknown if it's transmitting data. During a cold power on this is most likely the case. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-09-15 by @fanoush The
is too late and maybe will be always too late as the serial buffer will be filled with garbage sooner than those lines can run. Either there is a way to flush Serial1 somehow after you redirect console or maybe better is to simply use different pins. Serial can be on any pins you chose, so if you actually don't plan to use Serial1 as Espruino console you may setup it on any other pins so it does not interfere with expected Espruino console input at boot time. So connect ESP32 to pins e.g. D11,D12 and then setup serial as Serial1.setup(115200, { tx:D11, rx:D12 }); |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-09-15 by JohanWinas I moved the serial connection to D14 and D15, everything works OK now. I read the page about pins for the serial port and must have mixed up pages as my memory said it could not be moved.... Thank you very much for the help :-) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-09-15 by @gfwilliams Great! Glad that fixed it :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-09-15 by JohanWinas
I still have a problem with my query not being sent out on the serial port after power on.
The setup is that I have the MDBT42Q connected to an ESP32 based board, this board has a console on its main serial port where I have to send a command and read the respons.
I have attached the core running right now.
Senario1: I power on both the esp32 and the MDBT42Q at the same time, the MDBT42Q gets it 3V3 from the ESP32 board. There is now no query sent. The LED flickers so the timer is running, but there is no bytes coming out of the MDBT42Q module.
Senario2: I power on the esp32 and leave the MDBT42Q unpowered, this skips load of start up messages etc etc. Have TX and RX connected and connect VCC. Same as Senario1, no query is sent.
Senario3: I disconnect the RX pin on the MDBT42Q, apply power, wait until one flicker of the LED (one query is send), and then connect the RX pin. The system now runs.
So I can not have the RX pin connected during boot of MDBT42Q, doing so makes the TX pin silent.
For senario 1 and 2, if I after power on connect via BLE the console does not show the traffic from the ESP32 board. And sometimes I get "New interpreter error: BUFFER_FULL" on the console just after connecting.
With senario 3 I get the console messages as expected when connected via BLE.
Any suggestions?
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions