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.
- 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