How to view serial data for debugging purposes.

Status
Not open for further replies.
Hi,

I have a Teensy 3.6. I'm using the USB port to communicate with a smart phone. I want to view data from the Teensy 3.6 through the built-in serial interface.

I have a HiLetgo FT232RL FTDI USB to TTL Serial Converter adapter module for an Arduino ( https://www.amazon.com/gp/product/B00IJXZQ7C/ref=oh_aui_detailpage_o02_s01?ie=UTF8&psc=1 ).

I don't want to fry my Teensy dev board. I'm wondering if all I have to do is hook a wire from the RX pin on the USB to TTL serial converter to the TX pin on the Teensy (pin 1), hook the TX pin on the USB to TTL serial converter to the RX pin on the Teensy (pin 0), hook the ground from the USB to TTL serial converter to the pin labeled GND (right above pin 0) on the Teensy, and then make sure the USB to TTL serial converter is set to 3.3V.

Is that all that's needed? Then I could just follow the example here: https://www.pjrc.com/teensy/td_uart.html

Do I need to hook the 3.3V on the Teensy 3.6 board to the VCC pin on my TTL to serial adapter?

I should then be able to hook my USB to TTL serial converter mini USB port to my Linux box and then just view the data using my favourite terminal program, right?

Thank you.
 
Last edited:
I'm wondering if all I have to do is hook a wire from the RX pin on the USB to TTL serial converter to the TX pin on the Teensy (pin 1), hook the TX pin on the USB to TTL serial converter to the RX pin on the Teensy (pin 0), hook the ground from the USB to TTL serial converter to the pin labeled GND (right above pin 0) on the Teensy, and then make sure the USB to TTL serial converter is set to 3.3V.

Is that all that's needed?

Yes. In fact, you only need 2 of those 3 wires.

The connection from the TX pin of the USB to TTL serial converter to Teensy's RX1 (pin 0) is not needed, if you are only printing.

Do I need to hook the 3.3V on the Teensy 3.6 board to the VCC pin on my TTL to serial adapter?

No, that's not necessary. If the VCC pin is on the adaptor is something other than 3.3V, it could even result in damage.
 
The Teensy also implements the SerialUSB port. Thus, if you can read that serial port on your phone, you could get data out that way.
If the point of the exercise is to get data to a third device (such as a laptop) at the same time, though, that's not as helpful.
 
Yes. In fact, you only need 2 of those 3 wires.

The connection from the TX pin of the USB to TTL serial converter to Teensy's RX1 (pin 0) is not needed, if you are only printing.



No, that's not necessary. If the VCC pin is on the adaptor is something other than 3.3V, it could even result in damage.

Thank you. I got it hooked up and I actually finished my project. The serial interface really helped with the debugging process. I ended up soldering three pin headers, one to GND, TX, and one to RX. I hooked the TX of the USB to TTL serial converter to the Teensy anyways. I created a separate project to test the serial. These Teensy's are really nice!

I have the option of using 5VDC or 3.3VDC with my USB to TTL serial converter. Do you know what the purpose of the Vcc pin on the converter is for? Would that be if I was hooking to a serial interface that wasn't getting power from another source? Thanks!
 
The Teensy also implements the SerialUSB port. Thus, if you can read that serial port on your phone, you could get data out that way.
If the point of the exercise is to get data to a third device (such as a laptop) at the same time, though, that's not as helpful.

I had read that the Teensy also implements the SerialUSB port, but I wasn't 100% if I could use this. Maybe if I provide some background information on what I'm attempting to do, we could figure out if I could use that SerialUSB port.

I have a cell phone that was given to me. It has a pin code. The owners wanted me to try and recovery pictures off of the phone, but didn't know the pin. I managed to recovery the pictures (they were really bad pictures) by finding some sort of weakness in how the found worked. They told me I could do whatever I wanted with the phone now. So I'm trying to brute-force the pin, hoping it's either a 4 digit or 5 digit pin.

In my attempts to find away in, I hooked the MicroUSB port on the phone up to my Linux box and was able to use:
Code:
modprobe usbserial vendor=<vendorID> product=<productID>
and it created a /dev/ttyUSB0 entry. I was able to connect to this using screen and I believe when the phone started up, I saw the dmesg log. I tried sending commands, but they all failed.

I programmed the Teensy to act as a mouse and keyboard. It has a MicroSD card inside of it and there's a file called pin_num.txt that stores the last pin that it's tried. The phone knows I'm trying to hack into it and has set some sort of kill timer. After I enter 5 invalid attempts, the Teensy has to wait 30 seconds before trying again. After entering 30 pins, the phone resets. If I don't enter any pin, the phone resets after 3 minutes or so. In HBOOT, it shows TAMPER. That's why I use the MicroSD card. I use an On-The-Go MicroUSB to USB cable on the phone and then I hook the Teensy up to that.

So, because I'm using the USB port to send mouse and keyboard commands to the phone, could I still use that SerialUSB port and monitor it, just to see if maybe the phone says something? Thank you.
 
I wanted to update everyone and just say I was successful at brute forcing the pin using the Teensy 3.6 development board. This was a wonderful learning experience and I had so much fun. I was thinking of maybe upload the source code, for other people to use? I'm sure it could be drastically improved upon, but probably not by me. I was thinking of also trying to port the code over to just use the gcc-arm cross compiler and no Arduino / TeensyDuino stuff. But I think that'll be a lot of work. What do you guys think? Do you think anyone would benefit from the code?
 
Status
Not open for further replies.
Back
Top