commonpike / eyefiserver

Automatically exported from code.google.com/p/eyefiserver
0 stars 0 forks source link

The server won't accept images #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have tried to install the software and it seems to be working. It talks to 
the camera (sometimes) but it never downloads any images.

I have copied the upload key out of the XML file as instructed

XML:
<UploadKey>08e12cd093015010856040d8b7b3c254</UploadKey>

CONF:
upload_key:08e12cd093015010856040d8b7b3c254

I set the download path to /tmp just to be sure there were no access rights 
issues. I will switch that out later.

Monitoring the log file gives me this:

[11/17/12 07:56PM][main] - Eye-Fi server started listening on port 59278
[11/17/12 07:56PM][get_request] - Incoming connection from client 192.168.1.130
[11/17/12 07:56PM][do_POST] - POST /api/soap/eyefilm/v1 HTTP/1.1
[11/17/12 07:56PM][do_POST] - Headers received in POST request:
[11/17/12 07:56PM][do_POST] - content-length: 412
[11/17/12 07:56PM][do_POST] - soapaction: "urn:StartSession"
[11/17/12 07:56PM][do_POST] - connection: Close
[11/17/12 07:56PM][do_POST] - accept: text/xml, application/soap
[11/17/12 07:56PM][do_POST] - user-agent: Eye-Fi Card/5.0017
[11/17/12 07:56PM][do_POST] - host: api.eye.fi
[11/17/12 07:56PM][do_POST] - Attempting to read 412 bytes of data
[11/17/12 07:56PM][do_POST] - Finished reading 412 bytes of data
[11/17/12 07:56PM][do_POST] - Got StartSession request
[11/17/12 07:56PM][startSession] - Delegating the XML parsing of startSession 
postData to EyeFiContentHandler()
[11/17/12 07:56PM][startSession] - Extracted elements: {'transfermode': 
u'16418', 'macaddress': u'0018562dde44', 'cnonce': u'f9997928
7a9d337813a95025cf725064', 'transfermodetimestamp': u'1352504750'}
[11/17/12 07:56PM][startSession] - Setting Eye-Fi upload key to 
08e12cd093015010856040d8b7b3c254
[11/17/12 07:56PM][startSession] - Concatenated credential string (pre MD5): 
0018562dde44f99979287a9d337813a95025cf72506408e12cd09301
5010856040d8b7b3c254
[11/17/12 07:56PM][do_POST] - StartSession response: <?xml version="1.0" 
encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://
schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><StartSessionResponse 
xmlns="http://localhost/api/soap/eyefilm"><credential>2f7ae7
6baddd7d993b549d08f3577379</credential><snonce>99208c155fc1883579cf0812ec0fe6d2<
/snonce><transfermode>2</transfermode><transfermodeti
mestamp>1230268824</transfermodetimestamp><upsyncallowed>false</upsyncallowed></
StartSessionResponse></SOAP-ENV:Body></SOAP-ENV:Envel
ope>
[11/17/12 07:56PM][get_request] - Incoming connection from client 192.168.1.130

I see this in the reply which makes me think the upload key is not correct but 
it is copied/pasted right out of the settings.xml file from the windows box 
that does work properly.

<upsyncallowed>false</upsyncallowed>

I have no idea what to do next to even start debugging this issue.

Original issue reported on code.google.com by schwora...@gmail.com on 18 Nov 2012 at 4:03

GoogleCodeExporter commented 8 years ago
I'm experiencing exactly the same issue, the only difference I can see is my 
Eye-Fi card's firmware is 5.0009.
I'm very new to python, and this code is written with a good understanding of 
the BaseHTTPServer library, but it looks like we're not getting a response from 
the EyeFi card from the "StartSession response"

If anybody reading this has their system working, please share your log file 
with us so we can see what we're missing.

I'll attempt to decipher what's missing based on a wireshark trace of the 
prescribed software, but I'm doubtful I'll know what I'm looking at.
I'll be sure to post here if I find a solution

Original comment by nymp...@gmail.com on 3 Dec 2012 at 10:20

GoogleCodeExporter commented 8 years ago
I see the same behavior:
[12/30/12 07:02PM][runEyeFi] - Eye-Fi server started listening on port 59278
[12/30/12 07:04PM][get_request] - Incoming connection from client 192.168.2.15
[12/30/12 07:04PM][do_POST] - POST /api/soap/eyefilm/v1 HTTP/1.1
[12/30/12 07:04PM][do_POST] - Headers received in POST request:
[12/30/12 07:04PM][do_POST] - content-length: 412
[12/30/12 07:04PM][do_POST] - soapaction: "urn:StartSession"
[12/30/12 07:04PM][do_POST] - connection: Close
[12/30/12 07:04PM][do_POST] - accept: text/xml, application/soap
[12/30/12 07:04PM][do_POST] - user-agent: Eye-Fi Card/5.0018
[12/30/12 07:04PM][do_POST] - host: api.eye.fi
[12/30/12 07:04PM][do_POST] - Attempting to read 412 bytes of data
[12/30/12 07:04PM][do_POST] - Finished reading 412 bytes of data
[12/30/12 07:04PM][do_POST] - Got StartSession request
[12/30/12 07:04PM][startSession] - Delegating the XML parsing of startSession 
postData to EyeFiContentHandler()
[12/30/12 07:04PM][startSession] - Extracted elements: {'transfermode': 
u'33314', 'macaddress': u'00185648531c', 'cnonce': 
u'2c551d51eb0a947b2fda3563b4722a24', 'transfermodetimestamp': u'1356705866'}
[12/30/12 07:04PM][startSession] - Got MAC address of 00185648531c
[12/30/12 07:04PM][startSession] - Setting Eye-Fi upload key to 
74f514d76c53540c8be18d8227df0186
[12/30/12 07:04PM][startSession] - Concatenated credential string (pre MD5): 
00185648531c2c551d51eb0a947b2fda3563b4722a2474f514d76c53540c8be18d8227df0186
[12/30/12 07:04PM][do_POST] - StartSession response: <?xml version="1.0" 
encoding="UTF-8"?><SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><Start
SessionResponse 
xmlns="http://localhost/api/soap/eyefilm"><credential>12cde88a0172376efdd6728b0f
d9b2e9</credential><snonce>99208c155fc1883579cf0812ec0fe6d2</snonce><transfermod
e>2</transfermode><transfermodetimestamp>1230268824</transfermodetimestamp><upsy
ncallowed>false</upsyncallowed></StartSessionResponse></SOAP-ENV:Body></SOAP-ENV
:Envelope>
192.168.2.15 - - [30/Dec/2012 19:04:10] "POST /api/soap/eyefilm/v1 HTTP/1.1" 
200 -
[12/30/12 07:04PM][get_request] - Incoming connection from client 192.168.2.15

eye-fi frimware is on the latest level and also working with windows.

Thanks for any offered feedback.

Original comment by Christof...@gmail.com on 30 Dec 2012 at 6:12

GoogleCodeExporter commented 8 years ago
Because of the recency of this issue, is it possible that the latest firmware 
prevents this version of the eye-fi server from working? Is it possible to 
downgrade the firmware to a date where this server was working?

Original comment by yek3y...@gmail.com on 30 Jan 2013 at 1:53

GoogleCodeExporter commented 8 years ago
I've got some wireshark traces from a while back for both WindowsXP (working), 
and an Ubuntu box (not working).

From what I can tell, the only differences between the working & non-working 
SOAP handshake is the transfermode, and upsyncallowed tags.
(I also verified that the MAC & credential MD5SUM is still calculated the same 
way on my card, and the MD5SUM calculation matched that on the WindowsXP 
server, so that's not the problem)
However, I modified the server with different hard-coded values (matching those 
that worked on the WindowsXP server), and still no joy!

I've attached the traces in a file below... along with some notes I took at the 
time.
Pitty I couldn't find a solution... but when I get curious again, I'll keep 
digging.
If anybody else figures it out, please post the solution.

Notes:
------------------------------------------ eyefisrever.py: NOT WORKING

----- EyeFi Card -> PC:
7   0.014959    192.168.1.112   192.168.1.13    TCP 52914 > 59278 [ACK] Seq=142 Ack=1 
Win=4096 Len=467
SOAPAction: "urn:StartSession"
Content-Length: 412
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="EyeFi/SOAP/EyeFilm">
    <SOAP-ENV:Body>
        <ns1:StartSession>
            <macaddress>001856483fcc</macaddress>
            <cnonce>955b62390382d865e5a4b441ef4b9601</cnonce>
            <transfermode>33315</transfermode>
            <transfermodetimestamp>1346321482</transfermodetimestamp>
        </ns1:StartSession>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

calculated cred: bd49551d4f5e731cdc8d3adc54a9edcc (matches below)

----- PC -> EyeFi Card
12  5.088279    192.168.1.13    192.168.1.112   TCP 59278 > 52914 [PSH, ACK] Seq=18 
Ack=609 Win=7504 Len=734
VH?!]YEib@@JpYM,&PPfServer: Eye-Fi Agent/2.0.4.0 (Windows XP SP2) 
Date: Thu, 06 Dec 2012 12:33:17 GMT
Date: Thu, 06 Dec 2012 12:33:17 GMT
Pragma: no-cache
Server: Eye-Fi Agent/2.0.4.0 (Windows XP SP2)
Content-Type: text/xml; charset="utf-8"
Content-Length: 483

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <StartSessionResponse xmlns="http://localhost/api/soap/eyefilm">
            <credential>bd49551d4f5e731cdc8d3adc54a9edcc</credential>
            <snonce>99208c155fc1883579cf0812ec0fe6d2</snonce>
            <transfermode>2</transfermode>
            <transfermodetimestamp>1230268824</transfermodetimestamp>
            <upsyncallowed>false</upsyncallowed>
        </StartSessionResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

----- EyeFi Card -> PC:
(no further communication)

------------------------------------------ WinXP: WORKING
----- EyeFi Card -> PC:
13  0.016632    192.168.1.112   192.168.1.116   TCP 54526 > 59278 [ACK] Seq=142 Ack=1 
Win=4096 Len=467
!]YVH?E@ptPSOAPAction: "urn:StartSession"
Content-Length: 412

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="EyeFi/SOAP/EyeFilm">
    <SOAP-ENV:Body>
        <ns1:StartSession>
            <macaddress>001856483fcc</macaddress>
            <cnonce>d0337119d485d3422a719a0411a9b348</cnonce>
            <transfermode>33315</transfermode>
            <transfermodetimestamp>1346321482</transfermodetimestamp>
        </ns1:StartSession>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

