twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Sockets don't work when not using first ext port option #56

Closed twVolc closed 1 year ago

twVolc commented 1 year ago

When connecting to the instrument through the GUI, if the port is the 2nd or 3rd port option (i.e. pycam has been run then shutdown then run again quickly, so first ports are unavailable and instrument shifts to these other port options) the comms doesn't work properly,

Typically after connecting I will get the error [WinError 10057] A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied

Then I've had some times where the messages received through the port are a bit scrambled. Interacting with the instrument in this state is impossible - nothing happens.

twVolc commented 1 year ago

Looks like this issue is directly related to the recent work on automating port selection #57. Tested connecting to other ports using the old program and it works fine... Perhaps need to revert back to manual port selection or, better, work out why the automated port selection doesn't create properly functioning connections.

twVolc commented 1 year ago

Found that I needed to close the socket before trying the next port number, so now things work in the dev branch.