Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    lopy to raspberry pi serial communication issues

    Scheduled Pinned Locked Moved LoPy
    14 Posts 5 Posters 190 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MusteDaniel
      last edited by

      I have some issues with serial communication a raspberry pi 3, i ll post my codes. If anyone can help me, i would be very grateful! Thanks

      097650c8-80c1-45fd-a159-a06813fe8b12-image.png

      this is how it looks what i send
      dd85d5bd-6b5b-44a3-b865-079b9c954eaa-image.png

      and on raspberry
      0c7aad15-cf67-4339-9253-8cbddad71059-image.png

      and the result
      02bfb387-f23f-4b91-99d8-3f9908f9c465-image.png

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @MusteDaniel
        last edited by

        @MusteDaniel You set uart1 to 115200 baud, but the Serial of the pi to 9600 baud. Since still the printout show proper characters, this is not the primary problem. What happens if you remove the sleep call in the pi?

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          MusteDaniel @robert-hh
          last edited by

          @robert-hh I modified how you said, but the output is still in the same format
          b0a430d2-0a69-437a-aa64-ee71bfbb7eb3-image.png

          even if i use strings like '123' or like in photos, the order change anyway

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @MusteDaniel
            last edited by

            @MusteDaniel it is not the order which changed, there are characters missing. What happens if you reduce the speed to 9600 baud.

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              MusteDaniel @robert-hh
              last edited by

              @robert-hh in last reply is the output with 9600 baud

              C 1 Reply Last reply Reply Quote 0
              • C Offline
                crumble @MusteDaniel
                last edited by

                @MusteDaniel

                Have you switch off WiFi functionality of the Pi3?

                Once upon a time the Pi3 had trouble to run serial and WiFi at the same time. I don't know if they were able to fix it by software in the past 2.5 years.

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  MusteDaniel @crumble
                  last edited by

                  @crumble I deactivate wifi from /boot/config.txt but the output is still in the same manner

                  C 1 Reply Last reply Reply Quote 0
                  • FridaF Offline
                    Frida
                    last edited by

                    Have you:
                    TX <-> RX
                    RX <-> TX
                    gnd <-> gnd

                    1 Reply Last reply Reply Quote 0
                    • C Offline
                      crumble @MusteDaniel
                      last edited by

                      @MusteDaniel

                      core fequency has to be set as well:

                      [https://www.raspberrypi.org/forums/viewtopic.php?t=213499](Link Adresse)
                      [https://tech.scargill.net/raspberry-pi-3-serial/](Link Adresse)

                      robert-hhR M 3 Replies Last reply Reply Quote 0
                      • robert-hhR Offline
                        robert-hh @crumble
                        last edited by

                        @crumble This does not seem to be a frequency or baud rate issue. In that case a lot of other characters would show up. It looks more like two processes fighting for input from the same device. So the posters script only get part of that.

                        1 Reply Last reply Reply Quote 0
                        • robert-hhR Offline
                          robert-hh @crumble
                          last edited by robert-hh

                          @crumble It looks as if /dev/ttyAMA0 is also used by bluetooth. You could try to disable it.

                          M 1 Reply Last reply Reply Quote 0
                          • M Offline
                            MusteDaniel @robert-hh
                            last edited by

                            @robert-hh it s disable

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              MusteDaniel @crumble
                              last edited by

                              @crumble thanks, i tried...no difference

                              1 Reply Last reply Reply Quote 0
                              • G Offline
                                Gruger
                                last edited by

                                Imho you problem originates in the use of "read(20)". You could try to send b'33.5|xxxxx|xxx|xxx \n' or after writing r on the lopy you add a uart1.write(chr(13)).

                                On the Raspi you read rec with rec=ser.readline().
                                So if one or more chars go missing you don't lose your intended string formatting for the other data.

                                1 Reply Last reply Reply Quote 0

                                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                With your input, this post could be even better 💗

                                Register Login
                                • 1 / 1
                                • First post
                                  Last post

                                Pycom on Twitter

                                Pycom