Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: dcs.sock file not found, Multiple attempts to try and connect to Duet via SBC and Windows machine #18

Closed
3 of 25 tasks
JDang-At-Festo opened this issue Jan 16, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@JDang-At-Festo
Copy link

Which Duet products are you using?

  • Duet2-Wifi
  • Duet2-Ethernet
  • Duet Expansion Breakout Board
  • Duex2
  • Duex5
  • Duet2-Maestro
  • Maestro Dual Driver Expansion
  • Duet3-6HC
  • Duet3-3HC
  • Duet3-1XD
  • Duet3-1LC
  • Duet3-Tool Distribution Board
  • Duet3-Mini5+
  • Duet3-Mini2+
  • Raspberry Pi or other SBC
  • SmartEffector
  • Magnetic Filament Sensor
  • Laser Filament Sensor
  • PT100 Daughterboard
  • Thermocouple Daughterboard
  • PanelDue
  • Other
  • None

Firmware Version

RepReap 3.4

Duet Web Control Version

3.2.2

Are you using a Single Board Computer (RaspberryPi) with your Duet?

  • Yes I use a SBC.
  • No I do not use a SBC.

Please upload the results of sending M122 in the gcode console.

Cannot

Please upload the content of your config.g file.

Config.g

Please upload the content of any other releveant macro files.

No response

Details specific to your printer.

No response

Links to additional info.

I tried two approaches here. The first is with a windows PC. Realizing the issue that socket library in "base_connection.py" used the AF_UNIX tag I simply replaced that with AF_INET. However the issue comes down to the actually socket connect call (socket.connect()). In the source code it searches for a dcs.sock file located in the directory "/var/run/ ... etc". Which since a windows machine it cannot be found so I bypassed this by inputting in my own tuple of the IP address I assigned to the board with the firmware flash and port 22. I chose port 22 due to some obscure documentation about connecting to the board via Putty (https://docs.duet3d.com/User_manual/Machine_configuration/SBC_setup). I however I received this error:
Capture

Assuming that this is some Windows and Linux mismatch, I used pip to download the dsf-python library onto a SBC (Raspi 4b) to try and run it. After trying to run a simple connection call the code raised an error of the dcs.sock file not able to be found. I then uninstalled the package and cloned the repo itself and ran the "python setup.py install" and proceeded to try to run my script again. Once again no successful socket connection, I am unsure of what to proceed to next as I cannot find this file required to run this. This may go against policy but is there potentially a way I can get either the dcs.sock file or the port number that allows me to communicate to the Duet?

Thank you for your time and I know this is long winded but I appreciate the time taken to address this.

What happened?

Expected result
Successful Socket connection
Observed result
No successful connection
Steps to reproduce

PIP installation on SBC (RPi 4b)
Instantiate a CommandConnection Object, follow that by trying to connect to the Duet.

Clone Repo on SBC (RPi 4b)
Command line: "python setup.py install". Attempt to use the same socket connection and the device just refuses to connect

Windows PC
Clone the main repository. In the "base_connection.py" file change the socket connection to AF_INET instead of AF_UNIX. Pass in the IP address and port 22 into the socket.connect() method.

@JDang-At-Festo JDang-At-Festo added the bug Something isn't working label Jan 16, 2023
@T3P3
Copy link
Contributor

T3P3 commented Jan 16, 2023

please discuss this on the forum:
forum.duet3d.com
It does not look like a bug with dsf-python because this is a set of python bindings to the dsf application and from your description its not clear you are running dsf.

@JDang-At-Festo
Copy link
Author

JDang-At-Festo commented Jan 17, 2023

@T3P3
From my understanding dsf-python allows a python environment to directly communicate with a Duet board. When looking at examples folder in this repo it seems that it should this simple. In the sendSimple.py file there seems to be connection formed with python's socket library and then a command is then sent to the duet which returns a response. From your comment it seems that I need to have the dsf application and then subsequently I connect python through this route.

@JDang-At-Festo JDang-At-Festo closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants