Bar code / RFID interface for InOut
Project description
InOut Scan
Draft for the command deamon that reads bar codes from the serial port and forwards them to an API.
Usage: inout_scan [OPTIONS] COMMAND [ARGS]...
Gather bar codes from a scanner connected to the serial port and pass them
to the InOut API. A local cache is maintained to be able to handle
communication problems. Use the flush command to communicate unsubmitted
bar codes.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
flush Flush unsubmitted data to the api
scan Listen for strings from a barcode scanner connected to the...
Scan
Usage: inout_scan scan [OPTIONS]
Listen for strings from a barcode scanner connected to the (virtual)
serial port and make an API call to InOut for each scanned code.
Options:
--serial_port TEXT Serial port device that the barcode scanner is
connected to. [default: /dev/ttyACM0]
--baud_rate INTEGER Serial baud rate of the bar code scanner. [default:
9600]
--api_url TEXT InOut API url. [required]
--api_key TEXT InOut API key.
--scanner TEXT Unique scanner name, ie: "reception1". [required]
--help Show this message and exit.
Flush
Usage: inout_scan flush [OPTIONS]
Flush unsubmitted data to the api
Options:
--api_url TEXT InOut API url. [required]
--api_key TEXT InOut API key.
--help Show this message and exit.
Testing without a bar code scanner
To test the software without a bar code connected, use a virtual
bar code scanner. This can be done by using socat
:
$ socat -d -d PTY PTY
2020/05/15 10:44:48 socat[47219] N PTY is /dev/pts/3
2020/05/15 10:44:48 socat[47219] N PTY is /dev/pts/4
2020/05/15 10:44:48 socat[47219] N starting data transfer loop with FDs [5,5] and [7,7]
It will output the pseudoterminal names. Leave it running.
In another terminal, run inout_scan
:
$ inout_scan scan --serial_port /dev/pts/4 --api_url 'https://inout.example.com' --scanner fake_scanner
Now, send strings to the other end of the tunnel /dev/pts/3
, ie:
$ seq 1 1000 | while read nr; do echo "mybadge$nr" > /dev/pts/3; sleep 1 ;done
History
0.1.0 (2020-05-13)
- First release on PyPI.
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
inout_scan-0.2.0.tar.gz
(12.6 kB
view hashes)
Built Distribution
Close
Hashes for inout_scan-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410bfdbe63f66f64674ec44073abd36082156f3de22c8a2b887d6bc69b332378 |
|
MD5 | 9fcfe522afa1c6a015a2d189fc7dd0d4 |
|
BLAKE2b-256 | 5ed3d5627151e7296a959ed21c712cd8aeac481b5e9bee735ee3e920057c4091 |