<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=15&amp;t=9044" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2013-01-30T15:40:14+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=15&amp;t=9044</id>
<entry>
<author><name><![CDATA[RNope]]></name></author>
<updated>2013-01-30T15:40:14+01:00</updated>
<published>2013-01-30T15:40:14+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37078#p37078</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37078#p37078"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37078#p37078"><![CDATA[
<blockquote class="uncited"><div><br />I don't understand code attached, it looks like you should be sending header then inner after connecting serial but you seem to be sending concat which is blank.<br /></div></blockquote><br />Yep , my fault , a cut/paste error sorry ! should have been  <br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>$packet = 'FF,FF,AA,55,AA,55,37,BA';<br />$explodedPacket = explode&#40;&quot;,&quot;,$packet&#41;;<br /> $concat = &quot;&quot;;<br /> for&#40;$i=0; $i&lt;sizeof&gt;sendMessage&#40;$concat&#41;;<br />&#123;<br />         $temp = hexdec&#40;$explodedPacket&#91;$i&#93;&#41;;<br />         $concat .= chr&#40;$temp&#41;;<br />         &#125;<br />$serial-&gt;sendMessage&#40;$concat&#41;;<br /></code></dd></dl><br /><br />But it does'nt work for me.<br /><br />My (seemingly) 2 most promishing tries with the PHP serial class so far :<br />(if anyone more inspired than me come to this one day)<br /><br />(doesn't work: usb red light on for 10s but no motion)<br /><br /> <dl class="codebox"><dt>Code: </dt><dd><code>$headerHex = 'FFFFAA55AA5537BA';<br />$innerHex = '1400000000010101';<br />$header = join&#40;'', array_map&#40;'chr', array_map&#40;'hexdec',str_split&#40;$headerHex, 2&#41;&#41;&#41;&#41;;<br />$inner = join&#40;'', array_map&#40;'chr', array_map&#40;'hexdec',str_split&#40;$innerHex, 2&#41;&#41;&#41;&#41;;<br />      <br />$serial-&gt;sendMessage&#40;$header&#41;;<br />$serial-&gt;sendMessage&#40;$inner&#41;;</code></dd></dl><br /><br />(doesn't work: usb red light on for 10s but no motion)<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>$headerHex = 'FFFFAA55AA5537BA';<br />$innerHex = '1400000000010101';<br />      <br />$headerBin = pack&#40;&quot;H*&quot;, $headerHex&#41;;<br />$innerBin= pack&#40;&quot;H*&quot;, $innerHex&#41;;<br />      <br />$serial-&gt;sendMessage&#40;$headerBin&#41;;<br />$serial-&gt;sendMessage&#40;$innerBin&#41;;</code></dd></dl><br /><br />Had a look at Endianness (transforming the &quot;H*&quot; into &quot;h&quot; but it doesn't seem to help, not sure of what i was doing anyway.<br /><br /><br />After 5 days of infructuous tries i'm gonna have a look at Javascrit or maybe Python to continue my investigations on a web interface....<br /><br />Thanks for your answers !<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4159">RNope</a> — Wed Jan 30, 2013 3:40 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2013-01-29T19:58:22+01:00</updated>
<published>2013-01-29T19:58:22+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37071#p37071</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37071#p37071"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37071#p37071"><![CDATA[
Sorry no idea, I don't use php or are familiar with library. Sounds like you're on right track with the conversion from hex string to bytes though.<br /><br />I don't understand code attached, it looks like you should be sending header then inner after connecting serial but you seem to be sending concat which is blank.  <br /><br />Hope that helps - good luck<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Tue Jan 29, 2013 7:58 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RNope]]></name></author>
<updated>2013-01-29T15:14:34+01:00</updated>
<published>2013-01-29T15:14:34+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37070#p37070</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37070#p37070"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37070#p37070"><![CDATA[
Thanks for your answers !<br /><br />Pushing a step further i wanted to tried &quot;over the web control&quot; with this PHP -serial class:<br />(cannot put a direct link due to forum limitation sorry)<br />code.google(DOTcom)/p/php-serial/<br /><br />I installed a local Wampserver and tried to send data on serial port but i seem to have a problem converting the 8 bit command into byte array :<br /><br />I tried sending &quot;raw&quot;  data from the result of single &quot;byte conversion&quot; i did in processing  and a web-to-arduino-example using this class:<br /><br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>     &lt;php&gt;deviceSet&#40;&quot;COM9&quot;&#41;; //SET THIS TO WHATEVER YOUR SERIAL DEVICE HAPPENS TO BE<br />     <br />    //Set the serial port parameters. <br />    $serial-&gt;confBaudRate&#40;115200&#41;; //Baud rate: <br />    //$serial-&gt;confParity&#40;&quot;none&quot;&#41;;  //Parity <br />    //$serial-&gt;confCharacterLength&#40;8&#41;; //Character length <br />    //$serial-&gt;confStopBits&#40;1&#41;;  //Stop bits <br />    //$serial-&gt;confFlowControl&#40;&quot;none&quot;&#41;; <br /><br /><br />    //Now we &quot;open&quot; the serial port so we can write to it <br />    $serial-&gt;deviceOpen&#40;&#41;; <br /><br />    //Issue the appropriate command according to the Arduino source code 0=Green On, 1=Green Off, 2=Red On, 3=Red Off.<br />    if &#40;$_GET&#91;'action'&#93; == &quot;greenon&quot;&#41; &#123; <br /><br />//$serial-&gt;sendMessage&#40;&quot;-1 -1 -86 85 -86 85 55 -70&quot;&#41;; //header<br />                $serial-&gt;sendMessage&#40;&quot;-1&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;-1&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;-86&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;85&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;-86&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;85&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;55&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;-70&quot;&#41;;<br />      //$serial-&gt;sendMessage&#40;&quot;20 0 0 0 0 1 1 1&quot;&#41;; //inner<br />      $serial-&gt;sendMessage&#40;&quot;20&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;0&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;0&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;0&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;0&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;1&quot;&#41;;<br />                $serial-&gt;sendMessage&#40;&quot;1&quot;&#41;;<br />      $serial-&gt;sendMessage&#40;&quot;1&quot;&#41;;<br />  //We're done, so close the serial port again <br />    $serial-&gt;deviceClose&#40;&#41;; <br /><br />&#125; <br /><br /><br />?&gt;&lt;DOCTYPE&gt; <br />&lt;html&gt; <br />&lt;head&gt; <br />&lt;meta&gt; <br />&lt;title&gt;Arduino Project 1: Serial LED Control&lt;/title&gt; <br />&lt;/head&gt; <br />&lt;body&gt; <br /><br />&lt;h1&gt;Arduino Project 1: Serial LED Control&lt;/h1&gt; <br />&lt;p&gt;&lt;a href=&quot;&lt;?=$_SERVER&#91;'PHP_SELF'&#93; . &quot;&gt;<br />&lt;/body&gt; <br />&lt;/html&gt;<br /></code></dd></dl><br /><br />Wich doesn't work : (USB red light on for 10s but no motion played)<br /><br />Searching around the web , assuming it was a &quot;type&quot; problem i found two posts indicating quite the same method to transform hexadecimal  to &quot;raw&quot; (assuming byte ?) array :<br />1 using str_plit (or explode) &gt;convert string to array<br />2 using hexdec function &gt;convert hex to dec<br />3 using chr function  &gt; return string from ASII code<br /><br />(cannot put a direct link sorry) phpclasses(DOTorg)/discuss/package/3679/thread/16/<br />(cannot put a direct link sorry) stackoverflow(DOTcom)/questions/11352193/php-convert-c-sharp-hex-blob-hexadecimal-string-back-to-byte-array-prior-to-decr<br /><br />Adaptating it to my problem :<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code><br />$headerHex = 'FFFFAA55AA5537BA';<br />      $innerHex = '1400000000010101';<br />        //$header = join&#40;',', array_map&#40;'hexdec', str_split&#40;$headerHex, 2&#41;&#41;&#41;;<br />      $header = join&#40;',', array_map&#40;'chr', array_map&#40;'hexdec', str_split&#40;$headerHex, 2&#41;&#41;&#41;&#41;;<br />      //$inner = join&#40;',',  array_map&#40;'hexdec', str_split&#40;$innerHex, 2&#41;&#41;&#41;;<br />      $inner = join&#40;',', array_map&#40;'chr', array_map&#40;'hexdec', str_split&#40;$innerHex, 2&#41;&#41;&#41;&#41;;<br />      $serial-&gt;sendMessage&#40;$header&#41;;<br />      $serial-&gt;sendMessage&#40;$inner&#41;;<br /><br /></code></dd></dl><br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>&lt;php&gt;deviceClose&#40;&quot;COM9&quot;&#41;; //Make sure port is closed<br />$serial-&gt;deviceSet&#40;&quot;COM9&quot;&#41;; //Set the comport &#40;/dev/ttyS0&#41;<br />$serial-&gt;confBaudRate&#40;115200&#41;; //Set the baurd rate<br />$serial-&gt;confParity&#40;none&#41;; //Set the Parity<br />$serial-&gt;confCharacterLength&#40;8&#41;; //Set the word length<br />$serial-&gt;confStopBits&#40;1&#41;; //Set Stop Bit<br />$serial-&gt;confFlowControl&#40;none&#41;; //Set FLow Control<br /><br /><br /><br />$packet = $_POST&#91;&quot;newPacket&quot;&#93;;<br />$explodedPacket = explode&#40;&quot;,&quot;,$packet&#41;;<br /><br />$concat = &quot;&quot;;<br /><br />for&#40;$i=0; $i&lt;sizeof&gt;deviceOpen&#40;&#41;; //Open the port ready for transmitt<br />$serial-&gt;sendMessage&#40;$concat&#41;;<br />&#125;<br />?&gt;</code></dd></dl><br /><br />Despite some communication being made (red LED lights on for 10s when i send the command) no motion is played.<br /><br />Any suggestion would be greatly appreciated  !<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4159">RNope</a> — Tue Jan 29, 2013 3:14 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2013-01-21T23:12:48+01:00</updated>
<published>2013-01-21T23:12:48+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37011#p37011</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37011#p37011"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37011#p37011"><![CDATA[
Great stuff - see below &gt;&gt;<br /><br />-(1) Why does the command number doesn't need to be converted in hex before byte conversion (i assume the byte(); function recognise the type of value which is in ?) <br /><br />&gt;&gt; The compiler will convert, so when it sees 0x it expects hex otherwise it expect decimal<br /><br />-(2) It looks like checksum is always the same as the command (cmd in your lib) I don't really understand why (all the rest = to 0 ?) <br /><br />&gt;&gt; Yes for simple 1 Bytes commands (the majority) that's all that's needed, its only for the longer commands you need to calculate it - i.e. setting zero values<br /><br />-(3) can i send infinite serial commands without worrying with the controller buffer size ? <br /><br />&gt;&gt; if you mean can use serial flow control XON/XOFF  I'm not sure it may treat them as binary input, and I'm afraid I don't know how large serial buffer is in RQ-HUNO.  Most cammands will respond, so as long as you wait until you have a 2 byte response, before sending next command you shouldn't have a problem<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Mon Jan 21, 2013 11:12 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RNope]]></name></author>
<updated>2013-01-21T20:56:58+01:00</updated>
<published>2013-01-21T20:56:58+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37010#p37010</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37010#p37010"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37010#p37010"><![CDATA[
Yeah, it works ! <img src="http://forum.robosavvy.com/images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><br /><br />The dirtyest possible way but it works <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br />I put my nose in your librairy isolating<br />byte[] header = new byte[] { 0xFF, 0xFF, 0xAA, 0x55, 0xAA, 0x55, 0x37, 0xBA };<br /><br />wich was not working with Processing so i converted every different hex separately and created the array afterward.<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>import processing.serial.*;<br /> <br /><br />//array header<br />byte a;<br />byte b;<br />byte c;<br />byte d;<br />byte e;<br /><br />a = byte &#40;0xFF&#41;;<br />b = byte &#40;0xAA&#41;;<br />c = byte &#40;0x55&#41;;<br />d = byte &#40;0x37&#41;;<br />e = byte &#40;0xBA&#41;;<br /><br /><br />byte&#91;&#93; header = &#123;a, a, b, c, b, c, d, e&#125;; <br /><br />// array inner<br />byte z;<br />byte y;<br />byte x;<br />byte w;<br /><br />z = byte &#40;20&#41;;<br />y = byte &#40;0x00&#41;;<br />x = byte &#40;0x01&#41;;<br />w = byte &#40;1&#41;; <br /><br />byte&#91;&#93; inner = &#123;z, y, y, y, y, x, w ,w&#125;; <br /> <br />// The serial port:<br />Serial myPort;<br /> <br />// List all the available serial ports:<br />println&#40;Serial.list&#40;&#41;&#41;;<br /> <br />// You may need to change the number in &#91; &#93; to match <br />// the correct port for your system<br />myPort = new Serial&#40;this, Serial.list&#40;&#41;&#91;3&#93;, 115200&#41;;<br /><br /><br />myPort.write&#40;header&#41;;<br />myPort.write&#40;inner&#41;;  </code></dd></dl><br /><br />When i said it was dirty ... <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br />There must be a better way i'll have a look when more time. <br /><br />Still there a few things i 'm some sure of as : <br />-(1) Why does the command number  doesn't need to be converted in hex before byte conversion (i assume the byte(); function recognise the type of value wich is in ?)<br /><br />-(2) It looks like checksum is alway the same as the command (cmd in your lib) I don't really understand why (all the rest = to 0 ?)<br /><br />-(2) can i send infinite serial commands without worrying with the controler buffer size ?<br /><br /><br />I'm now on my way to get a response when the movement is finished with the help of your lib !<br /><br />Thanks a lot for your ultra-fast answer !<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4159">RNope</a> — Mon Jan 21, 2013 8:56 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[l3v3rz]]></name></author>
<updated>2013-01-20T21:24:53+01:00</updated>
<published>2013-01-20T21:24:53+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37008#p37008</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37008#p37008"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37008#p37008"><![CDATA[
Hi there !<br /><br />The serial protocol is very similar/same as that for the 5710 which I know quite well now.<br /><br />1) The numbers in parathenses are no. of bytes - i.e. 8 in the header<br />header (8) =  0xFF 0xFF 0xAA 0x55 0xAA 0x55 0x37 0xBA<br /><br />2) don't care means put any byte value see 0x00 for instance - will affect checksum.<br /><br />3) NO you cannot send it like that - you must send the raw bytes not a string<br />The 0x means HEX so 0xFF = 255 in decimal<br /><br />To send you need to create an array of Bytes[] output - new Bytes[] {0xFF,  etc } and then write bytes array.<br /><br />Ive created a dll with a couple of classes to make life easier - <!-- m --><a class="postlink" href="http://robobuildervc.googlecode.com/files/RobobuilderLib.dll">http://robobuildervc.googlecode.com/fil ... derLib.dll</a><!-- m --><br /><br /><!-- m --><a class="postlink" href="http://code.google.com/p/robobuildervc/source/browse/trunk/RobobuilderLib/PCremote.cs">http://code.google.com/p/robobuildervc/ ... Cremote.cs</a><!-- m --><br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>public class PCremote<br />    &#123;<br />        public SerialPort serialPort;<br />        byte&#91;&#93; header = new byte&#91;&#93; &#123; 0xFF, 0xFF, 0xAA, 0x55, 0xAA, 0x55, 0x37, 0xBA &#125;;<br />        byte&#91;&#93; respnse = new byte&#91;32&#93;;<br /><br />etc......<br /></code></dd></dl><br /><br />There's some examples on the site of using kinnect and other stuff.<br /><br />Have fun.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1101">l3v3rz</a> — Sun Jan 20, 2013 9:24 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[RNope]]></name></author>
<updated>2013-01-20T21:04:19+01:00</updated>
<published>2013-01-20T21:04:19+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37007#p37007</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37007#p37007"/>
<title type="html"><![CDATA[RQ-HUNO Serial communication : newbie questions]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=9044&amp;p=37007#p37007"><![CDATA[
Hi all , thanks for this great forum !<br /><br />After playing a bit with the recomon i finally managed to interface the RQ with MSRS v4 (after few infructuous tries)<br /><br />Now i'd like to go a step further sending direct serial command to the robot (essentially for motion playing)<br />From what'v read i assume i can send direct Serial command like that :<br />Serial.write(&quot;xxxx xxxx xxxx xxxx &quot;);  <br />from almost any language (i tested it on processing as i knew how to establish a serial connection for sure from some arduino plays)<br /><br /><br />I'v read the &quot;RBC over Serial&quot; pdf but i still have (silly) questions : <br />(1) what does the numbers inside parenthesist mean ?<br /><blockquote class="uncited"><div><br />Header(8 )/Command Type (1)/Platform (1) /Command size (4) Command contents (1)<br /></div></blockquote><br /><br />(2)What is &quot;don't care&quot; supposed to mean : put nothing ? put white space ?<br /><blockquote class="uncited"><div><br />0xFF 0xFF 0xAA 0x55 0xAA 0x55 0x37 0xBA 20 don't care 1 Motion No. CheckSum<br /></div></blockquote><br /><br />(3)Assuming i'v started a serial connection at 115200bps on the proper COM port is it correct to send this command to play motion number 1<br /><blockquote class="uncited"><div><br />Serial.print(&quot;0xFF 0xFF 0xAA 0x55 0xAA 0x55 0x37 0xBA 20 1 1 CheckSum&quot;);<br />(with Checksum = 5A in that case if i'm correct assuming &quot;don't care&quot; means put nothing special)<br /></div></blockquote><br /><br /><br />I'm pretty sure it's the&quot; format&quot; : maybe i should'nt put the &quot;0x&quot; before the number if i follow this example<br />/forum/viewtopic.php?t=3269 <br /><br />I tried to do this in Processing , failed (no error but nothing happend)  tried directly with hyper terminal without more success.<br /><br /><br />I'v spend a few days tring to have a better overview of all , this but  as i don't have much (almost any)  programmation skill there is something i must miss.<br />Please assume any very stupid mistake is possible <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br />Thanks for any helpl !<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=4159">RNope</a> — Sun Jan 20, 2013 9:04 pm</p><hr />
]]></content>
</entry>
</feed>