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

    VS Code COM port setting ignored

    Scheduled Pinned Locked Moved Software Tools
    bugpymakr
    11 Posts 6 Posters 1.4k Views 6 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.
    • C Offline
      ChangedDaily
      last edited by

      Hi,
      I have been using VSCode and Pymakr and it is generally working OK. I am using a USB to serial adapter, as it happens on COM10. I wanted to start debugging some serial port functions so plugged in a second USB serial adapter which came up as COM3. Pymakr now insists that it has found a Pycom module on this COM port and ignores the setting in pymakr.conf and pymakr.json and tries to connect on COM3. It seems that it is simply using the lowest number COM port, whatever the settings. I have tried with auto_connect set True and False, it doesn't help.

      I have actually managed to get things working by swapping over so that the Pycom module is indeed on COM3 but I can see this becoming a nuisance.

      How can I fix the COM port used for the connection?

      Thanks

      1 Reply Last reply Reply Quote 0
      • P Offline
        Paul Thornton
        last edited by

        Could you post both your global pymakr conf and the per project one if you have one so I can take a look. It should use what you've given it. Not just decide on one itself.

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

          Hi, I should have included these first time:

          pymakr.conf:

          {
              "address": "COM10 (FTDI)",
              "username": "micro",
              "password": "python",
              "sync_folder": "",
              "open_on_start": true,
              "safe_boot_on_upload": true,
              "py_ignore": [],
              "fast_upload": false,
              "ctrl_c_on_connect" : true
          }
          

          pymakr.json (from All commands->Pymakr>Global settings):

          {
          	"address": "COM10 (FTDI)",
          	"username": "micro",
          	"password": "python",
          	"sync_folder": "",
          	"open_on_start": true,
          	"safe_boot_on_upload": false,
          	"py_ignore": [],
          	"fast_upload": false,
          	"sync_file_types": "py,txt,log,json,xml,html,js,css,mpy",
          	"ctrl_c_on_connect": false,
          	"sync_all_file_types": false,
          	"auto_connect": true
          }
          

          Thanks

          P R 2 Replies Last reply Reply Quote 0
          • P Offline
            Paul Thornton @ChangedDaily
            last edited by

            @changeddaily

            Hello.

            Please remove the (FTDI) parts and try again.
            It only needs "COM10" :)

            Should work after that.

            Paul

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

              Hi,

              I've changed both settings as suggested but it still insists on going to COM3.

              Patrick

              C 1 Reply Last reply Reply Quote 0
              • M Offline
                Milan
                last edited by Milan

                @changeddaily I had similar issue with Atom, there is option that was checked to always select first COM port from list. It sound to me that VS Code is doing the same thing.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  combaindeft @ChangedDaily
                  last edited by

                  @changeddaily said in VS Code COM port setting ignored:

                  Hi,
                  I've changed both settings as suggested but it still insists on going to COM3.
                  Patrick

                  hmm ... I'm not really sure about how it works on Windows ... as on Mac / Linux we provide the full path to our "/dev/...."

                  here is a copy of my files:

                  pymakr.json [Global Settings]

                  {
                  	"address": "/dev/cu.usbmodem",
                  	"username": "micro",
                  	"password": "python",
                  	"sync_folder": "",
                  	"open_on_start": true,
                  	"statusbar_buttons": [
                  		"console",
                  		"run",
                  		"upload",
                  		"download",
                  		"status",
                  		"disconnect",
                  		"listserial",
                  		"projectsettings",
                  		"settings",
                  		"getversion",
                  		"getssid"
                  	],
                  	"sync_file_types": "py,txt,log,json,xml",
                  	"ctrl_c_on_connect": false,
                  	"safe_boot_on_upload": false,
                  	"sync_all_file_types": false,
                  	"auto_connect": false,
                  	"py_ignore": [],
                  	"fast_upload": false
                  }
                  

                  pymakr.conf [Project Settings]

                   {
                      "address": "/dev/cu.usbmodemPy3434341",
                      "username": "micro",
                      "password": "python",
                      "sync_folder": "",
                      "open_on_start": true,
                      "statusbar_buttons": [
                          "status",
                          "listserial",
                          "settings",
                          "projectsettings",
                          "getversion",
                          "getssid",
                          "console",
                          "run",
                          "upload",
                          "download",
                          "connect",
                          "disconnect"
                      ],
                      "sync_file_types": "py,txt,log,json,xml",
                      "ctrl_c_on_connect": false
                  }
                  
                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    Ralph @ChangedDaily
                    last edited by

                    @changeddaily You have auto_connect set to true in the global settings, which is why it connects to COM3. If autoconnect finds 2 potential pycom devices it just picks the first one in the list it gets back from the serial library.

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      ChangedDaily @Ralph
                      last edited by ChangedDaily

                      @ralph Yes, I can confirm that changing to just "COM10" and setting auto connect to false fixes the issue. Perhaps some changes to the default settings or further explanation in the documentation would be helpful.

                      Thanks to all for suggestions.

                      R 1 Reply Last reply Reply Quote 1
                      • R Offline
                        Ralph @ChangedDaily
                        last edited by

                        @changeddaily Good to hear. Yes I agree, our documentation could definitely use an update.

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

                          I also could not connect to my board and solved the problem as follows:

                          If your PC has Bluetooth, have you ever tried to turn off Bluetooth? On my PC, Bluetooth uses COM3. Pymark always tried to connect to COM3. After I turned off Bluetooth, I was able to connect to my Pycom board without any problems.

                          Once a connection to the board has been established, the board can also reconnect successfully with Bluetooth turned on.

                          I hope this information helps. (:

                          In my case COM3 is used by Bluetooth and Pymark tries to connect to COM3.
                          85fee3ed-fbf7-4c3a-aafa-7c2e4310b551-image.png

                          In this menu you can disable Bluetooth
                          a2ac2595-41ee-4d30-98cf-a1336265b5ab-image.png

                          Connection to the board has been established successfully:
                          72640caf-babc-4421-aa13-34d4d1ce8800-image.png

                          1 Reply Last reply Reply Quote 1

                          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