These are chat archives for SmingHub/Sming

20th
Feb 2016
alon24
@alon24
Feb 20 2016 12:03
so how do I make a pr if I want to add infoscreens to sming?
I cloned rtos sming, and also added and compiled the code in sming/libraries
so now what?
I created a local branch, and commited to it, but i cannot push to sming, since I do not have rights, so how?
hreintke
@hreintke
Feb 20 2016 12:21
@alon24 : if you are in your github rtos clone on local branch there should be an option with "new pull request"
That will create a PR in the main repo (smingHub/SmingRTOS) with the updates from your branch.
Keep the local branch open. If you commit to that branch later. These will be added to the PR automatic.
Patrick Jahns
@patrickjahns
Feb 20 2016 12:25
@hreintke is it okay if we catch up here about #552 (File upload?)
alon24
@alon24
Feb 20 2016 12:28
@hreintke wait, maybe i do not understand
do I need to fork sming rtos? because I only cloned to local disk, added files, and created branch in local disk
when I try to do create pr in sourcetree it says:
This message was deleted
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream origin refs/heads/infoscreen:refs/heads/infoscreen 
Pushing to https://github.com/SmingHub/SmingRTOS.git
remote: Permission to SmingHub/SmingRTOS.git denied to alon24.
fatal: unable to access 'https://github.com/SmingHub/SmingRTOS.git/': The requested URL returned error: 403
Completed with errors, see above
alon24
@alon24
Feb 20 2016 12:37
SmingHub/SmingRTOS#68
hreintke
@hreintke
Feb 20 2016 12:42
@alon24 : Yes that is the way to submit PR's
But your PR has an issue compiling. All PR's submitted are checked to correct compiling automatic.
Push the "details" to see why it failed :
infoscreens.PNG
@patrickjahns : Sure OK to follow up here
alon24
@alon24
Feb 20 2016 12:55
please check it now
hreintke
@hreintke
Feb 20 2016 13:07
merged
alon24
@alon24
Feb 20 2016 13:12
Dso now just need someone to test it,
Who wants to test infoscreens as library?
hreintke
@hreintke
Feb 20 2016 13:31
@alon24 :
Just merged mqtt client + core patches for it.
Can you test and feedback results ?
alon24
@alon24
Feb 20 2016 13:45
I will soon
ystrem
@ystrem
Feb 20 2016 14:44
@hreintke It work :D
Patrick Jahns
@patrickjahns
Feb 20 2016 14:46
@hreintke
About the extension on adpath - this would allow to intercept the automatic processing of postdata
Otherwise I wouldn`t know how to intercept the upload for OTA
as far as I could tell, the handler function defined with addpath is only invoked after the request is processed
Or is it feasable to extend the httprequest as an httpupdate request and register a different handler?
alon24
@alon24
Feb 20 2016 14:52
@ystrem mqtt or infoscreens work?
ystrem
@ystrem
Feb 20 2016 14:59
mqtt
Phaeodaria
@Phaeodaria
Feb 20 2016 15:40
hi. has anyone ever seen '3fff0fa0 already freed' after returning from a http request handler?
i'm wondering if this is related to a limit of 307 http requests after which the http server on the esp stops responding the requests for some time
hreintke
@hreintke
Feb 20 2016 17:23
@patrickjahns :
I am not sure whether an automatic accepting of upload is the right way to go. That would mean that an external sender can fill the esp or install software.
I was thinking of an application callback/delegate when there is a upload request. Then the application decides on whether accepting the upload and where it should go.
Or is this what you want to achieve with the extension to addpath. If so can you give an example how you see it work.
Patrick Jahns
@patrickjahns
Feb 20 2016 17:33
@hreintke
The callback/delegate approach seems to be what I wanted to create [
I am not yet too familiar with the sming structure and what it provides - just exploring how I could handle file upload for now.
But my idea was, that we extend the addpath so we pass a function pointer that is called back when we have a upload (multipart request)
Right now the callback/delegate happens after the request has been processed (that`s what I grasped from reading the serial output and looking at the code)
For fileupload we need to intercept between parseHeader and parsePostData
Patrick Jahns
@patrickjahns
Feb 20 2016 17:38
I propose something tovoid HttpServer::addPath(String path, HttpPathDelegate callback, bool upload = false, HttpUploadDelegate)
ystrem
@ystrem
Feb 20 2016 17:40
Is there callback for mqtt.publish ?
hreintke
@hreintke
Feb 20 2016 19:55
@patrickjahns :
We are on the same line for the functionality we want to provide. Your idea on using the addpath is an interesting one.
We need to provide enough information to have the application make a reasonable decision.
The HpptRequest object could be the right one for that.
Will give it some thoughts and get back quickly to you.
Did you had a look at the filestream class too ? Would be great if you can take the update for that in your activities.
First on the addpath /callback: we need a way to get the "response" from the application.
Like : accept yes/no, the filename to save (or flash location).
Is there a specific response we need to provide on the http level when we disallow the upload ?
Patrick Jahns
@patrickjahns
Feb 20 2016 20:10
For response codes I`d say 400 - Bad Request or 405 - Not allowed
patrickjahns/Sming@7d2f5a9
I`ve been working on an initial part of it - rough around the edges
but basically using the HttpRequest Object and then wanting to parse the multipart information into a String HashMap
I guess from there on we can callback to the user?
BRB
Patrick Jahns
@patrickjahns
Feb 20 2016 20:27
With Information I mean the Multipart header i.e.
--boundary
Content-Disposition: form-data; name="update"; filename="2_avrm_denon_osd_dsp_modi.jpg"
Content-Type: image/jpeg

[actual data]
--boundary--
This way we can provide Content-Disposition, name - and if it is a file and if it has a content-type
That should be plenty of Information for the delegate callback function to decide on ?
We just need to work out, if we really allow only 1 file at once, or several files after each other. (1 file is way easier to implement and I think should suffice for most use cases")