OpenWrt Mount USB drive and install Python

Source: Internet
Author: User

When you recently installed Python on OpenWrt, there was an old/overlay error with insufficient space, as shown in:



However, when viewed with commands, the space is quite small:


After reading this article, I thought of using flash memory card to enlarge. Since I have a USB driver module inside my system, I can recognize it by plugging in a flash card.


The basic idea is simple, first format, then mount, and then configure opkg.conf to install the software on it.

    • Formatting

    • Mount to/mnt/usb Directory

    • Modify/etc/profile and/etc/opkg.conf files




Next install the software to say, first opkg update, then opkg-d USB install Python, that is, the Python installed in the card,/etc/profile modify environment variables to ensure that the library and programs can be found.
Small program practiced handfunction: Post random data to Web platform (post interface provided)
Import Httplibimport urllibimport timeimport randomurl_platform = ' 11.4.31.195:9071 ' path = '/wifpa/resourcedata.xml/ 000100003f0cfd4a? Resourceid=1 ' path_uploadservicedata = '/wifpd/uploadservicedata/000100003f0cfd4a ' FORMAT = '%Y-%m-%dT%X ' PARAMS_XML1 = ' <ServiceData><mwid>000100003f0cfd4a</mwid><datatime> ' +time.strftime (FORMAT, Time.localtime ()) + ' </datatime><Datapoints><value> ' params_xml2 = ' </value><num>1 </num></Datapoints></ServiceData> ' header = {' Content-type ': ' Text/xml '}# conn.request (method= ' GET ', Url=path) # while true:conn = Httplib. Httpconnection (url_platform) val = str (random.randint (1,100)) print ' value ', Valparams_xml = params_xml1 + val + params_ Xml2conn.request (' POST ', path_uploadservicedata,params_xml,header) resp = Conn.getresponse () print Resp.status, Resp.reason#htmldata = Resp.read () #print htmldata#time.sleep (5)

Executed:


Reference links

Http://wiki.openwrt.org/doc/techref/filesystems?s[]=filesystem

http://blog.csdn.net/jk110333/article/details/11920163

Http://wiki.openwrt.org/doc/techref/flash.layout

OpenWrt Mount USB drive and install Python

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.