• AVR Freaks

Helpful ReplyHot!Harmony HTTP: Setting RX Buffer failed

Author
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
2020/07/08 07:17:24 (permalink)
0

Harmony HTTP: Setting RX Buffer failed

I have a Harmony 3 project up and running on a PIC32MX795F512L but the http post doesn't work correctly, diging deeper into the issue it appears that the RX buffer is not setting correctly in the initialisation. I have also tried to change the RX buffer size from within the post execution as a test, but it always fails and returns 0. Test line is:
 
NET_PRES_SocketOptionsSet(connHandle, TCP_OPTION_RX_BUFF,10);
 
Has anyone else seen this issue? 
 
 
#1
rainad
Moderator
  • Total Posts : 1387
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/08 08:02:37 (permalink)
0
Not sure what you're trying to achieve but setting a TCP RX buffer to be 10 bytes only will never work.
You mean to say 10 Kbytes?
 
#2
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/08 08:29:39 (permalink)
0
Sorry the low value was a result of wanting to test a smaller allocation incase I was running against an allocation issue, it was 3500.
#3
rainad
Moderator
  • Total Posts : 1387
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/08 10:15:02 (permalink)
0
If it fails when trying to set the buffer to 3500, probably the allocation for that buffer fails.
If you have the console connected, type the command:
>heapinfo
That will give us an idea of what's going on.
Anyway, check the project heap and the TCP/IP heap size.
 
#4
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/10 07:23:10 (permalink)
0
OK, well it just gets weird, I have connected the console in debug output mode by Uart and set the TX buffer to 8k. I get the output:
 
TCP/IP Stack: Initialization Started
 HTTP: Setting TX Buffer failed: 0
 HTTP: Setting RX Buffer failed: 0
 HTTP: Setting TX Buffer failed: 1
 HTTP: Setting RX Buffer failed: 1
 HTTP: Setting TX Buffer failed: 2
 HTTP: Setting RX Buffer failed: 2
TCP/IP Stack: Initiali
 
I would have thought it was crashing on the evidence of the final line, but the webpage appears fine except for post operation. Dynamic variables etc. work
It appears I can't type the command in to get the heap info.
#5
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/10 07:50:42 (permalink)
0
I think I am there now, I disconnected the debug and attached command. I am getting:
>heapinfo
Heap type: internal. Initial created heap size: 44896 Bytes
Allocable block heap size: 8576 Bytes
All available heap size: 9104 Bytes, high watermark: 35792
Last heap error: 0x0
Trace info:
Module:    1, totAllocated: 12560, currAllocated: 11456, totFailed:    MoMMoMoMMoMMoM
#6
rainad
Moderator
  • Total Posts : 1387
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/10 13:14:10 (permalink)
0
It looks like there's no allocation error, something else is going on.
Although having only 8 KB available seems obvious that you won't be able to get 8 buffers 3500  bytes each.
What do you have in MHC set for the HTTP buffers, 3500?
Increase the project heap and the TCP/IP heap, add like 32 KB to it. Do you get the same error?
 
Also, please update to the latest Harmony version, 3.6.0. This truncated console output does not help.
 
 
#7
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/13 02:34:47 (permalink)
0
I have upped the heap size, but still the same error:
 
>heapinfo
Heap type: internal. Initial created heap size: 74896 Bytes
Allocable block heap size: 38576 Bytes
All available heap size: 39104 Bytes, high watermark: 35792
Last heap error: 0x0
Trace info:
Module:    1, totAllocated: 11520, currAllocated: 11456, totFailed:  MoMMoMoMMoMMoM
 
I am on the latest version of Harmony, so I don't know why the console output is truncated.
#8
rainad
Moderator
  • Total Posts : 1387
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/13 06:54:57 (permalink)
0
Please try the 'tcpinfo' command and let's see how the TCP sockets are configured.
You need to enable the TCP Commands in MHC and regenerate.
 
P.S. I notice that you specify the HTTP data size as 2500. Any particular reason for such a large buffer? Please try with a smaller value, like 500 and let's see what happens.
 
You can also set a breakpoint in the tcp.c::TCPIP_TCP_FifoSizeAdjust() and see why the call fails.
 
I'll try to see if there's any known issue with the console output on the PIC32MX platform.
You're using the default UART2 for the console?
And what board is the one you're using?
 
post edited by rainad - 2020/07/13 07:06:26
#9
Chris79
Starting Member
  • Total Posts : 35
  • Reward points : 0
  • Joined: 2013/12/06 03:20:35
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/13 07:56:43 (permalink)
0
Sorted :-)
 
Bit annoying this one, but the "Enable TCP sockets dynamic options" checkbox was unchecked. I assumed the http sockets and tcp sockets were dealt with separately in the configurator, probably because I am more used to the old MLA. I would also have incorrectly assumed that if I didn't want to adjust what is set in the startup configuration then it didn't need to be enabled.
 
Do I need to account for http sockets in the tcp sockets or is the field "Max number of Simultanious Connections" within the httpnet server config actually the socket count?
 
Thanks for the help so far Rainad. 
#10
rainad
Moderator
  • Total Posts : 1387
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony HTTP: Setting RX Buffer failed 2020/07/13 08:21:28 (permalink) ☄ Helpfulby Chris79 2020/07/13 08:42:35
0
Good to hear you sorted it out.
Yes, it's one of those build time settings to leave functionality out and obtain a smaller code.
 
The TCP sockets number is the total number of sockets created by TCP, so HTTP (and other services) will use some of them. Basically
HTTP connections + FTP connections + ... + app sockets <= TCP sockets
otherwise HTTP or other module initialization will fail.
 
#11
Jump to:
© 2020 APG vNext Commercial Version 4.5