Closed jerryneedell closed 5 years ago
oh yeah -- this also fixed the funny issue with the missing space after the send prompt on the nrf52!
nice!
wanna maybe move that code to a set_baudrate() function, that way people can call it if they need
sure - will do.
I left the old unused baudrate in place (renamed ) since taking it out breaks all the examples. Do you want me to take it out now as well?
perhaps init() should perform the initial baudrate setting as well?
ah -- ok - set it in init if it is different -- that makes sense - I like this because you can change it back when you are done if you want!
either way, i expect this to change a bunch before 'release' :)
I now have things working on on the external ESP8266 via normal UART and the the particle argon on board ESP32 with the modified AT Firmware using the programming uart ! Still need to test external ESP32 with normal UART. Just trying to find a common set of code that works on all -- I'm close. If you are not in a rush I hope to have some updates later today and I can just add them to this PR or you can merge this and I'll create a new one -- or close this one and I'll start over with all my changes. Whatever works for you.
@ladyada I updated this to my latest working version mostly so you can see what I've been doing. I can use any of the AT Firmware options with this (external ESP8266 or ESP32) with the standart UART AT firmware or the onboard ESP32 in the Particle_argon with the modfied AT FIrmware)
One thing I had to do was comment out one of the checks done for the .send function. It turns out there are some tricky differences in the way the various AT firmwares respond and since we already verify the we received "SEND OK" it was not clear how much of this checking really was needed. I'll look into a way to re-instate it. The baudrate change seems to work well and is very useful. The various timeouts are just ones I adjusted but I'm really not sure what they have to be yet. You are welcom to merge this if you are happy with it or I can keep adding to it.
See if you think this is a good way to do this. espatcommands has an input parameter baudrate but it actually does not use it so I use it to allow you to switch the baudrate after it initializes. At 115200 I am getting a lot of dropped characters. it works much better at 9600 baud! We can change the baudrate of the ESP8266 or ESP32 permanetly via AT+UART_DEF but this way we can start at the 115200 default and set it if we want to. If the input baudrate matches the current baudrate setting, then it does not do anything so you don't have to use this.