bridge12technologies / pyb12mps Goto Github PK
View Code? Open in Web Editor NEWPython package to control Bridge12 MPS
License: MIT License
Python package to control Bridge12 MPS
License: MIT License
After starting the communication with the MPS (e.g. mps.start()) there seems to be some characters left so any command directly after opening the connection will result in an error. Running the command again will give the correct result.
mps.start()
Server starting...
Server started.
MPS initializing...
System Readymps.power()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/pyB12MPS/pyB12MPS.py", line 382, in power
return_power = float(return_tenth_dB_power) / 10. # convert to dBm
ValueError: could not convert string to float: 'Synthesizer detected'mps.power()
0.0
the documentation should specify the type and allowed range of values accepted/returned for each serial command. For example, maybe add a third column in the table of serial commands that specifies float, int, str, etc. and a quick note about allowed values.
when entering the EXT mode via pyB12MPS or OVJ the TX status goes "on", even when the MPS was off before entering EXT mode. This should be changed
The lock remains on when the waveguide status is turned off by the pyB12MPS package:
Minimal Example:
mps.wgstatus(1)
mps.rfstatus(1)
mps.lockstatus(1)
mps.wgstatus(0)
when the EXT mode and the MPS sends out a pulse the RX value changes (and the bar changes) but the TX bar never changes (always empty)
File "c:/Users/Eugene Huang/Documents/python/Lock_Feature/lock_feature_test.py", line 67, in
info = mps.systemstatus()
File "c:\users\eugene huang\documents\repositories\pyb12mps\pyB12MPS\pyB12MPS.py", line 918, in systemstatus
key, value = tuple(statusInfo.split(':'))
ValueError: not enough values to unpack (expected 2, got 1)
Variable names are not consistent, e.g: rfstatus() and listPorts().
In the command screen(), screen 3 is stated in the docstring, but not available in MPS firmware.
Server window: make verbose mode to see server window
The MPS is periodically losing connection with our CentOS system. While running ODNP automatic acquisition through our python scripts, the acquisition will halt and python will output an error: "ConnectionResetError: [Errno 104] Connection reset by peer".
I tried running again with mps.start(debug = True) in one terminal, then ran my T1 script in another terminal. The terminal which had the mps.start(debug = True) gave me no additional output during or after the script completed. This was successful, but immediately after this, I tested my enhancement script, and this failed during the run with the same "ConnectionResetError".
Link: http://pyb12mps.bridge12.com/quick-start.html#communicating-with-the-bridge12-mps
The MPS has a verbose mode, but the pyB12MPS cannot enable it.
Autodetect of Com port: Either it works, or we'll remove the feature and you have to give manually
To avoid users needing to use extra code maybe it would be a good idea to add something like a quick sleep(.1) (or whatever else might work) within the setting functions themselves. For example, if I have
f1 = mps.freq()
mps.freq(f3)
f2 = mps.freq()
within a script, f2 = f1. If I use,
f1 = mps.freq()
mps.freq(f3)
time.sleep(.1)
f2 = mps.freq()
f2 = f3 as it should. I think that completing the setting of a parameter with a single command as it is documented,
mps.freq(#)
should work invariably, rather than require an extra command to take effect.
Would it be easier if the accepted/returned of the various status() commands were true/false so that, for example, you could write:
if mps.ampstatus():
...
rather than have to do something like:
var = mps.ampstatus()
if var==1:
...
pyB12MPS v1.0.6
Firmware v1.5.3
mps.screen()
returns:
ValueError: invalid literal for int() with base 10: 'ERROR'
in several places the documentation (throughout section 2.3 for example) refers to the package as "B12MPS" rather than "pyB12MPS"
When sending a query for a value, the previous value is shown first before it gets updated. E.g.:
mps.txpowerdbm()
-99.9mps.txpowermv()
-99.9
mps.txpowermv()
-3.1
mps.txpowerdbm()
-3.1
mps.txpowerdbm()
-99.9
When I send mps.txpowerdbm() I get -99.9 (seems correct)
When I send mps.txpowermv() afterwards I get -99.9 (not correct) and when I send the command again I get -3.1 (seems to be correct)
pyB12MPS v1.0.6
Firmware v1.5.3
mps.serial()
returns
TypeError: 'module' object is not callable
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.