A quick result ahead: 115200 baud works indeed.
donjohnii wrote:Default baud is 115200, that's faster than your 38400 and is default for the module
Yes, of course. The reason I tried using lower baud rates is the number of things the Arduino will have to do while receiving data. If I got a couple of milliseconds between looks into the UART buffer that would make my life easier. Thus I would like to slow down the Cell a bit
donjohnii wrote:Anytime you're dealing with clocks you have to look at the spec sheet of the MCU to figure out what offsets the baud rate has and every baud rate has a different offset based on the crystal/clock being used - it's very possible there is a positive skew on one device and a negative one on the other which causes a funny condition in some cases. I'm not saying that's the problem here, but it's possible and I've seen this type of issue in other systems.
Live and learn... I never encountered such thing before.
donjohnii wrote:What are you trying to do in your code... are you jumping around bauds when an & hits? That doesn't seem like a good idea... baud rates are much more finiky than you're making it out to be in this example. Hardcode in config and never change type of idea. And I've definitely seen on the cellular module if you switch up bauds incorrectly you will crash it.
That was done for test purposes only, I wanted to be able to switch rates without having to re-compile and upload the sketch again.
donjohnii wrote:Your code isn't bad, but there are some changes that should happen... move the configuration items out of the loop so you're not redeclaring continuously, make the while an if so it processes charaters from the CellOne and Serial ports more equally. This is also because the Arduinos conduct themselves in a strange way on some of the devices - for example, getting stuck in the while loop within the main loop could potentially impact the clock due to sharing of clock resources... and there is an ISR for the Serial inputs that should probably be utilzied as well instead of the main look, but that's more a preference I guess.
The variable declarations are "static", so they will be executed only once on startup (so I learned my C++). The read from Serial will be much slower than the data coming in from the Cell, since I used the Serial input only to type AT commands, that's why there is an if and the read from the Cell has a while loop. I am using a MKR1000 Arduino, so both serial interfaces are hardware based with their own respective 64 character buffer, so I thought that would be sufficient to catch all input on both lines.
One more reply to your next post coming