UC2-REST 0.2.0.33__tar.gz → 0.2.0.35__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.
Files changed (46) hide show
  1. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/PKG-INFO +1 -1
  2. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/PKG-INFO +1 -1
  3. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/SOURCES.txt +1 -0
  4. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/UC2Client.py +3 -2
  5. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/__version__.py +1 -1
  6. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/can.py +20 -6
  7. uc2_rest-0.2.0.35/uc2rest/canota.py +616 -0
  8. uc2_rest-0.2.0.35/uc2rest/fan.py +86 -0
  9. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/home.py +2 -0
  10. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/ledmatrix.py +1 -1
  11. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/motor.py +146 -23
  12. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/mserial.py +114 -21
  13. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/objective.py +16 -9
  14. uc2_rest-0.2.0.35/uc2rest/state.py +222 -0
  15. uc2_rest-0.2.0.33/uc2rest/canota.py +0 -801
  16. uc2_rest-0.2.0.33/uc2rest/state.py +0 -99
  17. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/LICENSE +0 -0
  18. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/README.md +0 -0
  19. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/dependency_links.txt +0 -0
  20. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/not-zip-safe +0 -0
  21. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/requires.txt +0 -0
  22. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/UC2_REST.egg-info/top_level.txt +0 -0
  23. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/setup.cfg +0 -0
  24. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/setup.py +0 -0
  25. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/MockSerial.py +0 -0
  26. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/__init__.py +0 -0
  27. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/analog.py +0 -0
  28. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/camera.py +0 -0
  29. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/camera_trigger.py +0 -0
  30. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/cmdrecorder.py +0 -0
  31. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/digitalin.py +0 -0
  32. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/digitalout.py +0 -0
  33. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/galvo.py +0 -0
  34. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/gripper.py +0 -0
  35. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/laser.py +0 -0
  36. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/lcddisplay.py +0 -0
  37. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/logger.py +0 -0
  38. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/message.py +0 -0
  39. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/modules.py +0 -0
  40. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/motor_config.py +0 -0
  41. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/pid.py +0 -0
  42. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/rotator.py +0 -0
  43. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/slm.py +0 -0
  44. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/temperature.py +0 -0
  45. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/utils.py +0 -0
  46. {uc2_rest-0.2.0.33 → uc2_rest-0.2.0.35}/uc2rest/wifi.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UC2-REST
3
- Version: 0.2.0.33
3
+ Version: 0.2.0.35
4
4
  Summary: This pacage will help you to drive the ESP32-driven microscopy control modules from UC2
5
5
  Home-page: https://github.com/openUC2/UC2-REST
6
6
  Author: Benedict Diederich
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UC2-REST
3
- Version: 0.2.0.33
3
+ Version: 0.2.0.35
4
4
  Summary: This pacage will help you to drive the ESP32-driven microscopy control modules from UC2
5
5
  Home-page: https://github.com/openUC2/UC2-REST
6
6
  Author: Benedict Diederich
@@ -19,6 +19,7 @@ uc2rest/canota.py
19
19
  uc2rest/cmdrecorder.py
20
20
  uc2rest/digitalin.py
21
21
  uc2rest/digitalout.py
22
+ uc2rest/fan.py
22
23
  uc2rest/galvo.py
23
24
  uc2rest/gripper.py
24
25
  uc2rest/home.py
@@ -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 laser
135
- self.state = State(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.33"
9
+ __version__ = "v0.2.0.35"
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
- Send a reboot signal to the remote CAN device.
67
+ Reboot a CAN device.
63
68
 
64
- :param qid: Query ID for the CAN command (default: 1)
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
- :param can_address: Address of the CAN device to reboot (0 is master)
68
- :return: Response from the device
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=2
126
+ nResponses=1
113
127
  )
114
128
 
115
129
  def get_available_devices(self, timeout=2):