Jump to content






Photo

TP-link WR703n as telemetry link and camera broadcasting Part2 (software)

Posted by fertito , 13 June 2012 · 5918 views

wr703n ip telemetry openwrt
Hello,

now that you have a wr703n runing on openwrt, it is time to put some software on it and eventually make some addon.

the fact is : there is not much place on the router to make everything fit...
the solution I recommand : Add a USB Hub, to be able to plug not only the openpilot board, but also the webcam, and an usb flashdrive to make a system overlay so that it will be at ease.

Warning : Connectic is heavy, it may be necessery to solder the whole things instead of plugin it.

So, connect the wr703n with an ethernet cable on your home router, plug the usb power, wait until the blue led is rock solid, open a terminal and type :
telnet 192.168.1.51

It should grant you and wait for your input...

first of all we need to update the package :

opkg update
the we need to install some stuff to prepare the overlay :
opkg install kmod-usb-storage
Do the same with :
kmod-usb-storage-extras
kmod-fs-ext4
block-mount
note : your flashdrive should be ext4 formated (I did this directly on the router, but don't remember the command)

once this is done :
mkdir -p /mnt/usb
mount -t ext4 /dev/sda1 /mnt/usb -o rw,sync
then open with vim /etc/config/fstab and add :
config 'mount'
	   option target   /overlay
	   option device   /dev/sda1
	   option fstype   ext4
	   option options  rw,sync
	   option enabled  1
	   option enabled_fsck 0

reboot...
and reconnect
telnet 192.168.1.51

because it is nice to have a web interface for administration install luci
opkg update
opkg install luci

this will give you access, with a nice GUI, to all the administration forms when you connect a browser to http://192.168.1.51 :
Posted Image

Now it is time to add some software relative to the Openpilot Board with the mainport as telemetry serial (57600bds):
opkg install ser2net

note : I'm am note sure anymore, but I think I added also a tty program utility, but not sure it was usefull

I'll repeat myself, at start openwrt stream the console in the serial line, it is usefull to be able to unbrick a wr703n (maybe next tutorial), but if you enter a CR or LF on the serial line (/dev/ttyS0 or /dev/console) it will enter in console mode and then won't let you stream the telemetry.
So first of all, we have to edit /etc/inittab and remove all the line that look like one of the 3 last :
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
tts/0::askfirst:/bin/ash --login
ttyS0::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
To avoid any problem at boot, do plug the openpilot board only when the wr703n has finished his booting sequence (blue led solid). It will come specially if you have your telemetry setup with 115200bds.

Now it is time to setup ser2net, edit /etc/ser2net.conf on mine I removed everything and putted only this line :
8081:raw:600:/dev/ttyS0:57600

edit the /etc/rc.common and add :
START=10
STOP=15
start(){
ser2net
}
stop(){
killall ser2net
}

And then enable the service :
/etc/init.d/ser2net enable

and run it :
ser2net

that's All! now everything that'll go througt the serial line will be directed (full duplex) to 192.168.1.51:8081. ;)

plug the openpilot to the wr703n (gnd, tx, rx are minimum) and power it, configure it with telemetry on the port it is connected @57600bds, reboot and configure your gcs with ip telemtry TCP 192.168.1.51 port 8081.

Now use the luci interface to add a new network interface (wifi) to be able to access to the router on wireless (I think this is the usefull things ;) ) and make your wifi ip adress this one : 192.168.1.52
Reboot, ..., connect your pc with wifi to the new openwrt network that should appear, configure the gcs with this new adress (192.168.1.52) and Voila... ;)




For the 'next' branche with your openpilot setup with vcp telemetry you'll have to add few more things :
opkg update
opkg install kmod-usb-serial kmod-usb-acm

And edit /etc/ser2net.conf :
8081:raw:600:/dev/ttyACM0:57600




Does that "option target /overlay" really work?

I tried to use your blog notes when i set mine up. Thought it will be a fast setup. I toook me a while to get it to work.

I got mine working with USB stick and extroot, but not configured as you show above, I never had any success with that config. Does it really work?

I have seen the same config examples at wiki as well, thats why I'm wondering. I guess there is some scenario where it work..

I mounted my usb stick, copied the data for the overlay to the USB stick root, then i mounted without option target but option is_rootfs 1. fs_root, without "option target" stated. It then mounted as /overlay by itself. never got it working with the config you wrote in blog.

Seems like a lot have been changed regarding this in Open WRT, and what is working and not isn't really obvious.
Any luck with 3G modem? I got a bunch of huawei modems I will try to get working. Seems like it might be a challenge, when reading up on the topic.
yes it worked fine for me, it is a setup I stricktly followed on another website.
be sure that your usb external drive is ext4 formatted...

I didn't retry yet the 3G modem, it connected but I couldn't get a global ip adress, just a local one, will try it again someday ;)

July 2014

M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28 293031   

Recent Comments