loading
 
Re sending serial commands
Kurt Ingleson from United Kingdom  [6 posts]
12 year
Hi, so after much messing about i have managed to get my wifi enabled kondo khr3-hv connected to roborealm, now i have images streaming which is great my main issue is sending command to the bot, i have managed to establish a UDP socket connection to port 8000 on the bot which connects ok, however here is where my issues start, using the software which came with the bot there is a like console, so to make him say walk forwards i hit say button 1 which send the digit 1 to the bot which he is pre programmed to recognise that as take 1 step forwards, so using the socket program i told it to send a 1 to the robot, however when looking at the received digits on the bot using telnet i can see he is getting 12544 which he doesnt understand as he only understands the single digit 1, same for the rest 2 on the bot is take 1 step backwards, so sending a 2 only to the bot he is showing as received 12800, any ideas on how i can get roborealm to just send him the single digit 1 or 2 or 0 etc etc as opposed to the string it appears to be sending him, as these codes are programmed by kondo into the bot i cant change them unfortunately, any help would be great

Thanks
Anonymous 12 year
Kurt,

First off, if you could use a period or two that would help with understanding your post. :-)

Second, if you look at those two values in binary

12544 = 11000100000000
12800 = 11001000000000

You can see something interesting. If you remove the last 8 and the first 2 you get

1 = 0001
2 = 0010

which correspond to the actual values that you want. So your mistake is that 2 bytes are being sent instead of 1 (thus the larger numbers) and something is causing the top 2 bits to be set. Are you using \\ in the socket module?

If you include your robofile we can investigate further but most likely the problem is in the format of what you are using to send the data to the bot over UDP.

STeven.

Anonymous 12 year
Oh, and the other issue is that you probably want to send the ASCII 1 and 2 instead of the binary version. If you can type it in using Telnet then it requires the ascii codes 49 and 50 as single byte messages.

Do you require a newline after those chars? Or does it just expect 1 character?

STeven.
Kurt Ingleson from United Kingdom  [6 posts] 12 year
Hi STeven and thanks for the reply, so punctuation never was my strong point ;-), maybe if i explain my bots setup it will help nail down the issue. I dont know if you are aware how the Kondo KHR3HV works but my setup is as follow, the main robot uses something called an rcb4 which is basically i servo driver board, it also holds the main memory, it has 120 bins which all hold programs, these programs hold the routines on how he moves and which position the servos move to and when etc etc, i think of this as a low level board which does nothing except command the servos, the next level up is actually quite a rare board from Kondo which is the KCB 3WL board, in essence this is a wifi card which runs a bare bones linux distribution. When i connect my camera etc etc this is done through linux, within linux a program is run called rcd4udp server, this server captures commands from my pc, interprets them and passes the command through to the servo driver board, it is the wifi linux card im trying to connect roborealm to, usually you would use a piece of software called rcd commander which communicates via udp on port 8000 to the rcb4 server program, this server program will only work if it gets the correct digit from rcb commander or roborealm, using the trace function in linux i can see what the bot is getting from whichever piece of software i am trying to use. It is from this that i can see that when using rcb commander if i press the up arrow which means move forward rcb commander sends a single digit "1" this then understands the digit and passes to the servo board the command to play the movement in say bin 1, but it could be others they are all programmable. Some buttons will send a 2 or 3 or 0 some send 512, 577. In roborealm if i connect with the socket program to the bots ip address on port 8000 udp, and i put into the send now box 1 or 2 or 512 whatever, this is not what is getting to the bot, they are always 5 digit and not the value i have typed in, i have used no init string nor ////, all i need it to do is send exactly what i type into the send now box, maybe its the format in putting in ie maybe i should be entering "1"// i just dont know enough about rr to be able to figure that out. I hope this explains a bit better how the robots setup, please dont be offended if it sounds like im trying to teach you to suck eggs, i just thought a better explanation would maybe help, i have included the robo basic test file i have setup and also a copy of the rcb commander so you can see what that sends, maybe you could reverse engineer.

Thanks very much
kurt
Kurt Ingleson from United Kingdom  [6 posts] 12 year
Hi STeven and thanks for the reply, so punctuation never was my strong point ;-), maybe if i explain my bots setup it will help nail down the issue. I dont know if you are aware how the Kondo KHR3HV works but my setup is as follow, the main robot uses something called an rcb4 which is basically i servo driver board, it also holds the main memory, it has 120 bins which all hold programs, these programs hold the routines on how he moves and which position the servos move to and when etc etc, i think of this as a low level board which does nothing except command the servos, the next level up is actually quite a rare board from Kondo which is the KCB 3WL board, in essence this is a wifi card which runs a bare bones linux distribution. When i connect my camera etc etc this is done through linux, within linux a program is run called rcd4udp server, this server captures commands from my pc, interprets them and passes the command through to the servo driver board, it is the wifi linux card im trying to connect roborealm to, usually you would use a piece of software called rcd commander which communicates via udp on port 8000 to the rcb4 server program, this server program will only work if it gets the correct digit from rcb commander or roborealm, using the trace function in linux i can see what the bot is getting from whichever piece of software i am trying to use. It is from this that i can see that when using rcb commander if i press the up arrow which means move forward rcb commander sends a single digit "1" this then understands the digit and passes to the servo board the command to play the movement in say bin 1, but it could be others they are all programmable. Some buttons will send a 2 or 3 or 0 some send 512, 577. In roborealm if i connect with the socket program to the bots ip address on port 8000 udp, and i put into the send now box 1 or 2 or 512 whatever, this is not what is getting to the bot, they are always 5 digit and not the value i have typed in, i have used no init string nor ////, all i need it to do is send exactly what i type into the send now box, maybe its the format in putting in ie maybe i should be entering "1"// i just dont know enough about rr to be able to figure that out. I hope this explains a bit better how the robots setup, please dont be offended if it sounds like im trying to teach you to suck eggs, i just thought a better explanation would maybe help, i have included the robo basic test file i have setup and also a copy of the rcb commander so you can see what that sends, maybe you could reverse engineer.

Thanks very much
kurt
RCB Commander.zip
program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index