A Linksys WRT54g Router, Linux and the SSC-32

Hello All,
I’ve added two serial ports to a Linksys WRT54g router and installed a cross-compiled version of linux. I’m having some trouble getting the SSC-32 to talk to the router over those ports.

With the router’s serial port /dev/tts/0 connected to COM1 of my windows PC, where I am running HyperTerm, I can successfully echo text from a shell on the router to the PC’s terminal with a command like: echo ‘foo’ > /dev/tts/0.

But when I connect the SSC-32 to the router’s serial port /dev/tts/0 and echo commands, I get nothing. The controller’s LED never goes out.

Are there any common causes for the SSC-32 to fail to communicate, particularly when I can demonstrate that, on the same /dev, communations with a terminal is otherwise possible?

Pictures here:
flickr.com/photos/doublellam … 4124617782

Thanks,
Kevin

p.s.: the ssc-32 works perfectly when connected to the windows pc’s serial port, so I do not suspect a problem with the servo controller.

1st off I am guessing you have the settings setup right form the start 8n1 on both sides.

My quick guess is you might need something like this

echo “foo\n” > /dev/tts/o

to send the needed that the SSC-32 needs.

for personal information:
What version of the router are you using (I am intrested in weither you have the old more powerfull proc or the weaker newer one).

also what Linux port are you using on your WRT54G

I currently have version 2.0 (considered the Holy grail version to some). Looking through all of the version of Linux that goes on it.

Having a WRT (GS revision 1.0) and having done the serial mod, the most likely issue here is port speed, parity, and stop bits. The SCC-32 has jumpers for selecting the speed and TLL vs. RS-232 levels. The SCC-32 also needs 8 p0 n1. The WRT defaults port 0 to be 115K baud (plus makes this the console which could interfere with the SCC-32) and port 1 to be 9600 baud. Both ports should default to 8 p1 n1. The WRT also shouldn’t need a serial mod (I’m assuming a MAX233 or similar) since the SCC-32 can take TLL level serial ports. However, you need to get everything set to the same standard, whichever one you choose.

Depending upon your firmware (I use OpenWRT) you may need to compile a utility like setserial yourself to set the speed/ parity/ stop on the WRT side. OpenWRT does have an in distro package. Once you can set the serial port settings to match the SCC-32, you should be able to echo commands. If your distro has setserial just google for the right command string.

If you have to compile something yourself for the WRT, this becomes much harder. Even though I do have a cross-compiler on my system (I could in theory compile OpenWRT from source), I’ve never gotten that to work and I’m relatively familiar with linux and programing. So unless you happen to have great linux skills (if you do get cross-compiling to work please tell me how), or a MIPs workstation (like an SGI Indy or O2), your stuck. As far as code, there should be MIPs capable code for setserial, but if you need to set the port yourself, you can do it. I never tired to change port settings on the MIPs system, but unless there is a big difference in the c libs, you should be able to use the info. here lynxmotion.net/viewtopic.php?t=917 for setting port stuff on an x86 linux system. Last I checked, the WRT doesn’t have enough space for gcc and development files for compiling on the router. Though if you did an SD mod as well, you probably could pull it off, at least in theory. You’d run into the issue of cross-compiling the gcc package as opposed to setserial.

If you need any further info. feel free to ask. I’m rather interested in your results, since I may end up using my WRT in a bot. Both getting the cross-compiler to work, getting gcc on my WRT (I have a 1GB SD mod), or putting linux on my SGI Indy would all let me compile for the WRT. I was trying to get MySQL on the router, but never finished that project because I ran into issues and other projects came up. I resigned to waiting for the OpenWRT team to improve the build environment and make more packages since nobody had a premade package for gcc (that worked) to just put on the SD card. Getting linux on my SGI Indy (as opposed to Irix) would be a real hassle. If you can get a way to compile for the WRT, please let me know.

I’m using a version 5 Wrt54g router with OpenWRT R5 Micro (White Russian) distro. I did not cross-compile it myself.

