Are HTTP request responses through events size limited?


#1

Bit of background - I’m trying to create a Service Manager for OpenHAB that can end up receiving 75kB json responses. They could in theory be bigger as it’s a list of all the devices that are attached to the OpenHAB system.

What I’ve noticed is these ‘large’ responses never get to my locationHandler() function that handles events. Is there a size limit on event data that means that SmartThings is throwing my request response away? I notice I get some events that have register:null in them when I do these requests.

My conclusion about it being a size issue relates to the fact that requests of the same type work with smaller data responses (say 33kB)

It’s a bit annoying that you get no error or indication of what is going on. Any advice on this matter would appreciated!


(Geko) #2

I wouldn’t be surprised. SmartThings V1 hub is running on a PIC32 micro controller with 128 KB of RAM. So 32 KB buffer for HTTP response sounds about right. V2 has much more RAM, but if the buffer size was hardcoded, it may still have the same limitation.


(Patrick Stuart [@pstuart]) #3

It may not be. It just might not log out. Logging limits the size of responses for whatever reason.

It might be there. Just save it to a state variable and check that in events.


#4

Well, none of the subsequent functions are called when a large response is received - i.e. it’s not parsed as JSON correctly like other responses are. Regarding the logging I’ve noticed for long messages in the logging it just says [TRUNCATED].

@geko That’s interesting to know that V1 was running on such limited hardware. Given my v2 box has 2 USB host ports on the back I would have thought it would be running something a bit higher spec’d but I can’t find any details.


(Geko) #5

V2 is running Linux on Freescale MX6 with 512 MB SDRAM, but there’s no guarantee they bothered to increase the buffer size. :slight_smile: