0

Upload Logs with Simple File Networking, but nothing is uploaded

Hey Everybody, I have 5 hd224 players with the latest firmware , that play media when 1 of  4 gpiobuttons is pressed (per brightsign) configured via simple file networking. I would like to upload the media count every day to my own server. I know how to get to the userVariables.db via the diagnostics webpage on the brightsign but since I can't reach into the network with the players from the internet, I need to upload it. As I understand it this should be possible by uploading the logfile. I have configured the Log Handler URL and I see the POST request coming in. But there is nothing in the request body. no text ,no files, nothing.On the brightsign in the logfiles It tells me upload was successful.

If I use a thirdparty tool (postman, paw ,insomnia ) or form to post data to the handler everything works ok.

Does the upload log handler script need to be on the same subdomain as the presentation files. (so does it need to be relative) . And can I use https?
Right now I serve the presentations from files.myowndomain.com
but the log upload handler lives on logger.myowndomain.com

Again I DO see the post request coming in on the second domain, but the request is empty.

I can't find in the documentation how the brightsign uploads its log file.
I assume it's a multipart-form encoded request with a file.

Can anybody help me figure this out?

kind regards
Patrick

4 comments

  • 0
    Avatar
    Lyndon

     

    It's quite possible that the simple networking log file uploads to a loghandler isn't working. Which brightauthor version are you using currently? I know there was a time when the log handler logic was just a place holder for simple file networking and it hadn't been implemented yet. 

  • 0
    Avatar
    patrick gutlich

    I'm using BrightAuthor 4.7.2.5

    I dug a little deeper and I can see the the Brightsign sends the following headers (anonymised)

    'Host' => 'my.somedomain.com',
    'User-Agent' => 'BrightSign/XXXXXXXXXXXX/7.1.95 (HD223)',
    'Accept' => '*/*',
    'Accept-Encoding' => 'deflate, gzip',
    'enableUnsafeAuthentication' => 'False',
    'account' => 'ACCOUNT',
    'DeviceID' => 'XXXXXXXXXXXX',
    'DeviceModel' => 'HD223',
    'DeviceFamily' => 'pantera',
    'DeviceFWVersion' => '7.1.95',
    |'DeviceSWVersion' => '7.10.5',
    'CustomAutorunVersion' => '7.8.0',
    'utcTime' => '2019/07/10 11:49:27.651',
    'Content-Type' => 'application/octet-stream',
    'Content-Disposition' => 'form-data; name="file"; filename="BrightSignLog.XXXXXXXXXXXX-190709012.log"',
    'Content-Length' => '2755',
    'Expect' => '100-continue',

    I'm using the Php Laravel Framework,  but even if I just use php's native $_FILES it is empty,
    I'm now guessing that the brightsign isn't actually sending the file.
    (maybe because of the 'Expect' => '100-continue' header?

     

     

  • 1
    Avatar
    Simon Holt

    I managed to find another loghandler script example where it looks for the data in HTTP_RAW_POST_DATA. Maybe you will have luck finding it there?

    Digging a bit deeper, it's prob better to use the code below. See answer here

    file_get_contents('php://input'); 
  • 0
    Avatar
    patrick gutlich

    Thanks for the tip Simon, I got it working now.

    So for other people ending up on this page wanting to use Simple File Networking Snapshots with a Laravel application
    Use the following in your controller that handles a put request :

    Storage::disk('local')->put('public/snapshots/'.$yourfilename, $request->getContent(true));
Please sign in to leave a comment.