Python Serial Port Commuincation

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

КОМЕНТАРІ • 88

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

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

  • @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.

  • @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

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

    Very good video for out project thanks

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

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

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

      Thank you 😊

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

      Reis adama ingilizce yazsana nasıl anlasın böyle

  • @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.

  • @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.

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

    This was helpful. Great job

  • @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

  • @yorlysflores6564
    @yorlysflores6564 5 днів тому

    Hello, your video is excellent. I have a question. If I wanted to read two ports at the same time with pyserial, how would I do it? Could you help me? Thanks.

  • @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

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

    great explanation sir

  • @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 ;)

  • @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.

    • @Frabito_editzzzzz
      @Frabito_editzzzzz 14 днів тому

      was it resolved ? I am getting the same error and am unable to fix it.

    • @Frabito_editzzzzz
      @Frabito_editzzzzz 14 днів тому

      @@dhanawadeamit It says could not open port COM3. Permission Error (Access is denied)

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

    very very thank you so much for the video

  • @אביבאזולאי-ת8ק
    @אביבאזולאי-ת8ק Рік тому +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

  • @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

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

    Thank you my friend!

  • @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.

  • @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.

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

    Gracias :)

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

    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  2 роки тому

      Are you available to see data on Terminal Software?

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

    Good job 👍

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

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

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

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

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

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

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

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

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

      can I contact u personally wp or mail

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

      @@dhanawadeamit hii sir

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

    Excellent

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

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

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

    thanks you so much

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

    Thank you Amit

  • @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.

  • @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.

  • @aniketsingh9085
    @aniketsingh9085 5 місяців тому

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

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

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

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

    Pls make a video for ubuntu also for serial communication

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

    Can we use this script and using for Linux ubuntu?

  • @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

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

    How to print live data?

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

    Is this code compileable ?

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

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

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

    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!