OpenWrt Forum Archive

Topic: Hardware hacking TL-703N (433Mhz and Display)

The content of this topic has been archived on 11 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I´ve a general question regarding hardware hacking of a TL-703N wink

I want to connect two devices to my tl-703n and I´d like to know if it is possible.

This two devices, I´d like to connect:

a 433Mhz receiver RFM12B:
http://www.ebay.com/itm/FIFO-Arduino-SD … 416defe6cd

and a serial display:
http://www.ebay.com/itm/IIC-I2C-TWI-SP- … 484fbaf047

Is it is possible with a little bit of soldering and linux kernel configuration?

In the last few days I´ve read a lot of posts and I google hundreds of websites but I haven´t get it till now, I hope some one can help me wink

Best regards

If you can find at least 5 free GPIOs, that should be possible. For the receiver, you would need SPI (3-4 GPIOs, kmod-spi-gpio-custom) and do the higher-level communication in user-space. For the display, you need I2C (2 GPIOs, kmod-i2c-gpio-custom) and could check if lcd4linux supports this model.

Hi MBS,
thank you very much for your fast replay.
The TL-703N has 30GPIOs but I am not sure if there are 5 ports available without an extension board.

Probably not, unless you can live without certain LEDs or switches.
Basically, there is also a driver in the kernel, which supports a certain I2C-to-SPI-bridge. Although there is no kmod-package in openwrt for it, yet. And I don't know, if the timing for your application works out with such a bridge. But this way, you would just need 2 free GPIOs.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/Kconfig wrote:

SPI driver for NXP SC18IS602/602B/603 I2C to SPI bridge.

And I prefer to keep the communication here in the forum, so other people may benefit, as well.

thank you very much for your answer, slowly but surely I get a overview.

hmm okay if I am going to use SPI, I only need two available GPIOs, that sounds great.

compiling the spi driver into the kernel shouldn´t be a problem, is there anything else to take care about?

I need your expert know-how wink

fyi:
A guy connected a lcd screen to his TL-703N but he didn´t descripe nothing more:

http://www.youtube.com/watch?v=o7nBhI9LsB0
https://bitbucket.org/loblik/lcd/wiki/Home

(Last edited by babylon99_de on 8 Jan 2014, 13:19)

babylon99_de wrote:

fyi:
A guy connected a lcd screen to his TL-703N but he didn´t descripe nothing more:

http://www.youtube.com/watch?v=o7nBhI9LsB0
https://bitbucket.org/loblik/lcd/wiki/Home

This is done by bitbanging a I2C port on two GPIO's (i believe there is a kmod package for) several people
already used I2C on a WRT703, i think if you do a search on the forum you should find something about it.

On the I2C bus is a PCF8574 (there is a PCF kmod package) this is only an I/O extender which will give you
8 I/O bits that can be controlled via I2C.
The LCD is used in 4 bits mode it also needs a R/S en ENABLE so with 6 I/O's from the PCF8574 you can
controle the LCD.
On how to controle a HD44780 compatible lcd in 4 bits mode you can find tons of information on the net.

For what i understand is that you can use output only on the GPIO's, the function of the GPIO (input or output)
is set during boot in a register from the AR9331 (please correct me if i'm wrong)
In real I2C life for input you first have to send (output) the device adress and then read from I2C (input) the
device answer, in bitbanging I2C this means that you must be able to make SDA output and input during normal
operation, is this even possible on the AR9331 with a GPIO pin?

This mean that you can use the PCF8574 for output only. (again please correct me if i'm wrong)

Grtzz  Mark

Well, have a look at the datasheets of the I2C-SPI bridge to see, if you need to take care of anything else.
For the LCD: from what I could see, it is a PCF8574 connected to a HD44780, and a quick search revealed, that LCD4Linux already has a sample config for that:

Display HD44780-I2C {
    Driver 'HD44780'
    Model 'WRAP1C-PCF8574'
    Bus 'i2c'
    Port '/dev/i2c-0'
    Device '70'
    Bits '4'
    Size '20x4'
    asc255bug 0
    Icons 1
    Wire {
        RW     'DB5'
        RS     'DB4'
        ENABLE 'DB6'
        GPO    'GND'
    }
}

And details of I2C on GPIO is in the wiki: http://wiki.openwrt.org/doc/hardware/port.i2c

would it not be easier to use instead a I2C display, a display with SPI ?

like that one ?  -->   SainSmart 1.8" TFT Farb LCD Schirm Modul mit SPI Interface & MicroSD für Arduino UNO MEGA R3

http://www.amazon.de/SainSmart-Schirm-I … rt+display


what do the experts think ?

Well, i found simple(but pricey ~7-12$) solution. Serial(uart) displays! I afraid this can be considered as advertising, so i will not post manufacturer name here. Well, i'll hide some symbols of manufacturer's name so you can be sure that you found right one - D*g**e.
So, display connection is straightforward and simple. Just connect TP_OUT, GND and +3.3V OR +5V from your tp-link router to display. Display will be at /dev/ttyS0. Protocol is ascii text. So you won't need kmod-* packages. For example, output text to display:

# echo "TTHello World" > /dev/ttyS0

Sadly right now i can't photograph mine 703 with display. Because i broken display, it's very fragile. But i have another pics of these displays from my routers. Replacement display should arrive by post in nearest days.

My tp-link 740 with 20x2 display.
http://i58.tinypic.com/2pseyk9.jpg
This small oled display was installed in 703 before i broke it smile
http://i57.tinypic.com/x28coj.jpg
40x4 display, connected to PC via usb2uart.
http://i59.tinypic.com/d8nqr.jpg

I wrote small library(bash-based) for text output on openwrt.

(Last edited by hackru on 11 Feb 2014, 12:08)

The discussion might have continued from here.