B3log Solo 登录

shellcode

的网上自留地

用OPENWRT控制伺服电机第二部分

2012-02-22 20:25:42 shellcode
0  评论    28  浏览

In the second part I propose to consider one more interesting thing called - Luci.
The control of servo-drives from the command line is cool, but probably one would like something more graphic. Therefore I propose to control our servo-drives network through the Web interface.
As you know the Luci is responsible for the Web interface in the OpenWrt. Generally luci is a very good example how we can use the whole combination of languages - JavaScript, Ajax, Lua, Html, Css, and Cu - in one project beautifully, intelligently and rationally. The person who wrote the Luci is probably very cool)))

What we need to do? We have not to write the Luci from scratch). We just need to write our smaaaaal module for Luci. How to do it is well written on the official website of Luci. Let's try to do the same.
Let’s create a directory luci-servo-manager in / trunk/build_dir/target-mipsel_uClibc-0. 9. 32/luci-0. 10/applications.
Let’s create a directory named luasrc in it. In luasrc we create the directories view and controller.
Some comments. If you go to “make menuconfig” you can see that Luci has a modular structure. Each module is added to Luci as soon as we select it with <*>. If you remember we've already built Lucy with the module “samba” in one of the earlier sections. So, we have to create this structure to add our module that we are doing now.

伺服电机

用OPENWRT控制伺服电机第一部分

2012-02-22 20:24:33 shellcode
0  评论    0  浏览

To operate with one servo drive is good, but it is not so interesting to us. Much more important is learn how to build a network of servo-drives. In our case, as a master of servo-drives network will be a router. All servo drives will be connected to the master of Uart. I understand that the I2C is the standard de facto, but Uart seems to be easier, more flexible and more familiar for me)))

