-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Having httplib callback option #161
Comments
(As an update, apparently the library -does- offer the callback (pResponseCallback), but I don't think it supports not supplying a pointer to a buffer that is not the total size of the transfer) |
The HTTP POST request is only size-limited at the AT interface for the "POST data command", That said, using the HTTP Client in the module is always a bit of a compromise: in the cellular case, as indicated, it does its "non-length-limitedness" by using the module file-system as an intermediate, which means it is not as fast as it could be and for very large things (100's of kbytes) you might hit a module file-system limit. If you have lots of space in your MCU file system, so there is no particular advantage in using the module's file system, then it may be better to download directly, as you say. AlexMaron had a similar problem and I wrote him some sample code that did the HTTP file download over a secure socket to his MCU where he could store it in his own file system, which he managed to use successfully: you might find that a useful reference. EDIT:
Yes, that's true, I had thought about having some sort of "chunked" callback at this level, since the data coming from the module is in any case "chunked". Will put on the TODO list, a bit lower down :-). |
Thanks for that clarification, and for the sample code, very useful! I think I can then use the http library for everything aside from really big files, and use direct socket calls for the big ones.
Have you experienced issues at higher baudrates for the sara-R4 before? Anyway thanks already for the feedback |
No, but unfortunately I don't anticipate that SARA-R422, of itself, would present a problem with higher baud rates, it is more that the dynamics of the system as a whole become more important, are more stressed: things like call-back reaction time, potentially RTOS tick rate, task occupancy, etc. likely all matter rather more. Another "suck it and see" I'm afraid. |
Hi Arnout. I am now implementing the "chunked" HTTP Client API that you asked for here. I have posted what I think the API might be: master...preview_http_chunked_api_rmea If you have time to take a look I would be interested in your feedback. Not an issue if you don't have the time. |
The chunked API is now available on |
Hi,
For my application, I'd require a firmware update of HTTPS. I am considering using the HTTP functionality from the ublox modem for this, and using the APIs in ubxlib.
However:
For this last part, in the microcontroller world, it is not possible to supply a RAM pointer for huge transfers. Instead, when a piece comes in, some callback function should be called to then write this to flash. Currently, the HTTP client library API does not support this, although the module does.
(A workaround could possibly be to split the HTTP transfer up into mulitple pieces, supplying an offset in the haeder, OR, just reverting to socket mode)
Given the POST HTTP HW limitation, I'll probably revert to sockets anyway, but posting here anyway for reference.
Kind regards,
Arnout
The text was updated successfully, but these errors were encountered: