UART stutters on startup

The SparqEE CELLv1.0 device.
Miq1
Posts: 22
Joined: Mon Oct 17, 2016 10:58 pm

Re: UART stutters on startup

Postby Miq1 » Sun Apr 23, 2017 4:12 am

Another idea: the Cell provides RFR and CTS pins, although at different voltages (1.65-1.95V). May I use these to implement a kind of flow control?

Miq1
Posts: 22
Joined: Mon Oct 17, 2016 10:58 pm

Re: UART stutters on startup

Postby Miq1 » Sun Apr 23, 2017 6:15 am

One more observation...

The Cell does work at lower baud rates, but not correctly. If I switch the baud rate to 19200, the output for "AT+COPN" is much shorter (177 lines) and several entries are missing that can be found when using 115200 (250 lines).

I would have expected to get all data with 19200, although slower, as the Arduino has much more time for processing.

This looks like the support for lower baud rates is not completely implemented, the internal logic seems to drop data if the receiving UART is not fast enough. I think this either needs to be solved or the use of lower baud rates should be prevented completely.

Oh boy... :roll:

User avatar
donjohnii
Site Admin
Posts: 686
Joined: Tue Jul 30, 2013 2:19 pm

Re: UART stutters on startup

Postby donjohnii » Sun Apr 23, 2017 12:06 pm

Hmm. Your last baud rate comment might be the strongest piece of evidence. It could be possible that the internal ZTE module is overflowing its own buffer outgoing. Because if you change the baud to lower and get even less, then that means it's not being handled properly on the other end.

I can try this on a RasPi and see what happens.

Another thought... i cant remember offhNd but can the arduino ur using be increased past 115200 or is that the highest?

Im not sure I'd blame the arduino adter the baud rate observation. But that is still a curious situation that the 64bytes wouldnt have been read... I'll look at your code.

A comment.... may want to ignore this issue when using an internal call and start to test over the network. May be troubleshooting issues that wont affect you in PROD

Miq1
Posts: 22
Joined: Mon Oct 17, 2016 10:58 pm

Re: UART stutters on startup

Postby Miq1 » Fri Apr 28, 2017 3:43 am

My hair is getting grayer and grayer while experimenting... :(

I did some tests with the auto baudrate feature (AT+ZBITRATE=1), but was not able to get the Cell reacting other than when I set the Arduino baud rate to 115200. Even then it took indeterminable time until the Cell reacted at all.
Current state is that I managed to close me out completely, I seem not to be able to talk to the Cell at all. I then tried to connect via USB in parallel, but as it seems the USB interface is inactive with the Cell connected to the power on the PCB.
Do you have any advice for me how to proceed?

[Update] Pulled the Cell from the PCB and connected it via USB to my PC (VBUS-Vin bridged). I am able to communicate from Putty. I noticed that AT+UART? resulted in "0, 0, 0, 1", what obviously means "Data mode". There are other modes (AT, Diag and Mux) - should the Cell be in one of these (AT?) instead?

The software version is reported as BD_ATTMF206AV1.0.0B12 - is that a recent one or may the Cell need a firmware upgrade?

The AT+COPN output has >1400 lines on Putty, so obviously I am losing tons of data even at 115200 baud on the UART.

[2nd update] Put the Cell back on the PCB and am able to communicate again - but only at 115200. AT+COPN delivers ~250 lines, so I am losing a mere 1150 here :shock:

User avatar
donjohnii
Site Admin
Posts: 686
Joined: Tue Jul 30, 2013 2:19 pm

Re: UART stutters on startup

Postby donjohnii » Fri Apr 28, 2017 8:52 pm

I think you're traveling far outside the bounds of operation here... if you stick with 115200 and communicate normally, you'll be fine. Maybe I'm taking you down the rabbit hole answering these questions, but you're using a debug command which may not be meant for dumping it out over uart... it's not even a command typically used for anything and as you found using the USB worked to get the data... probably for debugging.

Software is hardly ever upgraded on the UARTs due to the fact they have to be re-certified by external agencies when they do.

I think the main problem is switching up the baud rate, which is not recommended as I too have had issues doing that.

u063096
Posts: 6
Joined: Mon Oct 17, 2016 1:19 am

Re: UART stutters on startup

Postby u063096 » Fri Apr 28, 2017 9:27 pm

All said right, but why am I losing that much data at 115200 baud as well without ever touching the baud rate? 115200 is in fact not working properly, or so it seems.

To sort out any programming or Arduino based issues I will rig up a test where I will send data from the PC to that very UART the Cell is connected to, without any changes to the setup on the Arduino side. Based on the results we will know where to look next.

User avatar
donjohnii
Site Admin
Posts: 686
Joined: Tue Jul 30, 2013 2:19 pm

Re: UART stutters on startup

Postby donjohnii » Sat Apr 29, 2017 12:43 am

There is a difference depending on where the data is sourced.

The at command you're using is a debug command rather than one processed through the network and thus may not be traversing their buffering engine and seems like its just being dumped... probably overflowing their internal TX buffer.

I cant say for sure that this is what is happening, but i know that Ive sent a ton of data over the network and have never lost anything, so I would suggest not troubleshooting this issue unless you need that particular command and focus on the network.

u063096
Posts: 6
Joined: Mon Oct 17, 2016 1:19 am

Re: UART stutters on startup

Postby u063096 » Sat Apr 29, 2017 1:11 am

You may be right. There remains a nagging doubt nevertheless...

I will try to check the Arduino UART handling anyway and decide on the results what to do.

If you happen to talk to the ZTE guys, I would appreciate if you could mention my issues. Perhaps they have a golden hint ;)

Miq1
Posts: 22
Joined: Mon Oct 17, 2016 10:58 pm

Re: UART stutters on startup

Postby Miq1 » Sat Apr 29, 2017 6:48 am

Okay, I nailed it down, I think. :(

I connected the Cell via UART to the PC and ran Putty against it. AT+COPN now results in exactly the same data losses that the Arduino showed. So it definitely is a problem inside the Cell. If connected via USB the buffering seems to work, via UART it does not.

I also put an idle loop counter into my Arduino sketch that counts up each loop cycle where there was no data in the UART buffer. The counter goes into the millions while receiving the AT+COPN output, so the Arduino in fact has very few to do while stuffing the data into the buffer.

Nothing to make me feel secure on the communication with a network source, I must confess. If I had not already done the PCB for two prototypes I would be considering another module.

Please, please address that to ZTE - I am still hoping there may be a remedy we did not see so far.

User avatar
donjohnii
Site Admin
Posts: 686
Joined: Tue Jul 30, 2013 2:19 pm

Re: UART stutters on startup

Postby donjohnii » Sat Apr 29, 2017 3:24 pm

Do you have two accounts?

Why do you need that particular command to work... why not ignore that particular issue and move on?

I can ask them, but I assume they'll respond in kind... it overflows the internal buffer but doesn't impact normal network operation. What are you looking to do that you can't do now?


Return to “CELLv1.0”

Who is online

Users browsing this forum: No registered users and 1 guest