Lost PyMakr in VSCode



  • Re: Lost pymakr Pycom console in VSCode after update VSCode

    All seemed OK - created project, ran code, uploaded code. Then Pymakr disappeared from VSCode and I cannot get it back. I have tried reverting to VSCode V1.25.1 as suggested in the post above to no avail.

    How can I get it back!?

    Thanks



  • @crumble and @Paul Thornton
    Switching on 'show hidden devices' in the Device manager (Windows 7) did not reveal anything new. Only COM1, Dell COM3 and Dell COM5 showed up (see screenprint in earlier post).

    What finally worked to solve my problem is to install the driver file pycom.inf downloaded from https://github.com/pycom/pycom-micropython-sigfox/blob/master/docs/pycom_esp32/tutorial/includes/downloads/pycom.inf from within the device manager (Action >> Add Legacy Hardware >> Search for and install the hardware automatically >> Ports (COM & LPT) >> Have disk >> Browse to pycom.inf file). I installed the 'Expansion 3' option. That installed the expansion board 3 driver, but it showed an error in the device manager (device cannot start). But when I next connected an expansion board V3.1 (with lopy4) to the laptop with usb, a new COM port ('Expansion 3 COM 19') appeared in the device manager, and this one allows me to connect from Atom. Also an Expansion board V2.1A with a lopy can now be connected.

    So problem solved. Although I still do not know what caused the connection problem. Auto connect does still not work because the working driver is at the bottom of the serial devices list, and the auto-connect takes the first one in the list, that one does not work. But anyway, PROBLEM SOLVED, I can connect manually by selecting the right COM port. Thanks for all the help!



  • @jand

    have a look into the device manager. Your device my be disabled for some reason. You have to check the option for showing unconnected hardware.

    And dont't forget to check, if other devices can connect at the same port.



  • In terms of drivers we do offer them for windows 7, but anything windows 8 and above should work out of the box:
    https://docs.pycom.io/pytrackpysense/installation/drivers.html



  • @jand I just looked into the DELL laptop I have in front of me, and it has the same GPS port. Obviously, the GSM modem also has a GPS receiver integrated, and that one is delivering NMEA sequences. I have definitely no PyCom device attached at the moment.



  • @jand Well. That explains why we have GPS messages coming out of COM5. It was indeed a laptop based GPS card. COM3 is something else internal to the Dell. COM1 doesnt look right either not sure windows is detecting the expansion board at all at this point.

    Do the lights on that expansion board light up when its connected to the PC?



  • @paul-thornton These are the devices shown in the device manager (0_1550656881943_COM port devices.JPG. When I update them, I get the message that all are up to date.



  • @jand said in Lost PyMakr in VSCode:

    I believe the trouble started when I started using a new lopy4 with a new expansion board V3.1. Does such an expansion board load up any driver when you first connect it? Or anything else that is not compatible anymore with Windows7? Or did I just lost a COM-port driver without knowing, and is there a way to install again the driver needed to connect to the expansion boards via USB?

    Nothing that would make it echo out GPS data, Without a pytrack attached we dont actually have anything that could possibly achieve that.

    What does device manager say you have in terms of com ports and unidentified usb devices?



  • @crumble and @Paul-Thornton: I swapped to Atom, and it turns out pymakr in VSCode and Atom show exactly the same behavior: on a new Dell Lattitude laptop running Windows 10, I can connect to all my lopy4 and lopy devices through the expansion boards (V2.1A and V3.1) that I have (with USB cable). But on an old Dell Latitude running Windows 7, I cannot connect to any of them (not with Atom, not with VS Code). That is strange because up to recently that is the laptop I always used to connect to my pycom boards. It was always on COM13, and that port is no longer visible ('List Serial Ports'). Instead COM3 and COM5 now show up, but one cannot connect to them.

    I believe the trouble started when I started using a new lopy4 with a new expansion board V3.1. Does such an expansion board load up any driver when you first connect it? Or anything else that is not compatible anymore with Windows7? Or did I just lost a COM-port driver without knowing, and is there a way to install again the driver needed to connect to the expansion boards via USB?



  • @jand said in Lost PyMakr in VSCode:

    @paul-thornton Yes, these are work laptops. I don't think the IT department has attached an internal chip. But I cannot know that for sure.

    The Rugged latitude series may have a GPS on board. But I think that Dell will write correct sentences onto the virtual serial.

    If it is a project notebook, someone may have installed a virtual GPS to replay recorded test data.

    I blame the dfu driver on the Win 7 machine. The expansion board 2 has no PIC, so the dfu driver shall not interferre.

    Will the pycom update tool, cmd line or a terminal program find your devices?
    Have you connected something to the firmware update pin?



  • @paul-thornton Yes, these are work laptops. I don't think the IT department has attached an internal chip. But I cannot know that for sure.
    I have not modified the LoPy4's firmware since I bought it a few weeks ago.
    The random junk is not the only strange thing. Other things are very puzzling too.

    I worked with old laptop 'A' with expansion board V2.1A and with an older Lopy4 and a lopy quite intensively over the past year or so (in VS Code with pymakr). It always worked except for one interruption for a few days that was also due to an upgrade of VS code that required an update in pymakr as well).

    So i am not sure anymore if the trouble is due to the January update of VS Code or due to the new extension board & Lopy4.



  • @jand said in Lost PyMakr in VSCode:

    Have you modified that LoPy's Firmware at all?

    I'm at a loss as to how you're seeing GPS data with no GPS connected. even if the serial connection was noisy and spewing random junk out. there's no way that data would reliably look like GPS data. and it happening more than once in a lifetime are just so astronomically low...

    Are these work laptops? Is there any chance a work IT department could have somehow attached an internal gps chip to the laptop(s) that just happens to expose it self as a com port somehow and never mentioned it?.



  • @paul-thornton and @Ralph I realized that my problems started when I started using a newly bought expansion board V3.1. So I now tested both the old expansion board V2.1A, and the new expansion board V3.1. And yes, this confirms that there is a different performance between both. But I also get unexpected results for the old expansion board V2.1A.

    I am doing these tests with two laptops: laptop ‘A’ that runs Windows7, and a brand new laptop ‘B’ that runs Windows 10. Both have VS Code 1.31.1 and Pymakr 1.0.6 installed. And I use the same lopy4 for all tests. See my previous posts for the details on the software configurations (as obtained with the ‘about’ button in VS code). These are the results of the tests:

    New laptop ‘B’ with expansion board V2.1A:

    List serial ports yields:
    Found 1 serialport
    COM4 (FTDI) (copied to clipboard)

    The Autoconnect works (on COM4).
    When I disconnect and next do a manual connect (after setting the COM4 port in the address field in pymakr.conf), I still get the reply “>>> Autoconnect: Connecting on COM4...”. And what is even more strange: it does no matter whether I set the address to COM4 or COM3 or COM13 in pymakr.conf! It gets autoconnected. Now and then I get “> Failed to connect (Error: Port is not open). Click here to try again.” Trying again usually gives a successful autoconnect.

    New laptop ‘B’ with expansion board V3.1:

    List serial ports yields:
    Found 1 serialport
    COM3 (Microsoft) (copied to clipboard)

    The Autoconnect does not work.
    When doing a manual connect (after setting the COM port in the address field in pymakr.conf to COM3), nothing happens: no >>> prompt but also no error message. I cannot connect to the board.

    Old laptop ‘A’ with expansion board V2.1A:

    List serial ports yields:
    Found 3 serialports
    COM13 (FTDI) (copied to clipboard)
    COM5 (Dell)
    COM3 (Dell)

    The Autoconnect does not work (nothing happens when I connect the board with the pymakr console open).

    When I disconnect and next do a manual connect (after setting the COM port in the address field in pymakr.conf to COM13), I still get the reply Connecting on COM13....”. But I don’t get a ‘>>>’ prompt, no connection is established. When I now press the reset button on the lopy4, it gets connected:
    ets Jun 8 2016 00:22:57

    rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14612
    entry 0x400a059c
    Pycom MicroPython 1.18.2.r1 [v1.8.6-849-e0fb68e] on 2018-11-26; LoPy4 with ESP32
    Type "help()" for more information.

    So I get a ‘>>>’ prompt. But when I enter a command ‘or just an ‘enter’ at the command prompt, nothing happens: the connection seems to be lost immediately

    When I do a manual connect (after setting the COM port in the address field in pymakr.conf to COM3), I get the following result:
    Connecting on COM3...

    Failed to connect (Error: Port is not open). Click here to try again.

    When setting the address to COM5, I get a continuous stream of garbage:
    Connecting on COM5...
    $GPGGA,,,,,,0,00,0.5,,M,,,,*00
    $GPGSV,1,1,00,,,,,,,,,,,,,,,,79
    $GPGLL,,,,,235944.000,V,N
    77
    $GPGGA,,,,,,0,0,,,M,,,,*1B
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGST,235944.000,,,,0,,,74
    $GPRMC,235944.000,V,,,,,,,,,,N
    40
    (and this keeps on producing a continuous stream of garbage)

    Old laptop ‘A’ with expansion board V3.1:

    List serial ports yields:
    Found 2 serialports
    COM5 (Dell) (copied to clipboard)
    COM3 (Dell)

    The Autoconnect does not work.

    When do a manual connect (after setting the COM port in the address field in pymakr.conf to COM3), I get the following result:
    Connecting on COM3...

    Failed to connect (Error: Port is not open). Click here to try again.

    When setting the address to COM5, I get a continuous stream of garbage:
    Connecting on COM5...
    $GPGGA,,,,,,0,00,0.5,,M,,,,*00
    $GPGSV,1,1,00,,,,,,,,,,,,,,,,79
    $GPGLL,,,,,235944.000,V,N
    77
    $GPGGA,,,,,,0,0,,,M,,,,*1B
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGST,235944.000,,,,0,,,74
    $GPRMC,235944.000,V,,,,,,,,,,N
    40
    (and this keeps on producing a continuous stream of garbage)

    When setting the address to COM13 (which I know is wrong), I get:
    Connecting on COM13...

    Failed to connect (Error: Port is not open). Click here to try again.

    Since I bought two expansion boards V3.1 at the same time, I also did the tests with the second one. It produces exactly the same results as the first one.

    In summary: with the new V3.1 board, I can never establish a connection through USB. With the old V2.1A board I can connect on laptop B: I can connect because the autoconnect works. But with the old V2.1A board I cannot connect on laptop A. And results are quite inconsistent to say the least.

    Finally, I also tried the suggestion of Paul Thornton (to set the autoconnect to false in the global config). That does not improve anything. The only effect is that in case of the old V2.1A board on laptop B, it no longer autoconnects, but still allows a manual connect when the address is correctly set to COM4.



  • @jand do you have autoconnect set to true in the global config? Try turning it to false if so. Had a similar issue to this resolved by that.



  • @ralph I did restart the computer, but that does not change anything. Connecting to the Lopy from VS Code through the wifi still works. But through USB doesn't.

    Desperate to understand the problem, I now installed VS code with the pymakr extension (1.0.6) on a brand new laptop. VS code then shows the following configuration:
    Version: 1.31.1 (system setup)
    Commit: 1b8e8302e405050205e69b59abb3559592bb9e60
    Date: 2019-02-12T02:20:54.427Z
    Electron: 3.1.2
    Chrome: 66.0.3359.181
    Node.js: 10.2.0
    V8: 6.6.346.32
    OS: Windows_NT x64 10.0.17134

    But here again I cannot connect through usb. The symptoms are now different. Pymakr lists the following serial devices:
    Found 1 serialport
    COM3 (Microsoft) (copied to clipboard)

    But when setting the address to COM3 in the global settings, and then connecting does not give any response: no command prompt signalling a connection, and even no error message. No response at all!.

    I should give up and try atom instead? It is not the first time that pymakr stopped working after a VS code update.



  • @robert-hh No, I do not have a GPS module attached. Just an expansion board 3.1 with a Lopy4.



  • This post is deleted!


  • @ralph said in Lost PyMakr in VSCode:

    I don't know what COM5 has attached, but that doesn't look like something any Pycom device would output :) Perhaps @iwahdan can confirm that.

    This is the output of NMEA GPS sentences. Can be a pytrack ;)

    @jand If VSCode works like Atom, click in the window of the output and hit ctrl-c a couple of times. This shall bring you into the REPL.

    There may be a setting which hits the break key as soon the pytrack is connected.

    PS: Your sentences show a lot of garbage. Check the way you read them. It seems that you drop a lot of chars and mix up multiple sentences.



  • @jand said in Lost PyMakr in VSCode:

    $GPGGA,,,,,,0,00,0.5,,M,,,,*00
    $GPGSV,1,1,00,,,,,,,,,,,,,,,,79
    $GPGLL,,,,,235944.000,V,N77
    $GPGGA,,,,,,0,0,,,M,,,,*1B
    $GPGSA,A,1,,,,,,,,,,,,,,,*1E
    $GPGST,235944.000,,,,0,,,74
    $GPRMC,235944.000,V,,,,,,,,,,N40
    $GPGSV,1,1,00,,,,,,,,,,,,,,,,79
    $GPGLL,,,,,235946.000,V,N75

    These look like sequences from a GPS module. Do you by change have one attached?


  • Global Moderator

    Hi @jand, looks like your device is not detected by the driver anymore. If it would be, it would definitely show up in the 'list serial ports' list. Did you restart your computer and try again? Happens on my mac sometimes if you unplug the device when it's connected, it doesn't show up again until you reboot.

    I don't know what COM5 has attached, but that doesn't look like something any Pycom device would output :) Perhaps @iwahdan can confirm that.


 

Pycom on Twitter