Questions about socket code in qDD/dss

Open discussion about photography, qDslrDashboard
Post Reply
Jarrod
Posts: 15
Joined: 27 Aug 2017, 14:40

Questions about socket code in qDD/dss

Post by Jarrod »

To ask my questions, we need to consider three configurations:

Config A: Dss network served by my Asus router, with a 10.0.0.255 broadcast address. qDD client and dss server both connected as Wifi clients to the router. No camera connected to Pi.
Config B: Dss network served by the Pi Zero W, via hostapd/dnsmasq, with Pi Zero at 192.168.3.14 (192.168.3.255 broadcast). qDD client connected to the Pi as Wifi client. SSH, etc. between qDD client and Pi all work as expected. No camera connected to Pi.
Config C: Exact same as B, except Pi Zero at 192.168.1.1 (192.168.1.255 broadcast).

############### CONFIG A RESULTS ################

Config A worked straight away for me, once I got dss compiled and running on the Pi with root privileges. This is what I considered my "reference" config while trying to get the AP stuff working on the Pi. This config produces the following syslog output when a qDD client connects (no camera connected):

Aug 30 18:45:30 krill ddserver: DslrDashboardServer starting
Aug 30 18:45:30 krill ddserver: Starting socket server on port 4757
Aug 30 18:45:30 krill ddserver: Awaiting client connection
Aug 30 18:45:30 krill ddserver: Starting UDP listener
Aug 30 18:45:30 krill ddserver: join multicast group: 224.1.2.3
Aug 30 18:45:44 krill ddserver: recv: 57
Aug 30 18:45:44 krill ddserver: Client multicast query DslrDashboardClient{924bfc7a-d736-44c8-84ba-b3030dfd1828}
Aug 30 18:45:44 krill ddserver: Server message length: 57 msg: DslrDashboardServer{924bfc7a-d736-44c8-84ba-b3030dfd1828}
Aug 30 18:45:45 krill ddserver: Incoming client connection
Aug 30 18:45:45 krill ddserver: Awaiting client connection
Aug 30 18:45:45 krill ddserver: USB Devices in
Aug 30 18:45:45 krill ddserver: Number of possible configurations: 1 Device Class: 0 VendorID: 1193, ProductID: 12821
Aug 30 18:45:45 krill ddserver: Number of alternate settings:
Aug 30 18:45:45 krill ddserver: Interface class: 6 Interface number: 0 Number of endpoints: 3
Aug 30 18:45:45 krill ddserver: Found USB imaging device, get vendor and product
Aug 30 18:45:45 krill ddserver: Error opening USB imaging device: -3
Aug 30 18:45:45 krill ddserver: Number of possible configurations: 1 Device Class: 9 VendorID: 7531, ProductID: 2
Aug 30 18:45:45 krill ddserver: Number of alternate settings:
Aug 30 18:45:45 krill ddserver: Interface class: 9 Interface number: 0 Number of endpoints: 1
Aug 30 18:45:45 krill ddserver: Imaging USB devices found: 0
Aug 30 18:45:47 krill ddserver: Closing USB device

Note the "recv: 57", "Client multicast query", and "Server message length: 57" messages.

