Shop OBEX P1 Docs P2 Docs Learn Events
Visual Studio Code supports P2 development on Windows, Mac, Linux (yes, RPi) - Page 9 — Parallax Forums

Visual Studio Code supports P2 development on Windows, Mac, Linux (yes, RPi)

12345679»

Comments

  • Stephen MoracoStephen Moraco Posts: 353
    edited 2025-05-21 18:16

    @wummi , I've released v2.4.5 of the Spin2 extension with the updated SerialPort support. You should already be able to update to it. Let's see if this helps!

  • wummiwummi Posts: 100

    @Stephen, pnut_ts is now running. Thank you for fixing.
    I try the USB-Serial report and get:

    --------------------------------------------------
    USB Libraries on Platforms Test Report for [macOS]
    --------------------------------------------------
    
    Run :  Thursday, May 22, 2025 at 10:32:04 AM
    
        Tool :  VSCode Spin2 Extension v2.4.5 
    
    --------------------------------------------------
    Using library [serialport v13.0.0]:
    
    -- DEVICE -----
     Port: /dev/tty.debug-console
     Manufacturer: undefined
     Serial Number: undefined
     Location ID: undefined
     Vendor ID: undefined
     Product ID: undefined
    
    -- DEVICE -----
     Port: /dev/cu.usbserial-A9M9DV3R
     Manufacturer: FTDI
     Serial Number: A9M9DV3R
     Location ID: 08314000
     Vendor ID: 0403
     Product ID: 6001
    
    -- DEVICE -----
     Port: /dev/cu.usbserial-D30GTX1X
     Manufacturer: FTDI
     Serial Number: D30GTX1X
     Location ID: 08313000
     Vendor ID: 0403
     Product ID: 6015
      - (is PropPlug)
    
    -- DEVICE -----
     Port: /dev/tty.Bluetooth-Incoming-Port
     Manufacturer: undefined
     Serial Number: undefined
     Location ID: undefined
     Vendor ID: undefined
     Product ID: undefined
    
    -- DEVICE -----
     Port: /dev/cu.usbserial-D30GTX1Y
     Manufacturer: FTDI
     Serial Number: D30GTX1Y
     Location ID: 08320000
     Vendor ID: 0403
     Product ID: 6015
      - (is PropPlug)
    
    --------------------------------------------------
    
    --------------------------------------------------
    Open device and get P2 Info:
     [ #1 - /dev/cu.usbserial-D30GTX1X,D30GTX1X ]
     [ #2 - /dev/cu.usbserial-D30GTX1Y,D30GTX1Y ]
    
    Found PropPlug S/N #D30GTX1X at [/dev/cu.usbserial-D30GTX1X]
     P2: 
    --------------------------------------------------
    
    --------------------------------------------------
    VSCode Spin2 Extension by:
     Iron Sheep Productions, LLC
    

    The PropPlug at A9M9DV3R is not found, this is a FT232R USB UART, you not supported yet.

    But in the Toolbar no ProgPlug is shown. Plug:N/A

  • @wummi my code actually looks for vid/pid of 0403/6015 that’s why the device at 0403/6001 is not recognized as a prop plug. Is that device an official part from parallax?

  • wummiwummi Posts: 100

    @"Stephen Moraco" said:
    @wummi my code actually looks for vid/pid of 0403/6015 that’s why the device at 0403/6001 is not recognized as a prop plug. Is that device an official part from parallax?

    No this is a cheap Chinese USB-Serial Plug, but PNUT and Spin-Tool has no problem with it.
    I think it is no good Idea to look only for vid/pid of 0403/6015.
    For me it is good if you look for vid: 0403, because in my projects I only use FTDI USB to Serial Chips.

    But this is not the problem, my Plugs with vid/pid of 0403/6015 are also not shown in the Toobar.

  • Stephen MoracoStephen Moraco Posts: 353
    edited 2025-05-22 20:55

    @wummi, ok, we now understand what's happening!

    Please verify the following for me:

    • See if the two prop plugs are shown in settings as discovered and are available for use.
    • If you click on the toolbar item for the prop-plug selection, you can select one of the two prop-plugs.
    • Once you select one, it stays selected when you return to this project.
    • Lastly, remove (unplug) one of the prop-plugs and open a new project with spin2 code in it. The only prop-plug should be automatically selected for you in this case.

    Re: non-official prop plugs: I could add a setting to remove this PID/VID gate. This will allow you to use the other USB Serial when selected, but we don't know if these other devices will handle DTR toggling correctly, as they are untested. Are you sure you'd like this option added?

  • wummiwummi Posts: 100

    @"Stephen Moraco" said:
    @wummi, ok, we now understand what's happening!

    Please verify the following for me:

    • See if the two prop plugs are shown in settings as discovered and are available for use.

    they are not available, Toolbar always show:

    • If you click on the toolbar item for the prop-plug selection, you can select one of the two prop-plugs.
    • Once you select one, it stays selected when you return to this project.
    • Lastly, remove (unplug) one of the prop-plugs and open a new project with spin2 code in it. The only prop-plug should be automatically selected for you in this case.

    same with a new project and only one official prop plug.

    Re: non-official prop plugs: I could add a setting to remove this PID/VID gate. This will allow you to use the other USB Serial when selected, but we don't know if these other devices will handle DTR toggling correctly, as they are untested. Are you sure you'd like this option added?

    Yes please add this option, not all self made PCBs use the FT231X USB UART for programming and debug.
    And please allow toggling RTS to reset the P2 as an option, when you want to use the FT234XD USB to serial UART interface with
    the packaging (3mm x 3mm 12 pin DFN) for smaller PCB designs. The FT234XD has no DTR-Pin, only the RTS-Pin.

  • @wummi what i don't understand and we need to figure out is why the report says there are two propplugs and why the toolbar says there are none. That's inconsistent and broken. Can you show me what you see in settings:
    PropPlugs in settings

    I'll work on enabling the setting to open up the gate to allow non-propplugs, but I don't know how to predict (code for) the ability to toggle DTR/RTS on these foreign devices.

  • wummiwummi Posts: 100

    @Stephen here the initial Devices List

    I can add the Device manually

    Then the Toolbar changes to

    When I click Plug: Not Selected, the Device List is cleared and in Toolbar Plug: N/A is shown.

    DTR/RTS select:
    In Spin Tools IDE we can select:
    Implement like this:

            if (DTR_Reset_enabled) {
               await this.setDtr(true);
               await waitMSec(2);
               await this.setDtr(false);
               }
            if (RTS_Reset_enabled) {
               await waitMSec(2);
               await this.setRts(true);
               await waitMSec(2);
               await this.setRts(false);
               }
    
    
  • wummiwummi Posts: 100

    @Stephen, I did some more tests.
    My main computer is a Mac Studio M2-MAX with MacOS 15.5.
    On this no Prop-Plugs are found.

    Now I change to a Macbook M1-PRO with MacOS 15.5.
    I install a new VSC, then node.js and pnut_ts.
    I copy the project vom the Mac Studio to the Macbook.

    ctr-opt-cmd-U shows the same Devices as before.
    But no Plugs are shown in the ToolBar.
    Same problems on both Macs.

    Then I change the VSC Language from German to English, no success.

    What next?
    Can you disable the automatic generation for the Device-List.
    Then I can manuel edit the Device-List and try to select one from this Devices.
    When this works, I can try to download to the P2.

  • @wummi thank you for all of this information. Give me a couple of days to make the setup tweaks.

    As an aside, I'm a Mac user as well (Mac Studio M2 Ultra, MacOS Sequoia 15.5), but I don't understand why this is all working for me and not for your Macs.
    If you can think of any possible reasons why, I'm all ears ;-)

  • @Stephen, does the device handling use node.js?
    I use newer versions of node.js, vers 22 and vers 23.
    But I thought node.js is only required for Pnut.ts.

Sign In or Register to comment.