For building of a servo-drives network we need the following adapter from Usb into Uart (we've already used it in the section Debug Port):

伺服电机

各种传感器在OPENWRT下如何驱动和读取电压

2012-02-22 19:58:46 shellcode
0  评论    26  浏览
root@OpenWrt:/# opkg install kmod-usb-serial-cp210x
Installing kmod-usb-serial-cp210x (2.6.36.2-1) to root...
Downloading ftp://ftp:ftp@192.168.0.9/kmod-usb-serial-cp210x_2.6.36.2-1_brcm47xx.ipk.
Installing kmod-usb-serial (2.6.36.2-1) to root...
OPENWRT

Usb-hub in OpenWrt

2012-02-22 19:53:24 shellcode
0  评论    0  浏览

For this the following modules are to be added during the OpenWrt configuration:
Kernel modules:
USB Support:
<*> Kmod-usb2 
<*> Kmod-usb-core 
<*> Kmod-usb-ohci 
Network: 

OPENWRT

Installing FusionPBX on OpenWRT

2012-02-22 00:53:29 shellcode
0  评论    81  浏览

This posting details how to install FusionPBX on an OpenWRT system. In particular it is a Seagate Dockstar but there is nothing needed that is specific to the device. The goal is to implement a full function Home PBX with a minimal footprint on your OpenWRT device.

We assume that you have set up your OpenWRT system with a USB drive of some sort, else you likely will not have space for all the files that we need to install. See my previous post on that topic.

fusionpbx

Mpd mpc电台

2012-02-21 01:15:10 shellcode
0  评论    64  浏览

首先,必须更新openWRT的源代码文件夹:

$ cd openwrt-xburst
$ scripts/feeds update

之后,安装mpd/mpc和alsa utils:

$ scripts/feeds install alsa-lib
$ scripts/feeds install alsa-utils
$ scripts/feeds install alsa-utils-tests
$ scripts/feeds install mpd
$ scripts/feeds install mpc

[edit]配置

电台

玩转Openwrt(二) — 配合Android手机打造无线音乐播放器

2012-02-21 00:52:18 shellcode
0  评论    22  浏览

首先要保证路由器已经刷入了openwrt,并且已经能正常上网

安装USB、文件系统的内核模块

opkg update
opkg install kmod-usb-core
opkg install kmod-usb-storage
opkg install kmod-usb-ohci
opkg install kmod-usb-ohci

音乐

openwrt 下配置OPENVPN客户端 有更新!

2012-02-20 21:01:42 shellcode
0  评论    8  浏览

PPPoE重连

发现ADSL拨号的话,每隔两三天PPPoE连接会被断开,然后重新分配到一个新IP。为了避免这种情况下openvpn连接被断开,可以加脚本到 /etc/ppp/ip-up.d 目录:

#!/bin/sh

/etc/init.d/openvpn restart
/etc/init.d/dnsmasq restart

或者在crontab里定期检查openvpn是否还存活着(注意busybox默认使用ash):

#!/bin/sh

if ! test $(pidof openvpn);
then
    sh /etc/init.d/openvpn restart
    sleep 3
    sh /etc/init.d/dnsmasq restart
OPENWRT openvpn

openWRT開啟sftp

2012-02-20 01:43:32 shellcode
0  评论    20  浏览

刷好openWRT後,可以在web管理頁面開啟SSH,但卻不支持SFTP協議,不方便傳文件,需自己安裝sftp:

root@OpenWrt:~# opkg update

root@OpenWrt:~# opkg install vsftpd openssh-sftp-server

root@OpenWrt:~# /etc/init.d/vsftpd enable

root@OpenWrt:~# /etc/init.d/vsftpd start

之後就可以用任意一個ftp客戶端(也許有小部分客戶端不支持sftp)登錄了,協議選sftp,端口可以不填,默認22.

sftp

OpenWRT安裝PPTP Client端 有更新!

2012-02-19 21:39:41 shellcode
0  评论    4  浏览
 on  at 01:38:34
Posted In: 【 OpenWrt 】
 

本教學以【TP-Link TL-WR1043ND V2/3】OpenWRT 10.03.1-RC6為教學基礎
教學來源來自wiki.openwrt.org
在本教學中會使用Putty

===============================================================
第一步:
先使用Putty登入到Router
如果閣下沒修改Router的預設應該是http://192.168.1.1

PPTP

USB线 RS232COM线 并口线 TTL线

2012-02-19 17:45:27 shellcode
0  评论    14  浏览

什么是串口?
------------------------------------------
    串口是计算机上一种非常通用设备通信的协议(不要与通用串行总线Universal Serial Bus或者USB混淆)。大多数计算机包含两个基于RS232的串口。串口同时也是仪器仪表设备通用的通信协议;很多GPIB兼容的设备也带有RS232口。同时,串口通信协议也可以用于获取远程采集设备的数据。
    串口通信的概念非常简单,串口按位(bit)发送和接收字节。尽管比按字节(byte)的并行通信慢,但是串口可以在使用一根线发送数据的同时用另一根线接收数据。它很简单并且能够实现远距离通信。比如IEEE488定义并行通行状态时,规定设备线总常不得超过20米,并且任意两个设备间的长度不得超过2米;而对于串口而言,长度可达1200米。

    典型地,串口用于ASCII码字符的传输。通信使用3根线完成: (1)地线,(2)发送,(3)接收。由于串口通信是异步的,端口能够在一根线上发送数据同时在另一根线上接收数据。其他线用于握手,但是不是必须的。串口通信最重要的参数是波特率、数据位、停止位和奇偶校验。对于两个进行通行的端口,这些参数必须匹配: 

DIY

TTL线刷机

2012-02-19 17:38:34 shellcode
0  评论    0  浏览

TTL线刷机前的准备

1. 购买USB转TTL线,价格一般在12到20之间。

2. 在PC上装好TTL线驱动(一定要先装驱动在将TTL线插到电脑上)。

3. 认识TTL线。TTL线一头是USB接口,另外一头一般有4个带杜邦头的插管,分别是GND、RX、TX、VCC,一般GND是黑色,VCC是红色,其他是RX和TX,不清楚的一定要咨询卖家。见下图,

TTL线

OPENWRT安装软件到U盘

2012-02-19 17:33:50 shellcode
0  评论    0  浏览

OpenWRT用opkg管理软件,如果要脱机BT,先修改opkg.conf,把软件安装路径定义到U盘
建立opt目录安装软件
ln -sf /mnt/sda1/opt /opt
/mnt/sda1/opt是U盘上的目录,根据实际情况修改

vi /etc/opkg.conf

src/gz snapshots http://downloads.openwrt.org/snapshots/ … x/packages
dest root /opt
dest ram /tmp
lists_dir ext /opt/var/opkg-lists
option overlay_root /opt

OPENWRT

motion做监控

2012-02-19 16:28:27 shellcode
0  评论    2  浏览

openwrt 挂载 UVC摄像头
opkg update

opkg install kmod-usb-ohci           #一般BCM用的是ohci USB控制器
#opkg install kmod-usb-uhci      #UHCI USB控制器
opkg install kmod-usb-video
opkg install kmod-video-gspca-core
opkg install kmod-video-core
opkg install kmod-video-uvc            #免驱摄像头
opkg install kmod-video-gspca-zc3xx    #中微星摄像头 如zc301 zc303 zc305
opkg install kmod-i2c-core
opkg install kmod-input-core 
opkg install motion

OPENWRT

openwrt下完整备份/还原的方法

2012-02-19 16:07:48 shellcode
0  评论    0  浏览

使用openwrt.cn以来,对我这种喜欢折腾的人来说,一般都安装了很多的IPK,一直不停的升级、安装、调试,确实是个很头痛和很费时间的问题!!
openwrt的系统备份只能备份有关配置文件,其他驱动、软件还得去重新安装;尤其是openwrt中文版的内核跟官网的kmod还存一定的兼容问题,有时不得不停的找不同的kmod源,确实很麻烦!
所以一直想找一种比较完整的备份方法,要求就是能将原来系统所安装的所有驱动、软件、配置都备份下来,系统升级后,直接恢复就行了!!经过摸索,现在基本找到了实现了完整备份/还原的方法,在此感谢国外网友的指点!!

openwrt  backfire 10.03 完整备份的方法: 

1、修改系统备份的一键备份/恢复方法(安全、推荐!)

OPENWRT

可参考的例子

2012-02-19 15:24:02 shellcode
0  评论    4  浏览
不是用autoddvpn提供的wget脚本,而是下载jffs openvpn grace mode的vpnup.sh和vpndown.sh,然后在其他地方找了个可以wget使用的openvpn,最后把这两部分结合起来,实现无jffs和openvpn功能的路由器(比如TP-LINK WR841N)以openvpn玩autoddvpn gracemode
OPENWRT openvpn

备份一下可参考的配置

2012-02-19 15:14:40 shellcode
0  评论    0  浏览

如果之前就是openwrt就直接用固件更新

不是的话就用免TTL的更新方式:

关掉电源,按住RESET键开机,电脑上一直ping 192.168.1.1,直到出现TTL=100的ping值出现即可松开RESET,用浏览器打开192.168.1.1,输入用户 名:telecomadmin,密码:nE7jA%5m,然后进行升级。由于某些CFE版本不一样,还有以下用户和密码可能。

用户:telecomadmin 密码:nE7jA%5m
用户:admin 密码:8mCnC@bj
用户:bjcnchgw 密码:8mCnC@bj
或者密码和用户名一样。
OPENWRT

OPENWRT上配置OPENVPN servers 自动穿越长城

2012-02-19 13:44:36 shellcode
0  评论    42  浏览
1. 在 openwrt 上安装 openvpn。方法请自行 google,或参考 openwrt wiki。
2. 把所有的 cert, key, conf 等文件传到 /etc/openvpn。conf 文件参考 ddwrt 的做法(http://code.google.com/p/autoddvpn/wiki/OpenVPNManualStartUP)。
3. 下载 http://autoddvpn.googlecode.com/svn/trunk/grace.d/vpnup.sh 和 vpndown.sh,修改 vpsup.sh 里面的 /jffs/ 为 /etc/,然后都放到 /etc/openvpn,并且赋予执行权限。
4. 在 /etc/config/openvpn 中增加下面内容:

config 'openvpn' 'vpn'
	option 'config' '/etc/openvpn/openvpn.conf' # conf 的文件名别错了
	option 'enable' '1'
穿越

这个世界都疯了,正如我 有更新!

2012-02-13 03:45:06 shellcode
0  评论    124  浏览

我对生活极度的看不起

生活

以后我就在自己的网站扎根吧 有更新!

2012-02-12 23:00:11 shellcode
2  评论    1,735  浏览

虽然这个www.inyes.com域名是我在2005年深圳求学时向北京的一位朋友手中购买,之后2006年在顺德容桂做了个网站论坛.

 

后来因为管理原因,再没有用到....现在正好可以用google.inc AppEngine来做...实现我一直以来都有自己的私人网站的想法...

理想
TOP