Client and Server implementation for sending to ARDUINO & PYTHON (using both class PSSM_CLient) and receiving from ARDUINO (using cool Arduino Serial State Machine commands, states, and data via serial console.
- Flash the project: Arduino Serial State Temperature Cable Probe. If you do not have some Negative Temperature Coefficient (NTC) cable probes, do not worry, open analog inputs are always drifting will deliever true random data.
- Plug arduino to USB port and be sure by: ls /dev that there is /dev/ttyACM0 listed,
- Clone or download this project, and type: python run.display
- To kill all threads, take a new terminal and: ps ux | grep python and kill -9
This project is written in python 2.7
I have written an arduino library as the mirrow project: cool Arduino Serial State Machine, where arduino is acting as a server for driving or / and processing sensor / actor / .. data and sending it.
Everything was coded using:
- python 2.7,
- atom editor,
- Gnome as window manager,
- and debian GNU/Linux.
have fun :-)
version 20200404
- Rewritten arduino's method based style to some python's object-oritend style:
- PSSM_Client works fine to comand and request arduino,
- I used Arduino Serial State Temp Cable Probe for running this example.
- reading arduino's answer in a seperate speedy thread,
- saving answers in style of memento; keeping last always available
- PSSM_Server, which is the equivalent to cool Arduino Serial State Machine:
- Not debugged yet, while have to setup a dummy serial console, etc.
- ** no necessary; to follow ..**
- PSSM_Client works fine to comand and request arduino,
version 20200401
- created repository coolPythonSerialStateMachine on github.