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

    Need Help with VSCode Pymakr

    Scheduled Pinned Locked Moved Software Tools
    pymakr
    17 Posts 4 Posters 5.0k Views 4 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.
    • D Offline
      dredd @Ralph
      last edited by

      @Ralph However, there seems to be an issue with the Ctrl- commands- there doesn't seem to be an easy way of stopping running code on the board (if it's looping a print command, etc.) for instance if I try Ctrl-C, I get an Error "Cannot read property 'length' of undefined"

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

        @dredd Good to hear it works! The error you are getting after ctrl-c, does it pop-up at the top of the screen as an error (red) or as a warning (yellow)? And does the program stop completely after this error or does it continue working properly?

        D 1 Reply Last reply Reply Quote 0
        • T Offline
          TCB
          last edited by

          Ralph and Dredd

          I am getting the same error as Dredd.

          I have Windows 10 (64 bit). I installed node.js v6.11.1LTS and verified it was installed using the command line Node -v. OK so far.

          As soon started VSC it detected the board and connected. Ctrl D worked OK and the board did a soft reset. Ctrl C did not seem to do anything but I have the default Boot and Main.py installed so no program was actually running.

          I set up a test file that just increments to 10000 and prints out the increment number - saved the file and hit the Run button at the bottom of the screen. The program runs to completion and stops normally. If I hit Ctrl C or Ctrl D I get a red error flag at the top which says "Cannot read property 'length' of undefined" and nothing else happens the program just runs to completion.

          1 Reply Last reply Reply Quote 0
          • D Offline
            dredd @Ralph
            last edited by

            @Ralph Hi, it is a red Error Box and the program running does not seem to be affected.

            1 Reply Last reply Reply Quote 0
            • T Offline
              TCB
              last edited by

              Ralph, Dredd

              This is strange but it now seems to be working. I was thinking it might have something to do with my Java JRE which appears to be out of date. So I did a test run with the same file. I have not updated the JRE.

              This time when the program runs the Run Button changes to STOP which works and does indeed stop the program. Also Ctrl C and Ctrl D work as well. Ctrl C responds with "Keyboard Interrupt"

              No idea if anything changed in the background. There were no Windows Updates overnight on my PC.

              I am thinking this might be me not understanding the system? Yesterday I just pressed RUN. Today I went to "All Commands - Run current file" Is there a difference? With this in mind I closed VSC and opened it again. No file showing. Opened the file and just pressed RUN and it works.

              Dredd. I am wondering if yours is working now?

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

                @TCB Very strange that this ctrl-c problem solved itself. I haven't been able to reproduce the problem yet. In any case I don't think it has anything to do with Java, since it's build on nodejs. There is also no functional difference between the Run button and the 'All commands - run current file'.

                I'll try some different ways and windows installations to see if I get the error as well. One question: which vscode version are you using?

                D 1 Reply Last reply Reply Quote 0
                • T Offline
                  TCB
                  last edited by

                  Hi Ralph

                  VSC Version 1.14.2
                  Shell 1.6.6
                  Renderer 56-0.2924.87
                  Node 7.4.0

                  1 Reply Last reply Reply Quote 0
                  • D Offline
                    dredd @Ralph
                    last edited by

                    @Ralph I am using the same version as @TCB , but I am still getting the error if I try to stop the code running using Ctrl-C.

                    1 Reply Last reply Reply Quote 0
                    • ledbelly2142L Offline
                      ledbelly2142
                      last edited by

                      Check your jumper pins, I had an issue updating firmware when the jumpers fell off. They are not that tight. This may be totally psychosomatic and have nothing to do with how the expansion board is wired, but the TX and RTS jumpers needed to be firmly 'on' for me.

                      Friends don't let friends run with scissors

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        TCB
                        last edited by

                        Interesting. it was working solidly for me. So given ledbelly2142's comments got the program running and I took off the Tx jumper while it was running (bad practice I know) and got the error. I did this a few times and sometimes I got the error and sometimes not.

                        I would have to say I am a bit suspicious about the jumpers, and I concur that they are not that tight. I received my expansion board with the Tx jumper loose in the packet. My past experience with this sort of jumper is once you put them on they stay on.

                        However IMHO the non repeat-ability of the problem with the Tx jumper off suggests it has something to do with it but perhaps they are not the root cause?

                        D 1 Reply Last reply Reply Quote 0
                        • D Offline
                          dredd @TCB
                          last edited by

                          @TCB I agree the jumpers are not confidence inspiring, but in this case I suggest this is a red herring, as I am almost exclusively communicating over wifi and I have replaced the jumpers anyway with properly fitting ones. In any case, I have never had an issue with PuTTY or even the Pymakr IDE which I still occasionally use. Also, I have a board which was sitting perfectly happily on my desk which responded to the Ctrl-C every time without error but on rebooting my PC this morning generates the error every time!

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

                            @ledbelly2142 @TCB I tried this today and managed to reproduce the problem by removing the tx jumper. It only happened once and I couldn't reproduce it again, so I wasn't able to pinpoint the cause in the code yet.

                            But it looks like the tx jumper might indeed be the issue, sometime causing a weird character to to be send to pymakr, that ends up being 'undefined'. Looking at the code, this could cause the error in two places. We'll write a small fix for it and do some more testing on monday.

                            If anyone still gets this "Cannot read property 'length' of undefined" error, please check the tx jumper and try again.

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              TCB
                              last edited by

                              Ralph

                              I was using VSC for an extended period earlier today. The board kept losing connection to my PC. I had to keep resetting and re connecting. Eventually my PC crashed (bluescreen) with an error of "Memory Issue" or similar with root cause being ftser2k.sys which I think is the FTDI driver. The program I was working on involved reading a BLE beacon if that's relevant.

                              As this may be related to the issue I thought I would let you know.

                              BTW I switched to ATOM and am not having the same issue (so far!)

                              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