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

    this code is breaking my sipy

    Scheduled Pinned Locked Moved Pymakr
    15 Posts 2 Posters 3.9k Views 2 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.
    • I Offline
      iotmaker
      last edited by

      this code is breaking my sipy

      from machine import UART

      uart=UART(1, baudrate=9600)

      uart.init(9600, bits=8, parity=None, stop=1)
      while(1):
      print(uart.readall())

      1 Reply Last reply Reply Quote 0
      • I Offline
        iotmaker
        last edited by

        now i can only connect via wifi

        1 Reply Last reply Reply Quote 0
        • I Offline
          iotmaker
          last edited by

          the code is worky using putty and it does not work on the pymakr console...

          so are we supposed to download programs vi the wifi and then run the serial port on putty or what?

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @iotmaker
            last edited by

            @iotmaker
            What do you mean it work on putty? To work with pymakr you need duplicate terminal.
            What is your boot.py is it standard as:

            from machine import UART
            import os
            uart = UART(0, 115200)
            os.dupterm(uart)
            

            If answer is yes, then your code only print all data from UART1 as output on UART0

            think about people first, then computers

            I 1 Reply Last reply Reply Quote 0
            • I Offline
              iotmaker @livius
              last edited by

              @livius said in this code is breaking my sipy:

              @iotmaker
              What do you mean it work on putty? To work with pymakr you need duplicate terminal.
              What is your boot.py is it standard as:

              from machine import UART
              import os
              uart = UART(0, 115200)
              os.dupterm(uart)
              

              If answer is yes, then your code only print all data from UART1 as output on UART0

              yes thats what my code is doing. on the pymakr console i cannot see my prints. only on putty. ( i have putty closed when trying pymakr of course cant use the com port on two programs).

              after the program is running i cant connnect to the sipy and download programs via serial port. Is that normal?

              do i need to turn on the wireless everytime i want to download a program?.. .thanks

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @iotmaker
                last edited by

                @iotmaker

                what if you change it to

                while(1):
                    print(uart.readall())
                    machine.idle()
                

                think about people first, then computers

                I 1 Reply Last reply Reply Quote 0
                • I Offline
                  iotmaker @livius
                  last edited by

                  @livius said in this code is breaking my sipy:

                  @iotmaker

                  what if you change it to

                  while(1):
                      print(uart.readall())
                      machine.idle()
                  

                  I am not at home to try.

                  but i think you cannot use the COM port to download programs if you are using a program that uses the comport to print to the screen

                  i dont want to be switching my wifi connection every time i want to download something.

                  L 1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius @iotmaker
                    last edited by

                    @iotmaker said in this code is breaking my sipy:

                    but i think you cannot use the COM port to download programs if you are using a program that uses the comport to print to the screen

                    I do not understand your answer
                    But first, what are you trying to do? for what is your modification about uart1? You have some device on UART1? And UART/USB converter on UART0? Or what?

                    Secondly you can use AP+STA mode of wifi.

                    think about people first, then computers

                    1 Reply Last reply Reply Quote 0
                    • I Offline
                      iotmaker
                      last edited by

                      i just want to download and connect to the sipy via Serial or COM. but when i switch on the interface menu to use my COM port it cant connect. i dont like to connect to the sipy wifi everytime to download code.

                      0_1486174609756_sipy.png

                      L 1 Reply Last reply Reply Quote 0
                      • L Offline
                        livius @iotmaker
                        last edited by livius

                        @iotmaker
                        i still do not understand you
                        please back to previous post and look at my sample
                        do you have it in boot.py?

                        from machine import UART
                        import os
                        uart = UART(0, 115200)
                        os.dupterm(uart)
                        

                        above duplicate rerminal on uart0 have you it in boot.py or not?

                        without duplicate terminal you can not work on COM throught Pymakr

                        think about people first, then computers

                        1 Reply Last reply Reply Quote 0
                        • I Offline
                          iotmaker
                          last edited by

                          @livius said in this code is breaking my sipy:

                          @iotmaker
                          i still do not understand you
                          please back to previous post and look at my sample
                          do you have it in boot.py?

                          from machine import UART
                          import os
                          uart = UART(0, 115200)
                          os.dupterm(uart)
                          

                          above duplicate rerminal on uart0 have you it in boot.py or not?

                          without duplicate terminal you can not work on COM throught Pymakr

                          Yes i have that code on the boot.py

                          L 1 Reply Last reply Reply Quote 0
                          • L Offline
                            livius @iotmaker
                            last edited by

                            @iotmaker
                            ok - then this must be something in pymakr
                            but did you tried wifi AP+STA?
                            you then can connect to router and in the same time connect to Wipy/LoPy

                            think about people first, then computers

                            I 1 Reply Last reply Reply Quote 0
                            • I Offline
                              iotmaker @livius
                              last edited by

                              @livius said in this code is breaking my sipy:

                              @iotmaker
                              ok - then this must be something in pymakr
                              but did you tried wifi AP+STA?
                              you then can connect to router and in the same time connect to Wipy/LoPy

                              thanks livius... yes thats the weird thing. it works with wifi, i can connect my laptop to the sipy wify and connect the pymakr without problem..

                              i will see what else i can do..

                              L 1 Reply Last reply Reply Quote 0
                              • L Offline
                                livius @iotmaker
                                last edited by

                                @iotmaker
                                just curious
                                what you have connected on uart1? GPS, phone...?

                                think about people first, then computers

                                1 Reply Last reply Reply Quote 0
                                • I Offline
                                  iotmaker
                                  last edited by

                                  gps...

                                  i kind of found part of the problem...

                                  the on the boot.py i had

                                  from machine import UART
                                  import os
                                  uart = UART(0, 115200)
                                  os.dupterm(uart)

                                  and on my main.py

                                  from machine import UART
                                  import time
                                  import pycom

                                  uart=UART(1, pins=("G2", "G1") )
                                  pycom.rgbled(0x000000)
                                  uart.init(9600, bits=8, parity=None, stop=1)
                                  while(1):
                                  print(uart.readall())
                                  time.sleep(1)

                                  maybe having uart on the boot and main.py files is conflicting... gonna change them

                                  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