Python Forum
Using Python for communications
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Python for communications
#1
Greetings,

I need to setup communications between a computer running Windows and and the UART of a TI TMS320F28388D microcontroller running C/FreeRtos. The PC will be the master and the TI device will respond but will not initiate conversations.

One option is to use a cmd window on the PC as I have no GUI experience. However I was wondering if Python would be a viable choice on both ends, a standalone Python program on the PC side that may optionally have a GUI and Python embedded in C on the microcontroller.

I am sure there are other choices but this is not my comfort zone. However, a while back I had to augment an existing Python program and it seemed quite versatile and it did some things a lot easier than they would have been in C or C++.

Your thoughts please.

Thanks,
John
Reply
#2
If you can write your code in C, C++, or any other programming language, you can write it in python.

In addition to the common search engines, You can search for already written libraries (packages) for modules that can incorporated in your own code here. for example a search on client/server brings up: https://pypi.org/search/?q=client%2Fserver

My immediate background, prior to python was C, C++, and other laguages, I started using python in earnest around 2010, and have only gone back to C for some very critical embedded code. Everything else has been 100 % python.
Reply
#3
Many thanks for the response. Looks like you responded about 2 hours after I went to bed plus busy at work today so sorry for late response.

I am very glad to hear that you have been able to shift so much of your work to python. I also do embedded work and thus far none of my managers has made any switch. Maybe I can show them something good with this effort.

I appreciate the links. I looked at your search results and very few of the projects has a description. If I had some client server experience perhaps I could figure out something from the names. So I have no idea if they both sides or not. So since I am such a know-nothing about Python and client servers I am a bit bewildered.

I will keep digging but feel free to toss me another bone.

John
Reply
#4
Here's python client/server tutorials:

https://www.digitalocean.com/community/t...ver-client
https://bogotobogo.com/python/python_net...client.php
https://www.codespeedy.com/udp-client-an...in-python/
https://realpython.com/python-sockets/

Hope one of these fills your needs.

There are many more
Reply
#5
Wow. Thanks again Lars. Many bones to gnaw on.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020