The goal
Enable your MR3020 OpenWrt router to communicate with microcontrolers via RS232 port in both ways.Usability
High.Parts
- TP-LINK MR3020 router flashed with OpenWrt
- pin connectors
- signal cable
Description
Recently I needed another router for Openwrt, my previous MR3420 went down, I accidentally burn him :)This one is a beauty, it's small and has capabilities that fit my needs: CPU:Atheros AR7240@400MHz, Ram:32M, Flash:4M, USB 2.0 and of course most important for me - RS232 port.
TP-LINK MR3020 |
Board with soldered pins for RS232. |
RS232 connector with cable. TX, RX, GND, VCC |
As a default, RS232 port is used for debug kernel messages (you need to recompile the kernel to disable that behaviour), furthermore there is a console running on this port, so it need to be turned off.
I'm to lazy to recompile kernel, so I just disabled serial console. Debug kernel messages was still on serial port, so on the other side of the wire (microcontroler) I wrote a program which uses my custom protocol with pseudo data validation. It's working for now, so I don't bother anymore, of course MCU has more work to do, but who cares.
Default port path from device is /dev/ttyATH0, you can use it the same way, as standard linux port e.g. screen /dev/ttyATH0 9600.
My ugly custom connector |
Hi, great job!
ReplyDeleteHow did you disable serial console?
Hi, thanks :)
DeleteChange file /etc/inittab, comment out serial console initialization (example below), save and reboot your router.
# ttyATH0::askfirst:/bin/ash --login
Remember, debug messages from kernel will be still printed on serial port.
Regards,
Igor.
Hello, what do you use for this?
ReplyDeleteI´m electronic and informatic. I want control relays with a PIC16F84A and Router HG556a with OpenWRT.
Thanks, and I see you.
Hi,
DeleteIf your PIC16F84A can do serial, attach it to serial port of your router http://wiki.openwrt.org/toh/huawei/hg556a#serial and then checkout my post "OpenWrt antenna rotator". I communicate with Atmega8 by rs232 from OpenWrt on MR3020. I never wrote anything on PIC* but I think it should be quite similar. On my post you will find a link to source code on Atmega8, maybe you could use it as a help to your project.
Regards,
Igor.
Ok, very thanks for your response. I see the form to do this and I comment you in a time. Thanks
ReplyDelete