# TRex Jr - Strange LED behaviour?

**URL:** https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477
**Category:** Motor controllers/drivers and motors
**Created:** [September 2, 2009, 11:41pm UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477 "2009-09-02T23:41:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jacotb](https://forum.pololu.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@Jacotb](https://forum.pololu.com/u/Jacotb)
#### Post date: [September 2, 2009, 11:41pm UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477/1 "2009-09-02T23:41:03Z")

</div>

Hi,  
I’ve got a TRex Jr. hooked up to an Acme Systems Fox Board, using the serial console. I have removed all jumpers except the Mix jumper, so when I power on, the blue LED stays on, the red LED blinks 5 times and then stays on. So far so good.  
The problem is, whenever I send a command byte to the serial console, the green LED turns on. Then when I send a data byte it turns off again. But nothing else happens. There is no data returned, and the motor LEDs don’t come on either. These are the commands I send:

root@CrisOs:~# setserial /dev/ttyS2 baud\_base 19200  
root@CrisOs:~# echo -e “\0302” \> /dev/ttyS2  
root@CrisOs:~# echo -e “\0177” \> /dev/ttyS2

The bytes are octal numbers since ‘echo’ requires that. \0302 = 0xC2 or 194, and \0177 = 0x7F or 127. With this command the Motor 1 should start turning forward, but it stays off and the motor LED doesn’t turn on either. All it does is turn the green LED on and then off. Could someone tell me what this means?

Thanks

---

<div class="post-metadata">

### Author: ![Ben](https://forum.pololu.com/user_avatar/forum.pololu.com/ben/32/30_2.png) [@Ben](https://forum.pololu.com/u/Ben)
#### Post date: [September 3, 2009, 12:07am UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477/2 "2009-09-03T00:07:04Z")

</div>

Hello.

The [LED section](https://www.pololu.com/docs/0J5/3.d) of the TReX Jr user’s guide explains in detail what the LED patterns mean:

> [@](#):
>
> The red LED solidly on indicates that serial is in control of the motors (i.e. serial override is active or the TReX Jr is in serial mode). While serial is in control of the motors, the green LED acts as a serial-packet-received indicator. It lights when a command byte is received and stays lit until the last byte of the command packet is received. The flicker rate of the green LED will depend on the baud rate you’re using and the rate at which you’re sending serial commands to the TReX Jr.

The status LED behavior sounds correct for a two-byte command packet such as “Set M1 Forward”, so it’s not immediately obvious to me why you aren’t getting a response from the motor driver. What are you using as your power source? Do you have a motor connected to the outputs, and if so, what is its stall current? Have you changed any of the TReX Jr’s configuration parameters, such as enabling joint-motor mode? Have you ever been able to successfully talk to the TReX Jr via its serial interface?

- Ben

---

<div class="post-metadata">

### Author: ![Jacotb](https://forum.pololu.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@Jacotb](https://forum.pololu.com/u/Jacotb)
#### Post date: [September 3, 2009, 2:58pm UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477/3 "2009-09-03T14:58:31Z")

</div>

Hi Ben,  
I’ve got 2 motors, they are these: [pololu.com/catalog/product/991](https://www.pololu.com/catalog/product/991)  
They’ve got a 0.42A stall current.  
As a power source I’m using a DVE DSA-0101F-05UP Switching Adapter which outputs 2A at 5V. This is the first time I try to get the TRex Jr. to work, I haven’t been able to talk to it before. I haven’t changed anything from the factory configuration.

---

<div class="post-metadata">

### Author: ![Ben](https://forum.pololu.com/user_avatar/forum.pololu.com/ben/32/30_2.png) [@Ben](https://forum.pololu.com/u/Ben)
#### Post date: [September 3, 2009, 6:14pm UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477/4 "2009-09-03T18:14:10Z")

</div>

There are a few things you can try to debug this:

1. Try sending some other commands, such as 0x81 to read the device signature. Try setting the speed of the auxiliary motor (M3) and see if the yellow M3 indicator LED turns on.

2. If you have access to an oscilloscope, try looking at the signals you’re sending the TReX Jr to make sure they are what you expect.

3. Try connecting your TReX to a computer running Windows and using our [Pololu Serial Transmitter](https://www.pololu.com/docs/0J23) to send your commands, and see if you can talk to it with our TReX Configurator utility.

- Ben

---

<div class="post-metadata">

### Author: ![Jacotb](https://forum.pololu.com/letter_avatar_proxy/v4/letter/j/c37758/32.png) [@Jacotb](https://forum.pololu.com/u/Jacotb)
#### Post date: [September 6, 2009, 9:14pm UTC](https://forum.pololu.com/t/trex-jr-strange-led-behaviour/1477/5 "2009-09-06T21:14:38Z")

</div>

Hi Ben,  
It turned out I was sending formatted text rather than raw bytes. I wrote a simple C program to send the data, and I had to set the serial port to non-canonical mode. This time I got a response to the signature command, all seems to be working well.  
Thanks for your help.
