Giter VIP home page Giter VIP logo

pythonterminal's Introduction

Dale Gambill, 3/10/2018

I wrote this serial data program in Python 3.5 so that I could compare it to the one I wrote in C#.

I wrote TERMINAL.PY and SERIAL_RX_TX.PY on Windows 10 using the Pycharm IDE.

These two modules show you how to use serial COM ports on Windows 10 to do the following:

- send and receive lines of text terminated with \n
- handle received data with your own event-handler
- send lines of text at regular intervals from a file (replay a log file)


pythonterminal's People

Contributors

dalegambill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythonterminal's Issues

Trying to make a Bit-error-rate tester in Python

Hello Dale.
I love your code. I am just learning PY. I work testing very long serial cables either RS-232 or RS-432 or RS-485. I have an old laptop with Windows XP and a hardware serial port. I use it to test cable.

So, My plan is to put short the send and receive together at the distant end of the cable.
I put my laptop with the PY BERT software on the other end of the cable.

I have started a program in Python that 1st asks for the com port#, then the baud rate. I leave the defaults for the Pyserial as 8 bits, no parity and 1 stop bit.

So, then the program asks how many characters to send. I usually test at 9600 baud, so I enter 20,000 characters.

I then start a for loop and say that i=range (numcharacters)
and then I build a very long string
SendSTR=("")
I put that above the input line to declare it but make it empty.
Then I do a loop that creates a random ASCII number and appends it to the SendStr variable.
That loop repaeats the numcharacters # of times so we now have a very long string.

Then, on character at a time(again, I am thinking a loop) that sends one caracter from the generated string down the serial line, then receives it back( the distant end is in a loopback on the wires) then I compare what was sent with what was recieved. If the two are equal, sent chars counter increments by 1, but error counter remains zero. If the recieved character was NOT what was sent, then the sent character increments by 1 but the Error counter also increments by one.

This is repeated until the entire 20,000 character string is sent.

Then the loops are done and a report is printed:

Print (charsend+ " characters sent.")
Print (errors+ "Recieved")

Then I do some math to come up with a percentage of the errors to sent successfully.

Of course, I am new at this and this is not the best code, but it is good enough.
What do you think?

Maybe you can make something like this quicker than me, I suppose.
I am not sure if I am on the correct tab in Github to just chat about a thing.
I enjoy your code. It inspires me to continue, but I must look into the Class and the Def things.
Thank you for posting this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.