Generic Event Upload Design Notes
Project: Device Interface Document (New Version) | page_id: 1000
-
intelligence_enabled == 2 // Custom event upload enabled
-
ai_upload_address custom upload configuration address
Base directory: "/tmp/alarm"
Each trigger corresponds to a folder under the base directory: "/tmp/alarm/2006-01-02T15-04-05"
If "/tmp/alarm/2006-01-02T15-04-05/finish.txt" under this event folder is detected, this event is complete
Read "/tmp/alarm/2006-01-02T15-04-05/info.txt" to get the passthrough parameters: alarmType=io&customValue1=abc, etc.
The default image name is snap.jpg; do not modify it unless there is a special requirement
Upload URL parameters
[http://192.168.0.15/api/upload/address?userValue1=a&userValue2=b&id=serial number]&timeSeconds=[upload time in seconds]&alarmTime=[event time]&alarmType=io&customValue1=abc&token=[signature]
Token signature: the key uses the interface key and can be modified by yourself
userValue does not participate in the signature
Upload file:
Content-Type: multipart/form-data
Content-Disposition: form-data; name="filename"; filename="snap.jpg"
Content-Disposition: form-data; name="filename1"; filename="snap1.jpg"
If the upload fails 3 times, it is discarded