newaetech / chipshouter-python Goto Github PK
View Code? Open in Web Editor NEWPython API for ChipSHOUTER
License: MIT License
Python API for ChipSHOUTER
License: MIT License
Hi
I'm not sure why https://chipshouter.readthedocs.io/en/latest/ is not reflecting automatically latest master, but e.g. the very first example still mentions "cs.arm = 1" while master doc is fixed : https://github.com/newaetech/ChipSHOUTER-python/blob/master/chipshouter/chipshouter.py#L58
Suggesting to improve the API to make more obvious & less reliant on all the side effects. In particular:
arm() --> .armed = 1
force_arm() --> .clr_armed = 1
trigger() --> pulse = 1
reset() --> reset = 1 (breaking change)
reset_config() --> reset_config = 1 (breaking change)
trigger_safe() --> read of trigger_safe (breaking change)
Most of the changes are related to less used features, so I imagine this isn't as big a deal. Leaving open for anyone to complain about...
Actual width is not correctly reflected when using the API call,
Calling:
cs.pulse.width = 101
print cs.pulse
Returns:
width = 101
repeat = 10
deadtime = 1
actual width = 0
See line 278:
def __init__(self, comport):
self.com_api = Bin_API("COM10")
Should be
def __init__(self, comport):
self.com_api = Bin_API(comport)
I'm a bit puzzled...
Using an external hardware trigger.
The user manual recommends to call get triggersafe
, else the device will enter fault mode if safety checks cannot be performed for a certain length of time.
The Python API tells that reading trigger_safe
will allow triggering for 5 seconds without checking the temperature.
The user manual presents absent_temp
as the configurable time (1..60, unit unknown, seconds?) the temperature sensors can be skipped being read.
The Python API specifies unit is seconds but doesn't specify the allowed interval.
Now, from my tests:
trigger_safe
at all, the CS will enter fault mode only after quite a while.trigger_safe
before repeated triggers, CS will enter fault mode systematically 5s later (as documented in the Python API), no matter the value of absent_temp
.I thought I could use absent_temp
to configure the maximum delay between regular reads of trigger_safe
but it's not the case ? What is absent_temp
for then ?
And why calling trigger_safe
reduces drastically the time between entering fault mode compared with not calling trigger_safe
?
In [6]: cs.update_firmware()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 cs.update_firmware()
AttributeError: 'ChipSHOUTER' object has no attribute 'update_firmware'
In [7]: cs.id
Out[7]: '72JD6M:2.0.1\n'
In [8]: cs
Out[8]:
api_version = 0.0.0
armed = False
voltage =
set = 500
measured = 22
pulse =
width = 160
repeat = 3
deadtime = 10
actual width = 160
state = disarmed
trigger_safe = False
faults_current = []
faults_latched = []
temperature_mosfet = 24
temperature_diode = 23
temperature_xformer = 27
arm_timeout = 2
hwtrig_term = False
hwtrig_mode = True
emode = False
mute = False
absent_temp = 1
pat_enable = False
pat_wave =
reset_config = 0
reset = False
board_id = 72JD6M:2.0.1
boot_enable = 0
If CS isn't connected, printing cs object gives you:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "chipshouter.py", line 839, in __repr__
return dict_to_str(self._dict_repr())
File "chipshouter.py", line 827, in _dict_repr
dict['absentTemp'] = self.absentTemp
AttributeError: 'ChipSHOUTER' object has no attribute 'absentTemp'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.