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: 360
    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: 102

    @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: 102

    @"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: 360
    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: 102

    @"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: 102

    @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: 102

    @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 ;-)

  • wummiwummi Posts: 102

    @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.

  • @wummi said:
    @Stephen, does the device handling use node.js?

    The Spin2 VSCode extension is written in TypeScript and uses NPM Packages for serialport and other services.
    VSCode appears to have its own Node.js environment but doesn't expose it directly to extension authors.

  • NEWS

    This may be very few users doing this, but I should at least share my testing results ;-)

    If you are a Mac user running Apple Silicon and are also using Parallels Desktop to run Windows...

    With the release of Spin2 v2.4.5, which includes updated serial port support, the Spin2 extension now works under Windows running in Parallels Desktop.
    (The Node Serialport team finally released a build for Darwin-x64+arm64.)

  • @wummi embarrassingly, I found the problem. Sigh...

    My environment has propplugs with attached P2s. They are found correctly.
    When I don't have the P2s attached and powered up, they are not found.
    This is NOT how I intended this to work.

    I'm fixing the detection code now and will release it shortly. I've also added the new vendor-only match and reset controls for FTDI devices.
    I'm looking forward to your testing with the new version once it's released.

  • @wummi ok, Spin2 Extension updated: Spin2 v2.4.6 should be avail to you now.
    Looking forward to hearing of your test results.

  • wummiwummi Posts: 102

    @Stephen, Spin2 Extension v2.4.6 is working now .
    It finds all Prop-Plugs and I can select one in the Toolbar.
    But when I try do download a bin-File with shift-control-D i get:

     *  Task wird im Ordner VSC ausgeführt:  "" VSC.bin 
    
    zsh:1: permission denied: 
    
     *  Der Terminalprozess "/bin/zsh '-l', '-c', ' "" VSC.bin'" konnte nicht gestartet werden (Exitcode: 126). 
    

    Is an external Loader-program needed?
    And where to get one for MacOS on Apple Silicon CPU?

  • @wummi, I'm looking at this along with your highlight/crash issues. More soon.

Sign In or Register to comment.