Skip to content

xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial

Repository files navigation

Cross Platform Serial programming using Python and PySerial

Python serial programmming using pyserial tutorial

A short introduction into serial port programming using Python and PySerial Library on Windows and Linux Systems.

  • Python 3.8.x language
  • Pyserial 3.4 Library

The Python code running on the x86/x64 PC communicates with an microcontroller through serial link (TX,RX and Ground).

  • Runs on Both Linux and Windows
  • supports only Python 3.x.x Versions
  • Added Arduino codes
  • Microcontroller used is MSP430G2553 on Launchpad
  • MSP430 Codes written in C and Compiled using IAR Embedded WorkBench
  • ATmega328P Codes written in Embedded C (WinAVR)

Youtube Tutorials


Pyserial on Linux

Python serial programmming using pyserial on linux tutorial

  • Linux Specific parts of using Pyserial and avoiding access to serial port denied can be found below
  • Python Serial Communication using PySerial on Linux platform {Linux specific parts}
  • Codes tested on Ubuntu 20.04 LTS and Rocky Linux 8 (Centos/RHEL Family)
  • Change permissions using chmod command before running on Linux.
  • Run the codes like [user@loclahost]$ python3 _Number_PythonCode_repo.py
  • If you are experiencing permission to /dev/ttyUSB0 denied errors check the above tutorial

Codes in Repo

  • _1_Python3_Codes
  • _2_Arduino_Uno_Codes
  • _3_MSP430G2553_Codes
  • _4_ATmega328P_Embedded_C_Codes

Online Tutorial


Circuit


Hardware used