The dual serial port mod uses a Max233aCPP multichannel RS-232 Driver/Receiver sampled from Maxim.

I first connected the SSC-32 to /dev/tts/1, but that did not work. I connected it to /dev/tts/0, having used that port as console, knowing it at least did not have a hardware fault, also did not work.

Things to try:

  1. Windows/Linux sillyness. Try echo ‘#0 P750\n\r’ > /dev/tts/1
  2. ipkg stty. ‘stty -F /dev/tts/0 -a’ will be my friend.
  3. To heck with RS-232, use the TTL interface.

-Kevin

Hello,

I’m a bit newbish about the electronics but I had to comment on your ship. It looks to be off to a fantastic start! That will be awesome. Will it be involved in actual mock battles with the CO2 powered BB turrets or is it for pure scale model looks? I used to watch Star Blazers (Star Battle Ship Yamato in Japan) every morning when I was a kid.

Do you remove the foam when you are done? This is kind of how I was thinking about doing some of my bigger robotics peices.

I’ll keep an eye on your site to see how it turns out…

:slight_smile:

The ship will be used in R/C Warship combat, with CO2 powered bb cannons.

Each of the main guns require 3 channels of control – rotate, depress and fire – with three main guns on this ship, plus steering and throttle, makes 11 channels. And, I may consider arming some of the secondary cannons. This is why I’m taking the ssc-32 approach.

The glass covered foam is used as a plug to cast a mould. The mould is then used to make fiberglass duplicates of the original. Windows are then cut into the sides of the hull which are covered in thin balsa. Take too many hits bellow the waterline, and you sink.

-K

Very cool,

Wasn’t the Yamato the biggest battleship made at that time?

You must be able to seal up all of the electronics to protect them from submersion when you get holed… Will the servo controller and the servos themselves stay cool enough all bundled up like that?

We need to eqip some Bi-peds with armament like that…

:slight_smile:

Success! Problem was, incorrectly set baud rate.

I added the setserial package to the distro using ipkg, and it told me that /dev/tts/1 is running 9600. I set the jumper on the SSC-32 to 9600, which had been set to 115.2k, cycled the power and it worked.

I thought that I’d tried setting the speed jumpers once already – is power cycling required?

So, on the router I run “nc -l -p 3000 > /dev/tts/1”, then from the laptop, telnet (wirelessly, of course) to that port and start typing in commands the servo controller should understand. Bam, works great.

Now, hopefully, with a high gain antenna, I’ll be able to maintain a connection over a couple hundred yards.

Thanks for the help everybody!

-Kevin

The router/reciever, ssc-32, electronic speed control and other supporting electronics will go in a water-tight box, hopefully with enough head space to keep them cool.

The servos will be located throughout the ship, near the moving parts. When the ship sinks, they’ll be getting wet (which is why I bought the cheap HiTec servos).

Here is a picture of the setup on my bench:
flickr.com/photos/doublellama/236890279

The Yamato was the biggest battleship ever built. Everybody stopped building battleships at the end of WWII, so there never was one bigger. I believe there was no naval warship with a larger displacement until the first Nimitz class carrier put to sea some fourty years later.

-Kevin

Yeah … happy to hear that things are working.

I would like to follow the build of this and I am sure a few others would as well. It would be nice to see a project log on this.

things I would like to see is how the bb canons work. I would look more at you pics but they are blocked, seeing I am at work right now.

Dave

Glad to here thing are going well also. My only advice is you might want to step serial port 1 up rather than bring the controller baud down. I think the WRT can actually get rates much higher than 115K, though I’ve never done that. Sorry about the compiling rant though. :blush:

As far as the bb firing device, I’ve also really love to see the pics when you’re done. I can just image people building working scale mecha with working mini-machine guns. :slight_smile: I didn’t see anything about that part up yet. Also wondering if anybody ever tried to use a guass (coil) mechanism for firing bbs as they are feromagnetic? Since the navy is doing lots of research in this area, it would mean in the future such a model might work exactly the same as it’s bigger brothers. I’ll spare the long-winded speech, but that’s yet another potential project I’ve been sitting on.