calculated cred: 157fbd93785b5866ee98e01994d1a916 (matches below)

----- PC -> EyeFi Card
21  0.505776    192.168.1.116   192.168.1.112   TCP [TCP Out-Of-Order] 59278 > 54526 
[FIN, PSH, ACK] Seq=226 Ack=609 Win=63632 Len=486
VH?!]YE/1@Etp\P4
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <StartSessionResponse xmlns="http://localhost/api/soap/eyefilm">
            <credential>157fbd93785b5866ee98e01994d1a916</credential>
            <snonce>085356e6169d3fb7de5986a5e2dda2ea</snonce>
            <transfermode>33315</transfermode>
            <transfermodetimestamp>1346321483</transfermodetimestamp>
            <upsyncallowed>true</upsyncallowed>
        </StartSessionResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

----- EyeFi Card -> PC:
28  0.657791    192.168.1.112   192.168.1.116   TCP 50994 > 59278 [ACK] Seq=147 Ack=1 
Win=4096 Len=467
!]YVH?E@pt2?7PeSOAPAction: "urn:StartSession"
Content-Length: 412

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="EyeFi/SOAP/EyeFilm">
    <SOAP-ENV:Body>
        <ns1:StartSession>
            <macaddress>001856483fcc</macaddress>
            <cnonce>81a6ad24985aaf21f651d03f546a944a</cnonce>
            <transfermode>33315</transfermode>
            <transfermodetimestamp>1346321482</transfermodetimestamp>
        </ns1:StartSession>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Original comment by nymp...@gmail.com on 3 Feb 2013 at 11:20

