Boron LTE connectivity problem

I am trying to use this library (https://github.com/ScruffR/uCamIII/blob/master/exampleProjects/uCamTest/uCamTest.ino), which takes an image using uCam III and can upload it via serial or tcp.

Both serial and tcp works on Photon.
On Boron LTE the serial works, but the tcp doesn’t. It does send the first ~2.5Kb of the image, but then stops and refuses to proceed past Package 11 (once it got to Package 13) - see logs below.

0000032771 [app] TRACE: getJpegData
0000032772 [app] TRACE: sendCmd
0000032773 [app] INFO: sendCmd: AA 0E 00 00 07 00
0000032821 [app] INFO: Package 8 (506 Byte) -> TCP x.x.x.x:port
0000032824 [app] TRACE: getJpegData
0000032825 [app] TRACE: sendCmd
0000032827 [app] INFO: sendCmd: AA 0E 00 00 08 00
0000032874 [app] INFO: Package 9 (506 Byte) -> TCP x.x.x.x:port
0000032878 [app] TRACE: getJpegData
0000032880 [app] TRACE: sendCmd
0000032881 [app] INFO: sendCmd: AA 0E 00 00 09 00
0000032928 [app] INFO: Package 10 (506 Byte) -> TCP x.x.x.x:port
0000032931 [app] TRACE: getJpegData
0000032932 [app] TRACE: sendCmd
0000032933 [app] INFO: sendCmd: AA 0E 00 00 0A 00
0000032981 [app] INFO: Package 11 (506 Byte) -> TCP x.x.x.x:port
0000087671 [gsm0710muxer] ERROR: The other end has not replied to keep alives (TESTs) 5 times, considering muxed connection dead

I have seen several topics about Boron connectivity issues, but I thought those got fixed with the newer firmwares.
I am running the latest firmware, v1.4.2, being connected to the AT&T network in the US.

The problem is fully reproducible, it happens every single time and I have tried it over a dozen times at least.

It sounds like there might be some more unresolved Boron connectivity issues!?

1 Like

It seems the issue might be around the data buffer causing the stalling as explained in this thread Maximising cellular data streaming rates on Boron

Once I add a 400ms delay between the writing of each packet, then it works, it doesn’t stall after Package #11.
Interestingly if I try to send the second time without hard reset (eg reboot), the second time it goes a lot slower. I am not yet sure whether this is caused by the delay() function behaving differently the second time or something else.

The uCamIII library features a TCPClientX class that takes a flushDelay parameter that is defaults to 100 milliseconds whenever a potential buffer overflow is detected.
You could try setting that to a higher value and see if that helps.
This would only insert the delay when an overflow was detected and not between every write.

Thanks.
Unfortunately setting a higher flushDelay did not help.
Even after setting the flushDelay to 5000 (eg 5s), the sending stalls after Package 11.
Adding a 300-500ms delay after each packet sent works (when the network is busy, it needs a 500ms delay to complete and not to start stalling at some point).

Settings 5000ms directly in the write function:

size_t TCPClientX::write(const uint8_t *buffer, size_t size)
{
  size_t pos;
  for (pos = 0; pos < size;)
  {
	if (size - pos < chunkSize) chunkSize = size - pos;
    int sent = TCPClient::write(&buffer[pos], chunkSize);
    // 300ms delay added after writing each packet due to the issue explained at https://community.particle.io/t/maximising-cellular-data-streaming-rates-on-boron/46325/6
    //delay(300);
	if (sent == chunkSize)
	  pos += chunkSize;
	else if (sent == -16) 
	  for (uint32_t ms = millis(); millis() - ms < 5000; Particle.process());
  }
	return pos;
}

Error is still the same:

0000069263 [app] TRACE: getJpegData
0000069264 [app] TRACE: sendCmd
0000069265 [app] INFO: sendCmd: AA 0E 00 00 07 00
0000069313 [app] INFO: Package 8 (506 Byte) -> TCP x.x.x.x:port
0000069316 [app] TRACE: getJpegData
0000069317 [app] TRACE: sendCmd
0000069318 [app] INFO: sendCmd: AA 0E 00 00 08 00
0000069366 [app] INFO: Package 9 (506 Byte) -> TCP x.x.x.x:port
0000069413 [app] TRACE: getJpegData
0000069414 [app] TRACE: sendCmd
0000069416 [app] INFO: sendCmd: AA 0E 00 00 09 00
0000069463 [app] INFO: Package 10 (506 Byte) -> TCP x.x.x.x:port
0000069465 [app] TRACE: getJpegData
0000069466 [app] TRACE: sendCmd
0000069467 [app] INFO: sendCmd: AA 0E 00 00 0A 00
0000069515 [app] INFO: Package 11 (506 Byte) -> TCP x.x.x.x:port
0000116962 [gsm0710muxer] ERROR: The other end has not replied to keep alives (TESTs) 5 times, considering muxed connection dead
1 Like

Too bad, but thanks for trying - I have no way to test LTE here.

No problem, thanks.
At least it (mostly) works with the delay(500) after each packet.
The only issue is, that the required delay depends on how busy the network is and if I set it to too low then the sending and the whole device stalls, requiring a physical reset, which means bad enough network conditions can potentially stall the device with whatever delay I set requiring a physical visit to restart… not very good.

For LTE I’d have to defer to @rickkas7 or @marekparticle

Hi @evk02! I’m currently working with another customer to resolve a TCP streaming issue. Sorry to place some investigative burden on you, but are you able to produce an application with which I can reproduce this issue? As small as possible, please! Feel free to DM me, or (better) to open a ticket here (so I can track it over time - I’ll keep this post up to date).

Hi @marekparticle,
I am actually just running the example from @ScruffR’s ucamIII library (see https://github.com/ScruffR/uCamIII/blob/master/exampleProjects/uCamTest/uCamTest.ino).
The problem, that to run his example you would need a uCamIII and also a TCP Socket server running somewhere. He included a NodeJS socket server in his library, but I wrote a Python one for myself.

Tonight I can write a simplified example of his, so it would work without a uCamIII - as any large amount of data sent through TCP should trigger this issue, it doesn’t need to be an image from uCamIII.

The question whether can you run the NodeJS socket server or a Python one on a public server so the Boron can connect to it?
If not, I will setup a public TCP socket server for you to hit.
Let me know.

Note to anyone who is watching that we’re dealing with this with a support ticket for back-and-forth. Will update upon resolution.

1 Like