No announcement yet.

raspberry pi serial communication

  • Filter
  • Time
  • Show
Clear All
new posts

  • raspberry pi serial communication


    I am having certain problems communicating with a raspberry pi. I am connecting a u-lcd 32 pt module to the raspberry by means of a usb hub, and when running a method to send a simple hex string to the display, I notice that it resets. I have thought that this is due to the use of the usb cable that is used for programming the device as well as communicating with it (I have used the same cable to communicate with it via docklight, and it only resets after I choose to close the connection from the docklight side). Is there any way to avoid this? It seems that whenever the serial connection is closed the device resets.
    Thanks in advance for any help.

  • #2

    In Windows, when certain comms parameters are different to what they 'were' Windows will toggle DTR and that will cause the display to reset.

    I'm guessing there's something similar in the Pi.

    So the simplest think to try is to make an 'extension' cable that doesn't connect the reset to the display to see if that fixes it.


    • #3

      Well, thanks for the quick reply. I will be doing that to see if it works.
      Best regards

      Update: I tried what you did and it worked! thanks man. Now if I may ask another question, I have programmed the module to show a level on a tank upon receiving the following HEX sequence:
      0xEE 0x30 0x34 0x35 0xEE, in this case the level will be 45, now while sending that with pyserial from the raspberry, I found the level is changed but not correctly, is there any rule to initiate communication with the display module, because it works perfectly from docklight.
      Best Regards

      New Update: I am now printing the sequence of characters arriving to the module from the RPi in the display, and I have found that only the first character in a sequence arrives correctly, that is, if I send "hello", only 104 (decimal code for h) is printed. This, however, does no happen when I send a sequence from docklight (the whole sequence is received and printed), note that I am using the same connection with docklight (not connnecting the reset pin). Why does this happen?


      • #4

        It seems to me that your problems lies in the Pi, or the way you are sending serial data.

        I don't have a Pi, or experience with it so I can't really suggest much more.

        If you connect Pi to docklight does docklight show "h" or "hello"?

        What baud rate are you using?

        Once you have shown how to create the issue without the display, maybe you might get some help on a Pi forum (Since there doesn't appear to be any Pi regulars here)