Skip to main content

API for remote interaction with the Ninox360 Surface Inspector 3D scanner

Project description

Surface Inspector Remote Python Library + Demo

This library provides utilities for interacting with the Surface Inspector device through HTTP communication, handling tasks such as packet construction, server interaction, serialization and deserialization, image requests, and error handling.

Table of Contents

Requirements

  • Python 3.x
  • virtualenv

Demo Code Installation/Setup

1. Clone the Repository

git clone https://github.com/NINOX-360/Surface-Inspector-Remote
cd Surface-Inspector-Remote/Python

2. Set Up a Virtual Environment

It is recommended to use a virtual environment to manage dependencies. This ensures that the dependencies for this project do not interfere with other projects on your machine.

python3 -m venv venv

3. Activate the Virtual Environment

On macOS and Linux:

source venv/bin/activate

On Windows:

venv\Scripts\activate

4. Install Dependencies

Once the virtual environment is activated, install the required dependencies:

pip install -r requirements.txt

5. Run the project

pip install .

Then run:

run_python_demo

Make note: Prior to execution the server secret and server IP MUST be set manually by editing the demo code file.

Incorporate into Your Own Project

The easiest way to this library and install it using pip:

pip install SIRemote

Alternatively, you have the option to create a local library, adjusting your import statements accordingly.

1. Package the Library:

Create a setup.py file if it doesn't exist and include the necessary configurations.

2. Install the Library:

Navigate to the root directory of the library, Create a local package directory:

On macOS and Linux:

mkdir -p ~/python-packages

On Windows:

mkdir %USERPROFILE%\python-packages

3. Install the API to the target Directory:

On macOS and Linux:

pip install --target ~/python-packages .

On Windows:

pip install --target %USERPROFILE%\python-packages .

4. Set up venv in your project:

Within the new project, create your venv environment

On macOS and Linux:

python -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate

5. Set the installed library path:

On macOS and Linux:

echo 'export PYTHONPATH=$PYTHONPATH:~/python-packages' >> ~/.bashrc
source ~/.bashrc

On Windows:

setx PYTHONPATH "%PYTHONPATH%;%USERPROFILE%\python-packages"

6. Import the Library: Import the necessary modules in your project files:

from surface_inspector_remote.RemoteApi import RemoteAPI

Usage

Example Code

Here is an example of how to use the library:

import time
from surface_inspector_remote.RemoteApi import RemoteAPI


def main():
   api = RemoteAPI()
   server_secret = 'your_server_secret'
   url_base = 'https://localhost:3003'

   # Set the target URL
   api.set_ip(url_base)

   # Register the device
   api.send_register(server_secret)

   # Print the response
   print(f'Response Message: {api.request_response_msg()}')
   print(f'Response Status: {api.request_response_status()}')

   # start a scan
   api.send_start_scan()

   # sleep
   time.sleep(10)
   
   # stop the scan
   api.send_stop_scan()


if __name__ == "__main__":
   main()

Contributing

Contributions are welcome! Please fork this repository, make your changes, and submit a pull request.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siremote-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siremote-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file siremote-1.0.0.tar.gz.

File metadata

  • Download URL: siremote-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for siremote-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f6262d1e505b3d766658946d3349de26592fd80c04403e692ffa3325d663b8c9
MD5 3490a897fcb1691c1b57de23eb5856c5
BLAKE2b-256 9652a5295d462d3b8e1c88aeb0d5c74c347c5ddf140d87e30dbd5240bb035889

See more details on using hashes here.

File details

Details for the file siremote-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: siremote-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for siremote-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a31ce593a52b7f81c9e7905903911564e8a8c66234bcc521e1f768fa764dbbc0
MD5 30d01e47354f015ff5f78a0ee6453f71
BLAKE2b-256 be7da72d8380862958590705b9f2a9c58db465c3691fd627a3a264def91ee1ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page