Python Serial Port Commuincation

Поділитися
Вставка
  • Опубліковано 10 вер 2024

КОМЕНТАРІ • 86

  • @elektron2kim666
    @elektron2kim666 Місяць тому

    I'm close to this on the Cardputer and didn't think of timeout. Now I can dig into that.

  • @omnipotentpotato2436
    @omnipotentpotato2436 Рік тому +3

    Very good video for out project thanks

  • @agkkhan2622
    @agkkhan2622 2 роки тому +2

    Do not stop
    Never give up

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому +1

      You are right @Agk Khan :)
      Let's Keep Moving Toward Goals

  • @engr.inigo.silva2000
    @engr.inigo.silva2000 2 роки тому +1

    Thank you Sir. Amit. This video is so handy. Greetings from Mexico.

  • @eswar9255
    @eswar9255 Рік тому +1

    great explanation sir

  • @akashbidap
    @akashbidap 2 роки тому +1

    Nice video sir 😍 Please make a video on java serial communication it will help us a lot sir

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Thank You, Aakash.
      I am so sorry Aakash, as of now I have minimal knowledge of java. But I take this request into account let's see if I could do it for you. Please expect some delay for this video.

  • @sujatayadav1517
    @sujatayadav1517 2 роки тому +1

    This was helpful. Great job

  • @loadfield1133
    @loadfield1133 2 роки тому +1

    Thank you ,very clear explanation especially timeout attribute.

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Glad you liked it. Thank You!

    • @gulshankumar-hd5yj
      @gulshankumar-hd5yj Рік тому

      @@dhanawadeamit sir usb to ttl pr connection ki video bnao jisne clear data fildes ho or data excel 3or more sheets se import kiya ho or on off connection switch ho

  • @ansonkiek6471
    @ansonkiek6471 2 роки тому +1

    Just wanted to ask, my barcode scanner can detect by Hercules serial , but I can’t detect on my software serial input. Is this has to do with port 2,3 RC , TX reverse problem ? The programming software only have serial input selection and setting such as baud rate same as scanner but still can’t trigger

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      There is also a possibility that Hercules serial needs Rx, Tx & GND but your software uses full RS232 protocol with DTR, DSR, CTS & RTS and there could be a problem with these pins.
      Please have a look in this direction, let me know if you want any help

  • @Ardbot
    @Ardbot Рік тому +2

    Спасибо, всё доступно и понятно!

  • @PedroBorges-pe2mu
    @PedroBorges-pe2mu Рік тому

    Do you think I could use something similar to, if I am using two barcode scanners connected in different usb port, see the information that came from each scanner?

    • @dhanawadeamit
      @dhanawadeamit  Рік тому +1

      Yeah, you can have as many serial ports as you can. Just you shall use correct port names while using it. Also in one of experience when I was having bluetooth gadgets connected with laptop i could see that windows creates a serial port for those devices and when I actually connect the USB to Serial module some time it wont work. Then when I disconnect all Bluetooth gadgets deleted all serial port that were created for BT gadgets and started a fresh it started to work perfect as expected all the time.

  • @aniketsingh9085
    @aniketsingh9085 3 місяці тому

    my serial port is sending data bit by bit so how to receive it bit by bit?

  • @nityanandadas5575
    @nityanandadas5575 Рік тому +1

    Excellent

  • @TECHCODETWINS
    @TECHCODETWINS Рік тому

    Why i am getting this error in my code
    SerialException: could not open port 'COM4': PermissionError(13, 'Access is denied.', None, 5)

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      This could be because it was open in the previous session. Please try to disconnect and connect back the usb to serial device.

  • @Matan_Miller
    @Matan_Miller Рік тому +1

    hi, thank you for your video. i copied eveything you did in this video, yet it doen't working. the errors throws me to another file named serialwin32 and serialutil, do you have an idea what can i do? thanks

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      There must be an issue with the usb to serial module. I recommend you to test it individually first so that you will be sure that the hardware works perfectly.

  • @madhavasai9098
    @madhavasai9098 4 місяці тому

    If I want press special Burton's like ESC,f1,f2..... Means how?

  • @josesaumell2908
    @josesaumell2908 11 місяців тому

    Thank you Amit

  • @zikaaaaaa
    @zikaaaaaa Рік тому +1

    thanks you so much

  • @praneshkumar6082
    @praneshkumar6082 2 роки тому

    Thanks for your input.

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      My pleasure!
      Here is the link for Python Tkinter GUI
      ua-cam.com/video/RLp1xWJobAA/v-deo.html

  • @rajibkudas123
    @rajibkudas123 Рік тому

    Very well explained....If I am only receiving some data through serial and I want to plot it in real time can we use the same code with omitting the send part....and can u please tell how to store and plot data in real time...Thanks.....

    • @dhanawadeamit
      @dhanawadeamit  Рік тому +1

      Hello Rajib, Yes it is possible to receive serial data and plot it in real time.
      I recently have uploaded a radar project where I plot real time data, please have a look.
      Here is the video link for you ua-cam.com/video/3jeLWl_nZ28/v-deo.html

  • @user-xi5cm7ip3t
    @user-xi5cm7ip3t Рік тому +1

    Hi, thank you.
    I have a quastion, if i dont know the port name. How can i get it and use it in the code?

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      ua-cam.com/video/ji0aeZnnqQg/v-deo.html In this video I have showed how to test and debug a serial port

  • @woodperfekt
    @woodperfekt 11 місяців тому

    Please also do same thing for C++ & Java :) thanks

  • @anokhautomation4453
    @anokhautomation4453 2 роки тому +1

    Nice tutorial 👍
    Can you please create another tutorial for sending a command to PIC microcontroller with a gui application with tkinter ??

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Thank you for your suggestion ☺️
      Sure, I would like to create 2-3 videos around it. I will upload shortly and let you know.

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому +1

      Here is the link for Python Tkinter GUI
      ua-cam.com/video/RLp1xWJobAA/v-deo.html
      Still, 2 videos to go to have a complete PIC UART interface with Tkinter GUI

  • @abcboy-wg6fw
    @abcboy-wg6fw Рік тому

    Hello Amit, i copied your code but my issue is that i am ot getting any output on my terminal it always prints an empty line. Could you help me please. Thank you in advance

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      First: Please check if your usb to series converter is working separately.
      Second: Is the comp port name in the code matching as that of in device manager.

  • @robertoaraiza7434
    @robertoaraiza7434 Рік тому

    Thank you my friend!

  • @ccc5226
    @ccc5226 Рік тому +1

    Good job 👍

  • @amanbajaj7591
    @amanbajaj7591 2 роки тому

    in my editior loop is working , break through q is working but it is not showing that line "This is the message".it is just going down in terminal. it is like this line is printing but not visible.

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Aman you might have notice it must be going down after timeout. This means your serial did not recieve data.
      There could be multiple reasons like Rx & Tx open, UART to USB module not working, loose connection. I would recommend to check your USB module.
      Check this video ua-cam.com/video/ji0aeZnnqQg/v-deo.html
      Please let me know if you need some more help with it.

  • @roshanbagul5606
    @roshanbagul5606 2 роки тому +1

    Thank you for nice information ..
    I have one question , and I hope you can assist me in that
    I am going to buy a digital dial gauge, and I want to read its measurement with Python on my PC. The digital dial gauge works on the USB serial communication protocol.Some details as follows :Data in ASCII format without unit:
    Pre-decimal position with leading zeroes.
    Number on the post decimal positions depends upon the set resolution.
    Unit: [mm]:
    sign X X X . X X X X CR
    „CR“ Carriage Return
    Is it possible to communicate with python with digital dial gauge?and How?
    Thanks in advance..

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Yes it is possible to read data from digital dail gauge. As your data is in string format and not a character you shall use "readline" method in python. In the video I have explained how to read complete string using readline method. First use my code as it is with readline method and verify gauge data can be read, then modify the code as per your application.

    • @roshanbagul5606
      @roshanbagul5606 2 роки тому

      @@dhanawadeamit Thank you very much for your quick response
      I will inform you , when it works ..

    • @roshanbagul5606
      @roshanbagul5606 2 роки тому +2

      Hallo ..
      It is working for me . Thanks again..👍

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому +1

      @@roshanbagul5606 Glad to know Roshan. Enjoy Coding ;)

  • @mauriciograsso8102
    @mauriciograsso8102 Рік тому +1

    Gracias :)

  • @hamidabdalla5214
    @hamidabdalla5214 Рік тому

    Hi sure
    i need to read data from scale by using python
    the scale connect with my computer using usb Rs232
    Cab you help me ?

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      Are you available to see data on Terminal Software?

  • @bheemkill4282
    @bheemkill4282 Рік тому

    Pls make a video for ubuntu also for serial communication

  • @aikrihn8069
    @aikrihn8069 Рік тому


    eliminates the timeout I understand but my doubt is can I remove the timeout by keeping
    ?

    • @dhanawadeamit
      @dhanawadeamit  Рік тому

      Yeah, you can but you have to make sure that all the time you message shall contain
      or else it will stuck infinite time there, usually when we connect with hardware we might not know that the hardware will send correct values so it is recommended to have time out. If your data comes delayed then what you set in time out then you shall consider increasing the time in timeout setting.

  • @diegodavicino5721
    @diegodavicino5721 2 роки тому +1

    hi good video , can explain how to install the import serial.Thanks

    • @dhanawadeamit
      @dhanawadeamit  2 роки тому

      Hi Diego,
      The serial library installation process is described in the video below:
      ua-cam.com/video/ji0aeZnnqQg/v-deo.html
      This could be a help

  • @abhijitdixit6670
    @abhijitdixit6670 Рік тому

    Hii sir i have a doubt how to print the values separate separate like - arr[0]-A,arr[1]-B. This.

    • @abhijitdixit6670
      @abhijitdixit6670 Рік тому

      Can any one send the code for this type of out put

    • @dhanawadeamit
      @dhanawadeamit  Рік тому +1

      @@abhijitdixit6670Do you see this same string on your serial port?
      If yes what specific character do you want to print?

    • @abhijitdixit6670
      @abhijitdixit6670 Рік тому

      @@dhanawadeamit i want to print A,B,C but in separate separate

    • @abhijitdixit6670
      @abhijitdixit6670 Рік тому

      can I contact u personally wp or mail

    • @abhijitdixit6670
      @abhijitdixit6670 Рік тому

      @@dhanawadeamit hii sir

  • @nurbaini4308
    @nurbaini4308 Рік тому

    Can we use this script and using for Linux ubuntu?

  • @mohitarya-fs7tr
    @mohitarya-fs7tr 2 місяці тому

    hello @sir can I get your contact info, I need you help to create one project

  • @danyalaslam8174
    @danyalaslam8174 Рік тому

    Is this code compileable ?

  • @sushmashaiva1380
    @sushmashaiva1380 Рік тому

    How to print live data?

  • @qozia1370
    @qozia1370 7 місяців тому

    What is the point of this video! Useless.
    Better usage of the usb uart board it bi-directional communication.
    Where the pico or whatever can read things from the pc and do something based on it!