Mar 08, 2012 Since the spectrometer has a serial port, we can write a program that automates this process. In order for python to be able to talk to the spectrometer, we need to get pySerial, which extends Python's capabilities to include interacting with a serial port. In this python tutorial, I will explain how to: How to configure Python and pySerial. For more details check out pyserial documentation. Check what serial ports are available on your machine. To get a list of available serial ports use. Python -m serial.tools.listports.
Can someone please show me a full python sample code that uses pyserial, i have the package and am wondering how to send the AT commands and read them back!
Willi MentzelPython Serial Port Programming List
closed as off-topic by Drew, miken32, Machavity, doelleri, CerebralFartOct 24 '16 at 17:51
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Drew, miken32, Machavity, doelleri, CerebralFart
4 Answers
FramesterFramesteruse https://pythonhosted.org/pyserial/ for more examples
VatevI have not used pyserial but based on the API documentation at https://pyserial.readthedocs.io/en/latest/shortintro.html it seems like a very nice interface. It might be worth double-checking the specification for AT commands of the device/radio/whatever you are dealing with.
Specifically, some require some period of silence before and/or after the AT command for it to enter into command mode. I have encountered some which do not like reads of the response without some delay first.
Paul OsbornePaul OsborneNot the answer you're looking for? Browse other questions tagged pythonmodempyserial or ask your own question.
Latest versionLast released:
Python Serial Port Extension
Project description
Python Serial Port Extension for Win32, OSX, Linux, BSD, Jython, IronPython
Stable:
- Documentation: http://pythonhosted.org/pyserial/
- Download Page: https://pypi.python.org/pypi/pyserial
Latest:
- Documentation: http://pyserial.readthedocs.io/en/latest/
- Project Homepage: https://github.com/pyserial/pyserial
Release historyRelease notifications
3.4
3.3
3.2.1
3.2
3.1.1
3.1
3.0.1
3.0
2.7
2.6
2.5
2.4
2.3
2.0
1.20
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size pyserial-3.4-py2.py3-none-any.whl (193.7 kB) | File type Wheel | Python version py2.py3 | Upload date | Hashes |
Filename, size pyserial-3.4.tar.gz (151.7 kB) | File type Source | Python version None | Upload date | Hashes |
Python Serial Port Programming Guide
CloseHashes for pyserial-3.4-py2.py3-none-any.whl
Algorithm | Hash digest |
---|---|
SHA256 | e0770fadba80c31013896c7e6ef703f72e7834965954a78e71a3049488d4d7d8 |
MD5 | 0e555d61700e0b95a15d8162092c5299 |
BLAKE2-256 | 0de42a744dd9e3be04a0c0907414e2a01a7c88bb3915cbe3c8cc06e209f59c30 |
Hashes for pyserial-3.4.tar.gz
Algorithm | Hash digest |
---|---|
SHA256 | 6e2d401fdee0eab996cf734e67773a0143b932772ca8b42451440cfed942c627 |
MD5 | ed6183b15519a0ae96675e9c3330c69b |
BLAKE2-256 | cc7411b04703ec416717b247d789103277269d567db575d2fd88f25d9767fe3d |