Skip to content

Commit

Permalink
Merge pull request #40 from SergeBakharev/store_machine_address
Browse files Browse the repository at this point in the history
Machine Reconnect Functionality
  • Loading branch information
SergeBakharev authored Nov 9, 2024
2 parents 9535fb6 + 9179882 commit 3f30f66
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 268 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dmypy.json

# IDEs
.idea/
.vscode/

# appimage-builder related
AppDir/
Expand Down
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Community developed version of the Makera Carvera Controller software.

The Controller software works on the following systems:

- Windows
- Windows 7 x64 or newer
- MacOS using Intel CPUs running Ventura (13) or above
- MacOS using Apple Silicon CPUs running Sonoma (14) or above
- Linux using x64 CPU running a Linux distribution with Glibc 2.31 or above (eg. Ubuntu 20.04 or higher)
- Linux using ARM64 CPUs (eg RasPi 3 or above) running a distribution Glibc 2.36 or above (eg. Raspios Bookworm or higher)

- Linux using x64 CPUs running a Linux distribution with Glibc 2.31 or above (eg. Ubuntu 20.04 or higher)
- Linux using ARM64 CPUs (eg RasPi 3 or above) running a distribution Glibc 2.36 or above (eg. RasPiOS Bookworm or higher)
- Other systems might be work via the Python Package, see below for more details.

## Installation

Expand All @@ -23,10 +23,19 @@ See the assets section of [latest release](https://github.com/carvera-community/
- carveracontroller-community-\<version\>-x86_64.appimage - Linux AppImage for x64 systems
- carveracontroller-community-\<version\>-aarch64.appimage - Linux AppImage for ARM64 systems

### Usage: Linux App Images

Linux AppImages are a self-contained binary with all the required dependencies to run the application.

To use it, first make it executable (`chmod +x carveracontroller-community-<version>-<arch>.appimage`).

## Alternative Installation: Python Package
Then you will be able to run it.

It's best to use a one of pre-built packages as they they have frozen versions of tested dependenies, however if you prefer the software can be installed as a Python package. This might allow you to use a unsupported platform (eg raspi 1) provided that the dependencies can be met.
If you want a shortcut, consider using [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher).

## Alternative Installation: Python Package

It's best to use one of the pre-built packages as they they have frozen versions of tested dependencies and python interpreter, however if you prefer the software can be installed as a Python package. This might allow you to use a unsupported platform (eg raspi 1) provided that the dependencies can be met.

``` bash
pip install carvera-controller-community
Expand All @@ -38,7 +47,6 @@ Once installed it can be run via the module
python3 -m carveracontroller
```


## Development Environment Setup

To contribute to this project or set up a local development environment, follow these steps to install dependencies and prepare your environment.
Expand All @@ -47,7 +55,7 @@ To contribute to this project or set up a local development environment, follow

- Ensure you have [Python](https://www.python.org/downloads/) installed on your system (preferably version 3.8 or later).
- [Poetry](https://python-poetry.org/) is required for dependency management. Poetry simplifies packaging and simplifies the management of Python dependencies.
- One of the python dependencies [QuickLZ](https://pypi.org/project/pyquicklz/) will be compiled by Poetry when installed. Ensure that you have a compiler that Poetry/Pip can use and the Pythong headers. On a debian based Linux system this can be accomplished with `sudo apt-get install python3-dev build essential`. On Windows installation of (just) the Visual C++ 14.x compiler is required, this can be accomplished with [MSBuild tools package](https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio_2019_.28x86.2C_x64.2C_ARM.2C_ARM64.29).
- One of the python dependencies [QuickLZ](https://pypi.org/project/pyquicklz/) will be compiled by Poetry when installed. Ensure that you have a compiler that Poetry/Pip can use and the Pythong headers. On a debian based Linux system this can be accomplished with `sudo apt-get install python3-dev build essential`. On Windows installation of (just) the Visual C++ 14.x compiler is required, this can be accomplished with [MSBuild tools package](https://wiki.python.org/moin/WindowsCompilers#Microsoft_Visual_C.2B-.2B-_14.2_standalone:_Build_Tools_for_Visual_Studio_2019_.28x86.2C_x64.2C_ARM.2C_ARM64.29).
- [Squashfs-tools](https://github.com/plougher/squashfs-tools) is required if building Linux AppImages. On Debian based systems it's provided by the package `squashfs-tools`. This is only required if packaging for linux.

### Installing Poetry
Expand Down Expand Up @@ -93,7 +101,7 @@ Once you have Poetry installed, setting up the development environment is straig

### Running the Project

You can run the Controller software using Poetry's run command without installation. This is handy for iterative development.
You can run the Controller software using Poetry's run command without installation. This is handy for iterative development.

```bash
poetry run python -m carveracontroller
Expand Down
71 changes: 0 additions & 71 deletions carveracontroller/Editor.kv

This file was deleted.

53 changes: 0 additions & 53 deletions carveracontroller/GcodeParser.kv

This file was deleted.

74 changes: 0 additions & 74 deletions carveracontroller/GcodeParser.py

This file was deleted.

56 changes: 0 additions & 56 deletions carveracontroller/Makefile

This file was deleted.

8 changes: 8 additions & 0 deletions carveracontroller/WIFIStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ class MachineDetector:
def __init__(self):
pass

def is_machine_busy(self, addr):
"""Tries to connect to the machine, if machine is available returns true else false"""
try:
with socket.create_connection((addr, "2222"), timeout=1):
return False
except (socket.timeout, socket.error) as e:
return True

def get_machine_list(self):
UDP_IP = "0.0.0.0"
machine_list = []
Expand Down
Loading

0 comments on commit 3f30f66

Please sign in to comment.