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

    FiPy, uart

    Scheduled Pinned Locked Moved FiPy
    6 Posts 3 Posters 689 Views 3 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.
    • J Offline
      justin
      last edited by

      Hello, I am using FiPy and tried to transfer some data from the FiPy to the PC via serial communications. In the Atom IDE I can see the output information (e.g., by print function), so I guess the serial communications is working properly. However, when I tried to use Putty to open the serial port, it failed to do so. I also tried to use Matlab to open and read the serial port but had no luck.

      The relevant code that I used is

      from machine import UART
      uart = UART(1, 115200)                         # init with given baudrate
      uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters
      uart.write('hello')
      

      I followed instruction from the two links below.
      https://docs.pycom.io/gettingstarted/programming/repl/serial.html
      https://docs.pycom.io/firmwareapi/pycom/machine/uart.html

      Could anyone give me some help here? Many thanks.

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

        @justin The UART used for REPL (and thus for the serial connection to Atom) is UART0, connected to the pins P0 and P1. You skript uses UART1, which is connected by default to P3 and P4.
        If you want to send data through UART0, use print() or sys.stdout.write()

        J 1 Reply Last reply Reply Quote 0
        • J Offline
          justin @robert-hh
          last edited by

          @robert-hh Thanks for your instruction. I have changed the code as

          uart = UART(0, baudrate=115200)                         # init with given baudrate
          uart.init(115200, bits=8, parity=None, stop=1) # init with given parameters
          

          I can see the information in the output window of Atom, but I still cannot use putty to access the port.

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

            @justin Yoo have to close Atom, to get access with Putty. And in Putty, you have to disable flow control.

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              justin @robert-hh
              last edited by

              @robert-hh Silly me. I wasn't aware that the port can only be opened by one software.

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

                @justin said in FiPy, uart:

                @robert-hh Silly me. I wasn't aware that the port can only be opened by one software.

                You can have a second REPL output by telnet over WiFi. The default account/password is micro/python. But you have to open a new connection after each deepsleep call.

                And yes, as soon as you configure WiFi this default account exists. So don't forget to set other login credentials, if you deploy your stuff.

                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