1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

8 channel USB GPIO code doesn't work with command line on Windows 7

Discussion in 'GPIO Modules' started by ripe, Aug 19, 2015.

  1. ripe

    ripe New Member

    Joined:
    Aug 19, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    Hello
    I have bought a 8 channel usb gpio module and I have a problem.

    I have installed driver ,
    I have plugged usb,
    I have made a small circuit with a led and a resistor.
    I have found that the module is on the port COM13
    I have tried some code with tera term.

    Everything was OK, then I have made a small batch with command lines (for windows 7)

    This code turns on the light
    echo gpio set 0 \r > \\.\com13

    So I have made another one to turn off the light
    echo gpio clear 0 \r > \\.\com13

    This one doesn't work...
    Do you have an explanation ?
    Can you help me ?
     
  2. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    Hi ripe,

    Just tried the above commands and it looks like the first command works every time irrespective of it is a set command or clear command. Since everything works fine with Teraterm, I would think this issue has something to do with the nuances of how echo command works on Windows. We will take a closer look at this and update in the next few days.

    Thanks,
    Tom
     
  3. ripe

    ripe New Member

    Joined:
    Aug 19, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    Hello,

    I have made another test.
    I have lighted on the LED with tera term, then I have used the command line
    echo gpio clear 0 \r > \\.\com13

    The LED has turned off,
    Then I have tried the command to set the LED on.
    So I made the same conclusion.

    I hope you can find an explanation about that echo issue
     
  4. Jim Posniewski

    Jim Posniewski New Member

    Joined:
    Oct 7, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Location:
    USA
    Any update on this?
    I can't get it to work from windows command prompt or Windows Powershell.
    Powershell script I am using is:

    [System.IO.Ports.SerialPort]::getportnames()
    $port= new-Object System.IO.Ports.SerialPort COM4
    $port.ReadTimeOut = 500
    $port.open()
    $port.WriteLine("`r")
    $port.ReadExisting()
    $port.WriteLine("ver `r")
    $port.ReadExisting()
    $port.close()

    I tried ReadLine() as well, no luck
     
  5. ripe

    ripe New Member

    Joined:
    Aug 19, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    Hello,
    I didn't find a solution with command lines,
    so I've used Python for my project.
     
  6. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    Hi Jim,

    I apologize for the long delay to respond to the question. We tried sending commands in different ways and none of them helped. We see that the "screen" command on Linux works as expected so assuming Windows is sending some additional characters or replacing \r with something else that is confusing the board.

    Thanks,
    Tom
     
  7. ripe

    ripe New Member

    Joined:
    Aug 19, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    france
    Hi,
    thank you for the feedback.
    Maybe someone else will find the good way to use command on Windows for that kind of situation.

    To be continued...
     
  8. socketcheese

    socketcheese New Member

    Joined:
    Dec 13, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Canada
    Hi Tom,

    I am concerned by this thread. I am considering purchasing this module for my home automation, but reading this thread it seems that Windows isn't officially supported.. is this correct? You answers that "it works on Linux" does nothing to reassure me. It somehow contradicts the marketing on the website that states: "Currently Numato Lab's GPIO devices are tested on different Windows version..."

    Is Windows officially supported and working?

    Thanks
     
  9. admin

    admin Administrator Staff Member

    Joined:
    Jan 23, 2015
    Messages:
    169
    Likes Received:
    11
    Trophy Points:
    18
    Hi socketcheese,

    Windows certainly is an officially supported Operating System. This thread talks about 'echo' command possibly sending data out in format that is not recognized by the module. In fact there are more sample code snippets listed at the product page for Windows than any other OS. Please see the "OS" column in the table under "Sample Code" tab.

    Thanks,
    Tom
     

Share This Page