UC2-REST 0.2.0.33__tar.gz → 0.2.0.34__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/PKG-INFO +1 -1
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/PKG-INFO +1 -1
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/SOURCES.txt +1 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/UC2Client.py +3 -2
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/__version__.py +1 -1
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/can.py +20 -6
- uc2_rest-0.2.0.34/uc2rest/canota.py +588 -0
- uc2_rest-0.2.0.34/uc2rest/fan.py +86 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/ledmatrix.py +1 -1
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/motor.py +143 -22
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/mserial.py +112 -19
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/objective.py +16 -9
- uc2_rest-0.2.0.34/uc2rest/state.py +222 -0
- uc2_rest-0.2.0.33/uc2rest/canota.py +0 -801
- uc2_rest-0.2.0.33/uc2rest/state.py +0 -99
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/LICENSE +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/README.md +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/dependency_links.txt +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/not-zip-safe +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/requires.txt +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/UC2_REST.egg-info/top_level.txt +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/setup.cfg +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/setup.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/MockSerial.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/__init__.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/analog.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/camera.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/camera_trigger.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/cmdrecorder.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/digitalin.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/digitalout.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/galvo.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/gripper.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/home.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/laser.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/lcddisplay.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/logger.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/message.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/modules.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/motor_config.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/pid.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/rotator.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/slm.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/temperature.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/utils.py +0 -0
- {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.34}/uc2rest/wifi.py +0 -0
|
@@ -26,6 +26,7 @@ from .rotator import Rotator
|
|
|
26
26
|
from .logger import Logger
|
|
27
27
|
from .cmdrecorder import cmdRecorder
|
|
28
28
|
from .temperature import Temperature
|
|
29
|
+
from .fan import Fan
|
|
29
30
|
from .message import Message
|
|
30
31
|
from .can import CAN
|
|
31
32
|
from .canota import CANOTA
|
|
@@ -131,8 +132,8 @@ class UC2Client(object):
|
|
|
131
132
|
# initialize temperature
|
|
132
133
|
self.temperature = Temperature(self)
|
|
133
134
|
|
|
134
|
-
# initialize
|
|
135
|
-
self.
|
|
135
|
+
# initialize fan controller
|
|
136
|
+
self.fan = Fan(self)
|
|
136
137
|
|
|
137
138
|
# initialize galvo
|
|
138
139
|
self.galvo = Galvo(self)
|
|
@@ -6,7 +6,7 @@ __version__.py
|
|
|
6
6
|
|
|
7
7
|
__title__ = 'UC2-REST'
|
|
8
8
|
__description__ = 'This pacage will help you to drive the ESP32-driven microscopy control modules from UC2'
|
|
9
|
-
__version__ = "v0.2.0.
|
|
9
|
+
__version__ = "v0.2.0.34"
|
|
10
10
|
__author__ = 'Benedict Diederich'
|
|
11
11
|
__author_email__ = 'benedictdied@gmail.com'
|
|
12
12
|
__license__ = 'GPL v3'
|
|
@@ -57,15 +57,29 @@ class CAN(object):
|
|
|
57
57
|
"""Register a callback function for a specific key."""
|
|
58
58
|
self._callbackPerKey[key] = callbackfct
|
|
59
59
|
|
|
60
|
+
def get_can_ids(self):
|
|
61
|
+
"""Return CAN node IDs from the latest scan (e.g. for OTA flashing)."""
|
|
62
|
+
return [entry.get("canId") for entry in self.scanResults
|
|
63
|
+
if entry.get("canId") is not None]
|
|
64
|
+
|
|
60
65
|
def reboot_remote(self, qid=1, can_address=0, isBlocking=False, timeout=2):
|
|
61
66
|
"""
|
|
62
|
-
|
|
67
|
+
Reboot a CAN device.
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
- ``can_address == 0`` reboots the master (this ESP32) itself.
|
|
70
|
+
- ``can_address in 1..127`` reboots a remote slave by SDO-writing 1
|
|
71
|
+
to OD index 0x2507 sub 0 on the target node. The slave's
|
|
72
|
+
CO_tmr_task observes the write and calls ESP.restart() ~200 ms
|
|
73
|
+
later.
|
|
74
|
+
|
|
75
|
+
:param qid: Query ID for the CAN command (unused by firmware, kept
|
|
76
|
+
for API compatibility)
|
|
77
|
+
:param can_address: 0 = master, 1..127 = remote slave nodeId
|
|
65
78
|
:param isBlocking: If True, wait for response
|
|
66
79
|
:param timeout: Timeout for the command in seconds
|
|
67
|
-
:
|
|
68
|
-
|
|
80
|
+
:return: Response from the device, e.g.
|
|
81
|
+
``{"status":"ok","nodeId":11}`` or
|
|
82
|
+
``{"status":"error","error":"SDO write failed","nodeId":11}``.
|
|
69
83
|
"""
|
|
70
84
|
path = "/can_act"
|
|
71
85
|
payload = {
|
|
@@ -98,7 +112,7 @@ class CAN(object):
|
|
|
98
112
|
"count": 2
|
|
99
113
|
}
|
|
100
114
|
"""
|
|
101
|
-
path = "/can_act"
|
|
115
|
+
path = "/can_act" # {"task":"/can_act", "scan": true}
|
|
102
116
|
payload = {
|
|
103
117
|
"task": path,
|
|
104
118
|
"scan": True,
|
|
@@ -109,7 +123,7 @@ class CAN(object):
|
|
|
109
123
|
payload,
|
|
110
124
|
getReturn=True,
|
|
111
125
|
timeout=timeout,
|
|
112
|
-
nResponses=
|
|
126
|
+
nResponses=1
|
|
113
127
|
)
|
|
114
128
|
|
|
115
129
|
def get_available_devices(self, timeout=2):
|