Attachments:

GoogleCodeExporter commented 8 years ago
any update on this
I have the same issue, it never worked
for some odd reason I managed to get it working for a few pictures, then nothing

Original comment by chrisnei...@gmail.com on 31 May 2013 at 7:09

GoogleCodeExporter commented 8 years ago
nope, no update.
I've just put the card on a shelf somewhere. I keep project-hopping and I can't 
stop!
anyway, I've put all the details of what I've done in this post (with trace 
files). I *will* update this post if I find something before somebody else 
does... but I'm sorry to say, that's not yet (I get distracted easily)

Original comment by nymp...@gmail.com on 6 Jun 2013 at 10:17

GoogleCodeExporter commented 8 years ago
OK, I upgraded my own card and have the same issue now :-( Images do, 
erratically, get uploaded now and then. Can't really put a finger on when or 
why. Will have to look into it, thanks so much for the logs and thinking sofar.

I'm accepting this as a critical issue. I'm also putting a notice up on the 
project description warning people 'YMMV'. Darn!

Original comment by pike-common@kw.nl on 29 Sep 2013 at 10:20

GoogleCodeExporter commented 8 years ago
nymph, did you try setting transfermodetimestamp to be equal to the request? 

Also, did anyone check this project to see if it works for them? 
https://launchpad.net/eyefi

If that works we can do what they do... They generate snonce every time using 
"random.getrandbits(128)", copy transfermode of client, copy 
transfermodetimestamp of client, and upsyncallowed to false.

Original comment by davidgrant on 1 Oct 2013 at 9:49

GoogleCodeExporter commented 8 years ago
I vaguely remember I had to check something to make it work
The entire process is dodgy and i dont really wont to play around with it again 
now that it is working

Original comment by chrisnei...@gmail.com on 2 Oct 2013 at 2:12

GoogleCodeExporter commented 8 years ago
If I didn't write it in the log, then I didn't do it... that's how I roll ;)

Original comment by nymp...@gmail.com on 8 Oct 2013 at 5:37

GoogleCodeExporter commented 8 years ago
Can someone who still has problems test this fix?

I got it to work with the following changes:

918c918
<        snonceElementText = 
doc.createTextNode("99208c155fc1883579cf0812ec0fe6d2")
---
>         snonceElementText = 
doc.createTextNode("69804285196b055a5540f9b7f0cd1211")
922c922
<         transfermodeElementText = doc.createTextNode("2")
---
>         transfermodeElementText = doc.createTextNode("33282")
930c930
<         upsyncallowedElementText = doc.createTextNode("false")
---
>         upsyncallowedElementText = doc.createTextNode("true")
This transfer mode allows both .NEF and .jpeg to be downloaded. Not sure if 
this helps or not. It works for me, YMMV. For just jpeg transfermode 32770. 
This worked with the latest firmware as of 11/04/2013.

Patch may not apply cleanly, so just do it manually.

Original comment by davidgrant on 14 Nov 2013 at 7:03

GoogleCodeExporter commented 8 years ago
Hi David,
I tried out your patch after having tried both 1.0 and 2.0 version of 
TaChang/eyefiserver with same problem.
Your patch however worked for me.

Kind regards,
Ivar

Original comment by ivarnes...@gmail.com on 26 Jan 2014 at 12:33

GoogleCodeExporter commented 8 years ago
Hi David,
Your patch worked for me too!
I have X2 Connect 4GB with latest firmware.
Thanks a lot!

Ciao
Andrea

Original comment by a.barcel...@gmail.com on 2 Mar 2014 at 7:14

GoogleCodeExporter commented 8 years ago
I ended up going with a slightly differently (hopefully even better) fix: 

https://github.com/dgrant/eyefiserver2/commit/bd2e23b4a815d3d79c9f1e1fa3656b2cbd
0747a7

BTW, come check out the new project at github (we forked from this one a long 
time ago). Someone is working on .deb and/or rpm packages so those should 
hopefully appear soon!

Original comment by davidgrant on 7 Apr 2014 at 9:33