This is accompanied in the client with messages that it finds ddserver, connects, and fails to find a camera (there is no camera connected, so that's expected).

############### CONFIG B RESULTS ################

I could not ever get config B to work. I get this syslog output when starting the server and subsequently trying to connect with qDD:

Sep 1 03:04:48 krill ddserver: DslrDashboardServer starting
Sep 1 03:04:48 krill ddserver: Starting socket server on port 4757
Sep 1 03:04:48 krill ddserver: Awaiting client connection
Sep 1 03:04:48 krill ddserver: Starting UDP listener
Sep 1 03:04:48 krill ddserver: join multicast group: 224.1.2.3
Sep 1 03:05:35 krill ddserver: Incoming client connection
Sep 1 03:05:35 krill ddserver: Awaiting client connection
Sep 1 03:05:35 krill ddserver: USB Devices in
Sep 1 03:05:35 krill ddserver: Number of possible configurations: 1 Device Class: 0 VendorID: 1133, ProductID: 50475
Sep 1 03:05:35 krill ddserver: Number of alternate settings:
Sep 1 03:05:35 krill ddserver: Interface class: 3 Interface number: 0 Number of endpoints: 1
Sep 1 03:05:36 krill ddserver: Number of alternate settings:
Sep 1 03:05:36 krill ddserver: Interface class: 3 Interface number: 1 Number of endpoints: 1
Sep 1 03:05:36 krill ddserver: Number of alternate settings:
Sep 1 03:05:36 krill ddserver: Interface class: 3 Interface number: 2 Number of endpoints: 1
Sep 1 03:05:36 krill ddserver: Number of possible configurations: 1 Device Class: 9 VendorID: 7531, ProductID: 2
Sep 1 03:05:36 krill ddserver: Number of alternate settings:
Sep 1 03:05:36 krill ddserver: Interface class: 9 Interface number: 0 Number of endpoints: 1
Sep 1 03:05:36 krill ddserver: Imaging USB devices found: 0
Sep 1 03:05:38 krill ddserver: Closing USB device

Note the lack of the multicast query message and messages about receipt of the 57 byte header.

This is accompanied in the client with messages that it cannot ddserver, and it tries to connect to 192.168.1.1 (and fails to find a camera there).

############### CONFIG C RESULTS ################

Since the qDD client seems like it falls back to looking at 192.168.1.1 when it can't find a server at the broadcast address, I set things up on the Pi to match that apparent expectation. With no camera connected, it behaves very similar to Config B on the server side. I think the messages in qDD client are slightly different though. When I do connect a camera, it works.

################# Comments/Questions ####################

This took me a very long time to figure out and given the time I spent I would like to gain understanding from it.

Q1: It appears that when connected to the PI as the AP, the broadcast query done by the client fails somehow. Is that your interpretation as well and if so do you know why?
Q2: Is the 192.168.1.1 connection attempt a fallback method designed to deal with networks who don't respond to the broadcast query?
Q3: Is the 192.168.1.1 fallback address hard coded into qDD? Is there a mechanism to change this?

Thanks for taking the time to read this, if you got this far ;-)
hubaiz
Site Admin
Posts: 2006
Joined: 27 Jan 2015, 18:58

Re: Questions about socket code in qDD/dss

Post by hubaiz »

q1 I guess for some reason the UDP discovery packet from qDslrDashboard didn't reach ddserver
q2,q3 192.168.1.1 is the default IP, you can long press the 'Network' button and enter the IP address


The UDP discovery is only used for automatic detection, but qDslrDashboard/ddserver work without it
Jarrod
Posts: 15
Joined: 27 Aug 2017, 14:40

Re: Questions about socket code in qDD/dss

Post by Jarrod »

hubaiz wrote: 01 Sep 2017, 16:16 q1 I guess for some reason the UDP discovery packet from qDslrDashboard didn't reach ddserver
OK, this is starting to make a lot more sense now. Is your Pi Zero W setup responding to the UDP discovery mechanism, or do you have the same result as me? I don't need the auto discovery feature to work, I just wonder if I've missed a step somewhere in my AP setup.
q2,q3 192.168.1.1 is the default IP, you can long press the 'Network' button and enter the IP address
Aha, I missed that feature, thanks for that! Now I have my Pi at 192.168.3.14, things work, and I'm happy :-)

Thanks for all your help.
hubaiz
Site Admin
Posts: 2006
Joined: 27 Jan 2015, 18:58

Re: Questions about socket code in qDD/dss

Post by hubaiz »

Need to check this but I think I also needed to use the 'Network' long press for connecting over wireless.
I think it is related to the broadcast value that can be defined in OpenWrt (192.168.1.255 by default)
Post Reply