Skip to content

Commit 5b05c47

Browse files
author
AndyEveritt
committed
update readme
1 parent 6b450ef commit 5b05c47

3 files changed

Lines changed: 35 additions & 9 deletions

File tree

DuetWebAPI/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from DuetWebAPI import DuetWebAPI
1+
from .DuetWebAPI import DuetWebAPI

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DuetWebAPI
2-
Python interface to Duet RepRap V2 or V3 firmware.
2+
Python interface to Duet RepRap V2 or V3 firmware via Http REST API.
33

44
* Works over IP network.
55
* Does not support passwords on the printer.
@@ -10,12 +10,8 @@ Python interface to Duet RepRap V2 or V3 firmware.
1010
as long as they continue V2 V3 abstractaion.
1111

1212
# Install
13-
* Download the DuetWebAPI.py script.
14-
* Or ```git clone https://github.com/lukeslaboratory/DuetWebAPI```
15-
16-
* Place it in the directory of the script that is going to include it
17-
* Or in any directory in the python library path,
18-
* Or create a symbolic link ```ln -s ../DuetWebAPI/DuetWebAPI.py DuetWebAPI.py```
13+
* add `"git+https://github.com/AndyEveritt/DuetWebAPI.git@master#egg=duetwebapi"` to `requirements.txt`
14+
* `pip install -r requirements.txt`
1915

2016
# Usage
21-
* See 'testDWA.py' for examples.
17+
* See 'examples.py' for examples.

examples.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
import DuetWebAPI as DWA
3+
import json
4+
5+
# Test cases
6+
7+
D100 = DWA.DuetWebAPI('http://192.168.7.100')
8+
D101 = DWA.DuetWebAPI('http://192.168.7.101')
9+
D127 = DWA.DuetWebAPI('http://127.0.0.1')
10+
11+
print("Printer Type D100 is ",D100.printerType())
12+
print("Printer Type D101 is ",D101.printerType())
13+
print("Printer Type D127 is ",D127.printerType())
14+
15+
print("D100 coordinates are",D100.getCoords())
16+
d=D101.getCoords()
17+
print("D101 coordinates are",d)
18+
print("D101 X axis is ",d['X'])
19+
20+
print("D100 numExtruders ",D100.getNumExtruders())
21+
print("D101 numExtruders ",D101.getNumExtruders())
22+
23+
print("D100 numTools ",D100.getNumTools())
24+
print("D101 numTools ",D101.getNumTools())
25+
26+
print("D100 length of config.g ",len(D100.getFilenamed('/sys/config.g')))
27+
print("D101 length of config.g ",len(D101.getFilenamed('/sys/config.g')))
28+
29+
30+
D101.gCode("G91 G1 X0.5 G90")

0 commit comments

Comments
 (0)