Driver for Arizona USB Pressure Sensor
Project description
ARIZON USB APIServer
An APIServer for ARIZON USB force sensors.
Installation
Clone & cd
into this repository then:
python setup.py install
Or download from PyPI:
python -m pip install arizon-usb-apiserver
Get Started
To read the sensor locally, use this snippet:
from serial import Serial
from arizon_usb_apiserver import Sensor
if __name__ == '__main__':
conn = Serial("COM16", 115200)
sensor = Sensor(conn)
sensor.reset()
while True:
print(sensor.read_once())
To generate configuration from command line interaction run:
python -m arizon_usb_apiserver configure
To launch the apiserver, run:
python -m arizon_usb_apiserver apiserver
Init sensor
curl -X 'PUT' \
'http://127.0.0.1:8080/v1/arizon/force?flag=true' \
-H 'accept: application/json'
Read sensor
curl -X 'GET' \
'http://127.0.0.1:8080/v1/arizon/force' \
-H 'accept: application/json'
Shutdown sensor
curl -X 'PUT' \
'http://127.0.0.1:8080/v1/arizon/force?flag=false' \
-H 'accept: application/json'
Generate Client
First launch the apiserver, then run openapi-python-client
openapi-python-client generate --url http://127.0.0.1:8080/openapi.json
rm -rf ./arizon_usb_driver/client
mv fast-api-client/fast_api_client ./arizon_usb_driver/client
rm -rf ./fast-api-client
Serial Protocol
Field | Content |
---|---|
Head | 0xFE |
Status | 1 Byte |
Data | 3 Byte |
XOR checksum | 1 Byte |
- Status: 4 bits of address + 4 bits represents number of digits
- Data: 3 bytes of signed integers, no digit, big-endian.
- Checksum: xor() of first 5 bytes
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for arizon_usb_apiserver-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6a5bb5c6647e9094e49bf4d8c25a5b8f80d545bebf5b81b1fffd7f8634e5292 |
|
MD5 | 48dd3513fdee6c4df41bcc320f3ad989 |
|
BLAKE2b-256 | 2e82783117b5dd5f66199ab49ab26f6a5e31d08d2e5115ec0ef8f42724f15607 |