I haven’t tried to make that, but I’ve happened across two instances like it.
There’s the EM guns that you can find in most of the “for the Evil Genius” books.
The one’s I’ve read about, though require capacitors that are way too big to put on a scale bot.
Plus, they fired aluminum and other non-fero projectiles.
I’m sure the design could be modified for our fero friends, but the weight isn’t worth doing it.

The other instance I happened upon was when I was disassembling a car starter engine’s solenoid.
When I took of the rear casing, the shaft flew out and made a nice sized dent in a piece of 1/8" sheet aluminum I had propped up against the wall.
I’m wondering if yeh could get similar results with smaller solenoids and lower-mass BB’s.

I would say the rant was ok … Makes me want to get my SGI Indy fired up again. Make it a little easyer than trying to find errors during a cross compiling.

Done a few with good detail instructions but nothing on my own (Before uNSLUng)

I don’t really want to hijack this thread, so if there’s a lot of interest about a guass gun for bots or MIPs compiling, etc. we probably should move it to a new one. However, I’m a bit confused as I thought the NSLUG was ARM, not MIPS. That’s why OpenWRT won’t run on them. I actually wish the NSLUG was MIPs so I could run the SLUG distros on the WRT as they have apache and MySQL, nobody has ported either to OpenWRT (and I can’t), but I’m going off again. Maybe all this talk will get me trying again and harder, hehe.

As far as the gauss gun, I’ve seen people make guns getting 1/5 the energy of a modern handgun. This is in the same range as really high-end CO2 guns. Here is the best link I found: gausspistol.com/ Note the video were he blows up a beer bottle with the gun. If the guy actually would release a kit (I think he gave up on the project for fear of being sued) I would buy one in a heartbeat. The only downside to that model is the 10 sec reload, which isn’t a problem if you have a larger platform for different capacitors and/ or fire rate restrictions.

I know rate of fire is limited, and assume the projectile power is also supposed to be realistic/ period correct/ or otherwise limited? I mean it’s relatively easy to think of ways to sink a model boat. A small Estes rocket with the RDX starters taken from a few other rocket engines used as a warhead would probably tear one in half with a direct hit. I assume such a thing isn’t club legal as its probably no fun when your ship gets blown up after all that hard work not to mention the safety issue. I’d go on, they teach physics majors all kinds of creative ways to damage things, but I don’t want to give you guys too many ideas. :stuck_out_tongue:

My Bad …

Yes the NSLU is ARM as well as my PDA. That is why I have things setup for cross compliling. I have not touched the WRT54 yet as why I made the mistake between the MIPS and ARM on that one. Nice things is I do own a SGI Indy so I just need to finish unpacking it and get the newest version of linux for it. Plus maybe add a larger HDD (I do have one).

Any update on the Yamato or using the SCC-32 to control CO2 guns? I checked up on the flickr set, but doublellama seems to have dropped that for a hungarian rc forum (though this may just be the work of a fellow Yamato builder). As my Hungarian isn’t that good I couldn’t get much out of that.

Not Hungarian! I’m in Seattle.

I’ve made only modest progess on the Yamato since September of last year. The mould is complete - a huge milestone - but I’ve not yet cast a hull.

I’ve only a framework for the control software. I started development in Java on the PC, but have had trouble getting input from USB devices. I chose Java in hopes of making it cross-platform, thinking I might be able to port to the PSP, which has integrated 802.11b.

As for the CO2 guns – I bought a metal working lathe just this week specificly for that project!

Lol. Thanks for the reply, thought you might have left the Lynx forums. I more than can understand if your project gets stalled for some reason, especially one as ambitious as yours.

I would love to see a guide made for setting up this kind of remote control scheme. Wiring the SSC32 to the WRT54 is fairly straightforward, whats confusing me is how you get your PC talking to that serial port over the wireless link.