Loading ...
Sorry, an error occurred while loading the content.

Re: Using IV-17 smartsocket with usb>ttl adapter

Expand Messages
  • fixitsan2
    ... Is this any good ? http://stackoverflow.com/questions/602912/how-do-you-echo-a-4-digit-unicode-character-in-bash It looks like you re doing it correctlye
    Message 1 of 12 , Dec 15, 2012
    • 0 Attachment
      --- In smartsockets@yahoogroups.com, "julietmikebravo" <johanboonstra@...> wrote:
      >
      >
      > Thanks for the support.
      >
      > I more or less understand the way the SS is controlled now, but I think the problem is with my computer.
      >
      > I use the Linux command "echo" to send the data to a USB serial port. That goes like this:
      >
      > echo -ne "V" > /dev/ttyUSB1
      >
      > This works, version number pops up. If I want I can clear the screen with the MC command.
      >
      > However, when sending more complex stuff it fails. With echo you can send ASCII, hex, octal, whatever. Hex is send by defining the byte with the \ escape character and the hex number, like:
      >
      > echo -ne "\x4D\x53\x02\x48\x49" > /dev/ttyUSB1
      >
      > This should send MD<2>HI. Still, no response.
      >
      > I think I am going to hook up my Arduino to it and try to send commands from there, I can't trust Linux, echo and a CP2102 USB-TTL adapter to do this properly it seems.
      >


      Is this any good ?
      http://stackoverflow.com/questions/602912/how-do-you-echo-a-4-digit-unicode-character-in-bash

      It looks like you're doing it correctlye (no doubt :) )....but there is mention of setting the language of your shell correctly.

      I've never had to get so involved with Linux unfortunately
    • julietmikebravo
      ... Got the MD and MC commands working, using an Arduino to send the commands like this: Serial.write( MS ); //send command in ASCII Serial.write(100); //send
      Message 2 of 12 , Dec 16, 2012
      • 0 Attachment
        --- In smartsockets@yahoogroups.com, "fixitsan2" <fixitsan@...> wrote:
        >
        >
        >
        > >
        > > I think I am going to hook up my Arduino to it and try to send commands from there, I can't trust Linux, echo and a CP2102 USB-TTL adapter to do this properly it seems.
        >
        > I've never had to get so involved with Linux unfortunately
        >

        Got the MD and MC commands working, using an Arduino to send the commands like this:

        Serial.write("MS"); //send command in ASCII
        Serial.write(100); //send parameters in direct binary values
        Serial.write(4); //
        Serial.write(1); //
        Serial.write("IV-17 Smartsocket driven by Arduino, test OK "); //send ASCII to display
        delay(20000); // wait for 20 sec before re-running commands

        This results in the message scrolling nicely across the tubes :)

        Still, I think an Arduino between the PC and the SS is unneccesary, a proper serial port should be able to drive the SS directly. Going to spend some more time figuring out why the serial adapter/PC is not sending the right data...
      • John Rehwinkel
        ... Linux and the CP2102 aren t your problem. Echo is your problem. It s designed to send human-readable ASCII text to terminals from shell scripts. While
        Message 3 of 12 , Dec 16, 2012
        • 0 Attachment
          > I think I am going to hook up my Arduino to it and try to send commands from there, I can't trust Linux, echo and a CP2102 USB-TTL adapter to do this properly it seems.

          Linux and the CP2102 aren't your problem. Echo is your problem. It's designed to send human-readable ASCII text to terminals from shell scripts. While it can be coerced into sending (some) arbitrary bytes, it's not happy or coöperative about it. Normally, if I want to send arbitrary bytes, I'll just assemble them in a file and
          send them out the serial port with the "cat" command. Alternatively, some systems have a "convert" sort of command that will take pairs of hex digits and send
          the corresponding bytes. And, since you're willing to program an Arduino, you can similarly write a program for Linux to send whatever you want. If you want
          to get more fancy than sending canned text, that's really the way to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you
          could use C or C++ without having to learn a lot of new things.

          If you like, I can write a C program equivalent to the Arduino one you posted to get you started.

          - Cheers,
          John
        • julietmikebravo
          --to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you ... If you can do that that would be very nice. Of course, I
          Message 4 of 12 , Dec 20, 2012
          • 0 Attachment
            --to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you
            > could use C or C++ without having to learn a lot of new things.
            >
            > If you like, I can write a C program equivalent to the Arduino one you posted to get you started.
            >
            > - Cheers,
            > John
            >

            If you can do that that would be very nice. Of course, I am looking into some C programming in Linux also at the moment.

            Regards,

            Johan
          • John Rehwinkel
            ... Happy to, I uploaded it to my server for you: http://www.vitriol.com/ftp/smartsocket.c I don t remember offhand how many bits per second the smartsockets
            Message 5 of 12 , Dec 20, 2012
            • 0 Attachment
              > --to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you
              >> could use C or C++ without having to learn a lot of new things.
              >>
              >> If you like, I can write a C program equivalent to the Arduino one you posted to get you started.
              >>
              > If you can do that that would be very nice. Of course, I am looking into some C programming in Linux also at the moment.

              Happy to, I uploaded it to my server for you:

              http://www.vitriol.com/ftp/smartsocket.c

              I don't remember offhand how many bits per second the smartsockets want - the program is written
              to use 9600bps, 8 bits, no parity. There's a #define near the top that sets the port speed, change it
              as needed.

              A couple of lines below it, a string is set to the name of the serial port device - you'll likely have to change
              this to whatever it is on your system. Many Unix systems offer two versions of serial ports, some have names
              like tty.s0, and others have names like cu.s0. The difference is the kind of flow control required to operate. If
              your system offers both kinds, try them both. Note that you can specify which port to use at run time (see below).

              Compile it with a command like this:

              gcc smartsocket.c -o smartsocket

              To run it, type:

              ./smartsocket

              and it should attempt to connect to the port, configure it, and start sending commands. To use a different
              port than the one compiled in, add the port name to the command line:

              ./smartsocket /dev/tty.USA19Hfd1221P1.1

              Like the Arduino original, it loops forever until interrupted.

              Let me know if you have any questions!

              Cheers,
              John
            • julietmikebravo
              ... Compiled it, but no reaction of the Smartsocket, even when sending the V, CSTxxxxxx or CDT1 command. Until now, the only way I have been able to scroll
              Message 6 of 12 , Jan 1, 2013
              • 0 Attachment
                --- In smartsockets@yahoogroups.com, John Rehwinkel <jrehwin@...> wrote:
                >
                > > --to go. The choice of language is up to you, the Arduino IDE supports a variant of C++. So you
                > >> could use C or C++ without having to learn a lot of new things.
                > >>
                > >> If you like, I can write a C program equivalent to the Arduino one you posted to get you started.
                > >>
                > > If you can do that that would be very nice. Of course, I am looking into some C programming in Linux also at the moment.
                >
                > Happy to, I uploaded it to my server for you:
                >
                > http://www.vitriol.com/ftp/smartsocket.c

                Compiled it, but no reaction of the Smartsocket, even when sending the V, CSTxxxxxx or CDT1 command.

                Until now, the only way I have been able to scroll messages was by connecting it to an Arduino and relaying stuff. I think I will purchase one of those miniature Arduino PCB's and write some kind of abstraction layer. Shouldn't be much code as I don't use all the commands.

                It seems that computers in general have a hard time sending mixed ASCII/binary stuff, microprocessors seem to do this better.
              • fixitsan2
                ... Strange that it won t send even a single V . I was going to suggest there was a timing issue. Is the port looking for some handshaking ? RTC/CTS etc ? Set
                Message 7 of 12 , Jan 7, 2013
                • 0 Attachment
                  --- In smartsockets@yahoogroups.com, "julietmikebravo" wrote:

                  > Compiled it, but no reaction of the Smartsocket, even when sending the V, CSTxxxxxx or CDT1 command.

                  Strange that it won't send even a single 'V'. I was going to suggest there was a timing issue. Is the port looking for some handshaking ? RTC/CTS etc ? Set handshaking to 'none' maybe ?
                • julietmikebravo
                  Recently I hooked up the smartsocket to my Raspberry Pi, first via a USB- TTL adapter, later using the on board GPIO UART. Suddenly no problem sending commands
                  Message 8 of 12 , Dec 28, 2013
                  • 0 Attachment

                    Recently I hooked up the smartsocket to my Raspberry Pi, first via a USB->TTL adapter, later using the on board GPIO UART. Suddenly no problem sending commands to the board:


                    https://www.youtube.com/watch?v=0XWjajBTCXA


                    Seems like using Linux with cheap USB->TTL adapters is problematic, everything works fine just echo'ing stuff from bash like this:


                    sudo echo -ne "MS\70\4\1 text text text"


                    Works like a charm now :)

                  • Kelly P Couch
                    Looks awesome...details please...kp couch Sent from my iPad
                    Message 9 of 12 , Dec 28, 2013
                    • 0 Attachment
                      Looks awesome...details please...kp couch

                      Sent from my iPad

                      On Dec 28, 2013, at 16:51, <johanboonstra@...> wrote:

                       

                      Recently I hooked up the smartsocket to my Raspberry Pi, first via a USB->TTL adapter, later using the on board GPIO UART. Suddenly no problem sending commands to the board:


                      https://www.youtube.com/watch?v=0XWjajBTCXA


                      Seems like using Linux with cheap USB->TTL adapters is problematic, everything works fine just echo'ing stuff from bash like this:


                      sudo echo -ne "MS\70\4\1 text text text"


                      Works like a charm now :)

                    Your message has been successfully submitted and would be delivered to recipients shortly.