These are chat archives for SmingHub/Sming

Feb 2016
Feb 21 2016 07:43

For now focus on the main functionality of downloading the data and save it in a filestream with the name provided in the content-disposition header. Then we have the time to make a design decision on the callback.
There are some things to figure out. Not complete but thoughts from now :

  • Just the multipart information is not enough to let the application decide. At least it will need the IP from the sender to prevent abuse.
  • How to get the info back from the callback. Just info of the location or do we let the application create a stream object which can be used to save the file.
  • Do we need an "upload complete" callback too, or are we adding the result to the httprequest object as request parameter. f.e "X-Content-UploadResult:"
  • My idea now is to have a separate callback for the Upload request. Adding it to the addpath looks like a "misuse" of something available.

For one or more files. Isn't that having the "upload callback/uploading" sequence more than once in the processing of the http-request ?

Feb 21 2016 13:10
hi, i'm not completely sure how your dev process works.. as far as i understood it's this way: i make a personal branch off the development branch, make my changes and then a pull request. Is this ok so far?
Also the naming.. it's basic lib for the apa102 LED driver. Should the example have a 'Basic' name or better a 'LED' name?
Feb 21 2016 13:13
@HappyCodingRobot i think Basic_apa102 could be fine
what is driver? based on neopixel or ?
Feb 21 2016 13:14
@alonewolfx2 ok
no.. as far as i know, the Neopixel based on the WS2812/11 chip. This would be for the APA102 chip
quite similar to the Neopixel lib but for an other driver chip..
Feb 21 2016 13:19
@alonewolfx2 did i understood your dev process correct ?
Feb 21 2016 13:22
right. but can neopixel library work with apa102?
Feb 21 2016 13:25
afaik not .. WS2812 uses one wire to communicate, APA102 uses seperate clk and data (SPI mode 3 like)
Feb 21 2016 13:28
which one fast?
Feb 21 2016 13:33
i'm not sure how fast it is rated .. the data sheet has no detailed info about max serial clock
i used them at bit clock speed from 100kHz up to 4MHz
Feb 21 2016 15:32
If I do awebsocket command using comandhandler and websocketcommands, what is the best way to return a val
like if I wanted to measure using my ultrasonic, and return that val, using websockets back (or something), is there a listener to put on a commandHandler? for return values?
or shoudl I just add a listner on my carcommand class, that can send data back (own implementation - not something generic)
this is for a responsive webpage for instance, where you want to update temp, using websocket on the page, or in android app
Patrick Jahns
Feb 21 2016 16:30

Thanks for the input: Actually I might need help with the filestream. I am not too familiar on how to properly use filestreams (yet). But will look into documentation and example implementations
On your thoughts:

  • is there a way to provide the client IP already? and why IP to prevent abuse? It would also be possible to include a password (difficult since multipart don`t necessarily have an order, so if the file is sent before the password, we need to temporarily safe it.) Or what I find better, would be to use the http basic auth. That way we can also secure other resources

  • I do not agree with the seperate callback - paths can have different functions in HTTP servers. It is up to the server to decide if a certain request (GET/POST) is actually valid for a path. Let`s say a user visists /upload - with a get he sees the form; with a post the data is actually uploaded to the same resource URI

Can you elaborate what you mean by "For one or more files. Isn't that having the "upload callback/uploading" sequence more than once in the processing of the http-request ?"