Giter Site home page Giter Site logo

dsf-python's Introduction

dsf-python's People

Contributors

chrishamm avatar kriechi avatar loicgrenon avatar mfs12 avatar nmsmith22389 avatar t3p3 avatar wilriker avatar x0rtrunks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dsf-python's Issues

Test and evaluate test infrastructure

Right now the state of tests is unclear. From my perspective they are not working properly. So far i can confirm simple commands are working. But intercept and subscribe commands do not provide any working tests at the moment.

Implement basic testing for

  • commands
  • intercept
  • subscribe

Ideally those tests can be run with a remote SBC, on a SBC or against mockup SBC.

  • remote SBC, here ssh forwarding is handy
  • on a SBC, no special requirements
  • mockup SBC, predefined fix answers could be a solution

If run with an SBC SBC configurations need to be provided as well.

Create pypi.org package for dsf-python

Having an available easy to install and update package allows user to use this functionality quicker and might make it more popular.

A pip package should also allow very easy integration into Arch Linux and probably also Debian Linux.

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

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.

[FeatureRequest]: long live connection support

Is your feature request related to a problem? Please describe.

Im working on a plugin, which requires long live connection, and experience a lot of natural disconnections:
Plugin works on SBC
Main system may and will be reset without reset/reboot SBC

It'll be good if we have some tools to check the connection status,
like is_connected method

Describe the solution you propose.

Have somethihng like

class BaseConnection:
def is_connected()->bool:
return connection->current_status

Describe alternatives you've considered

At the moment I workaround it with try except, but it mess the code
Another possible workaround - is open/close connection per every command/request, which may be resource consuming operation

Provide any additional context or information.

Ex. Photos, mockups, etc.

Add api exception mode

To improve programming experience the error handling should use native language features. In python this are exceptions.

Clarification is needed here for go language as well.

As many errors can be thrown and should shown as easy and clear as possible to the programmer/user most errors should be mapped to exceptions. Here is more specification needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.