Toshiba L650 laptop disassembling

QQ图片20160529094125
I got a 5 year old laptop, it does not boot, no screen show, no beeping. So I need to disassemble and check.
Generally, this laptop is easy to repalce harddisk or memory on the back.  And the dissabling is straight forwards.

Continue reading

Posted in Uncategorized | Leave a comment

Introduction to Industrial IO (sensor framework for Linux)

introduciton to Industrial IO


  • overview of industrial IO. In short, SPI and I2C sensor framework for Linux
  • sensor categories: “ADC, DAC, light, accel(erometer), gyro, magnetometer, humidity, temperature, amplifier, frequency, orientation, health”, etc
  • merged to mainline kernel 3.14, used by beagleBone, sysfs and char device based, see the IIO architecture

related projects/libs


  • DAQmx base for linux: commercial lib from national instrument
  • comedi: PCI/PCIe, USB devices for data acquisition
  • hwmon: very low speed,traditionally for CPU temperature monitoring
  • HID: like mouse, keyboard, generally low speed input device
  • bluetooth smart:

user space IIO API


user space library libiio (https://wiki.analog.com/resources/tools-software/linux-software/libiio)

  • #include <iio.h> four basic classes: iio_contex, iio_device, iio_channel and iio_buffer
  • iio_trigger is kind of iio_device without channel but with name inc “trigger”
  • iio_context has internal operation functions structure, kernel driver
  • windows user can use libiio to access network iiod
  • python and cshaprt wrapping for user space API: python-iio libiio-cil-dev
  • XML context: attributes calibration data, scale, etc.

detailed

(http://events.linuxfoundation.org/sites/events/files/slides/lceu15_baluta.pdf) + scan_element(), iio_channel_is_scan_element(): elements in buffer is called scan /sys/bus/iio/devices/iio:devices/scan elements

  • read_raw() from register (possible 12bit) to integer in memory. NO integer to physical quantity (with unit) like comedilib?

trigger readings based on an external interrupt source hardware interrupt (IRQ pins) software interrupts (periodic timers, sysfs triggers)

design of IIO


  • modes: DIRECT,BUFFER SOFTWARE,BUFFER HARDWARE,BUFFER TRIGGERED
  • iio_triggered_buffer iio_events only found in kernel mode iio_core, see(linux/iio/triggered_buffer.h);trigger are software trigger, not hardware TTL signal in DAQ terminology?

documentation for IIO


source code


supported hardware list


About 200 device drivers by the time of kernel 4.4; many drivers supports a varierty of models.

see/search kernel source tree linux/iio, there are a few subfolders corresponds to sensor categories: “ADC, DAC, light, accel(erometer), gyro, magnetometer, humidity, temperature, amplifier, frequency, orientation, health”, etc

test of IIO dummy device on ubuntu 16.04


“dummy” a virtual sensor for testing

python-iio example

desired feature of IIO


  1. user space tool to expose sensors to webUI?
  2. devicetree: platform device support is supported such as beaglebone.
  3. standardisation calibration data in XML attribute file to simulate: IEEE 1451.4 Plug and Play Sensors (TEDS)
  4. possiblity of user space driver development based on user space SPI, i2c and libusb?
  5. physical value conversion “The functions comedi_to_physical, comedi_to_phys, comedi_from_physical and comedi_from_phys are used to convert between Comedi’s integer data and floating point numbers corresponding to physical values (voltages, etc.). ”
Posted in Linux, Sensor | Leave a comment

A recommendation for free of charge 2D CAD and office system, also cross-platform

for office system, I recommend kingsoft  WPS office, which is based on Qt, much faster than java based solution. It has Android, Linux version in alpha, in addition to mature windows ‘s version

http://wps-community.org/download.html

For 2D CAD drawing, I recommend   Dassault system’ Draftsight,  it is  a professional level product. just need a email activation.  Linux version is still in beta.

http://www.3ds.com/products-services/draftsight-cad-software/free-download/

Both are not open source, but free of charge for production usage.

Posted in Linux | Leave a comment

Solve CFD via OpenFOAM in free CAx platform FreeCAD

Updated 2016-04-17

Boundary condition setup GUI has been done for preview

This is an early preview, only for people with experience of OpenFoam.
Test instruction could be found at
https://github.com/qingfengxia/FreeCAD/ … /Readme.md

I would love to see some feedback for stage III development, see roadmap:
https://github.com/qingfengxia/FreeCAD/ … roadmap.md

A video preview of OpenFoam plugin for FreeCAD Fem workbench
http://www.iesensor.com/FreeCADDoc/oepn … engXIA.mp4

The discussion of this module on FreeCAD community can be found here:

http://forum.freecadweb.org/viewtopic.php?f=18&t=13699

Continue reading

Posted in Linux, Programming, Research | Comments Off on Solve CFD via OpenFOAM in free CAx platform FreeCAD

Why power adapters for laptop are NOT compatible

see the word document contains figure to demonstrate various power adapters from diff manufacturers and how the claimed incompatible adapter could be reused.

why laptop power adapter are not compatible and howto

Posted in Uncategorized | Comments Off on Why power adapters for laptop are NOT compatible

Using paraview to visualise vorticity (Lambda2, vorticity, Q-Criterion)

Please download the word document, which contains the details on setting up the Python Calculator filter to calc lambda2, and use the advanced option of ‘Gradient’ filter to calculate vorticity, Q-Criterion.

Using Paraview to visualise vortex by lambda2

Posted in Programming, Research | Comments Off on Using paraview to visualise vorticity (Lambda2, vorticity, Q-Criterion)

What is the max array size you can declare (big data challenge)

by Qingfeng Xia @ iesensor.com 2015

With the popularity of BIG DATA concept, have you think about what is the max data structure you can run?http://stackoverflow.com/questions/216259/is-there-a-max-array-length-limit-in-c

Continue reading

Posted in Programming | Comments Off on What is the max array size you can declare (big data challenge)

Ten things you must do after install Openwrt 15.05 on raspberry pi B

This is not a tutorial, but list some interesting things for Openwrt

2015-09-14 by Qingfeng Xia
Continue reading

Posted in Ineternet of Things, Linux | Comments Off on Ten things you must do after install Openwrt 15.05 on raspberry pi B

Gmail backup to your google drive using app script (isenensor.com)

 

Link to my google spread sheet with script: Gmail backup isenensor.com

https://docs.google.com/spreadsheets/d/1vcQ-dJ_9iEmISLDnDjAFWrb4zcGOhEJzIJmMoq_MLYQ/pubhtml

Continue reading

Posted in Uncategorized | Comments Off on Gmail backup to your google drive using app script (isenensor.com)

Electronics under extreme environment (high temperature, low temperature)

Electronics under extreme environment

dirlist

 

 

 

 

Collection of public resource, product catalog, NASA presentation, etc

Posted in Uncategorized | Comments Off on Electronics under extreme environment (high temperature, low temperature)

smoother python 2.7 to 3.x transition (scite as IDE)

I aim to write code in python script, most of time, single file script, to run on both 2.x and 3.x with my favorite light-weighted IDE scite. So here is my setup
Continue reading

Posted in Programming | Comments Off on smoother python 2.7 to 3.x transition (scite as IDE)

readonly root file system for raspbian

crash of SD card file system make me crasy, so I need to to sth!
Continue reading

Posted in Linux | Comments Off on readonly root file system for raspbian

raspberry pi 2 is tested in compressed air vessel working at 5bar

Recently, as a byproduct of exp work in Ox Uni,  I tested raspberry pi 2 works at 5 bar, it could work at higher pressure but not tested.

All the rpi 2 use no electrolytic capacitor (all components are supposed to be pressure tolerant), so it is potentially working at higher pressure than atm.  Now it is confirmed.

Also, UART (RT and TX) pins are used to communicate between two pi. It works with 1 meter cable at 115200. amplifier_HP_testing

Posted in Sensor | Comments Off on raspberry pi 2 is tested in compressed air vessel working at 5bar

Allyoyn 14.12 compiled on raspberry pi and ubuntu

based on ref in Chinese:  [blog.csdn.net/huangjuegeek/article/details/38515445]

Continue reading

Posted in Ineternet of Things | Comments Off on Allyoyn 14.12 compiled on raspberry pi and ubuntu

using raspberry pi and beaglebone launchpad as USB-uart

This is a note collected from internet source

Continue reading

Posted in Uncategorized | 1 Comment

《思学篇》

序: 今吾留学已逾二载,尚且彷徨。观乎同辈,或有身兼中西之学,文理书乐皆通,踌躇满志者,窃以为不如。 吾温顺静思,非浪荡轻浮之人,奈何拘于家学见闻。究其根本,盖教育环境之异。

吾祖世代或农或商,非书香门第,几无藏书,唯《本草》《毛选》,皇历账本数册而已,想儿时亦无此趣。闲暇务农而少游冶,亦无良师益友导引。既入大学,尚忧衣食。而后随波逐流,年华暗换,而立之年近,尚且浑噩。

余常叹:幼不得读书以茂才,少不能观史以宏志,壮不及交游以广识。幸入大学门径,博览群书,略晓古今之智士,初窥大道;偶得游历机缘,登堂入室,声闻中外之贤达,眼界始开。

“穷则思,思则变”,听闻“苏老泉,二十七,始发愤”,吾以为桑隅非晚,故思学。身已后人,当奋发图前,奈何心力见衰,难以专志。唯恐心有余而力不足,观荀子之《劝学篇》,做《思学篇》以自勉。

—-

方今之世,风云变幻。万马奔腾,先者领之;鱼跃龙门,能者居上。

人皆有天赋,需发而养之。欲增其才,识不可以不广;欲显其能,学不可以不精。雄韬武略,非生而有之;高瞻远瞩,需广学精思。古今中外不乏先例。魏吴起身先士卒,吸疮负粮,众人争死。拿破仑博闻强识,因势利导,举国拥戴。丘吉尔文武双修,弘毅独行,力挽狂澜。

或曰纵子勤勉,无家学家世可承,抑将有成乎?吾以为不尽然也!

谋 国之举,一代难成;佐国之臣,出于当世;鸿儒巨硕,自励自成。王莽篡国,三代之力;三国鼎立,各有家承。然煮酒论英雄之时,袁绍承四世三公之势,虎踞冀州 之地,曹操不以英雄论之,何也?善始不必善成,非有能者不能成其大。乱世出英豪,时势造英雄。刘邦布衣起家,而夺项王之天下。朱元璋由卑至尊,今谓之草根 皇帝。北宋一代,治世能臣多出寒门。自古大儒多出寒门。穷则益坚,安贫知命,不为逢迎攀比而劳身,虚名福利损命。

家世显赫,乃生之幸,非众人之福;良师益友,世人皆可寻而得之。 盖今世之教育,童蒙重在家教,小学贵在师严,中学益在志高,大学旨在求索。 所闻所见所识所能,皆可后天补养,所需者,时也!

而立之年吾志方立,其晚乎?尽人事而听天命。 诚能守一毅行,去躁守静,当有所成。


西元二零零九年年末
英国曼彻斯特

Posted in 时评随笔 | Comments Off on 《思学篇》

从阿里上市反观金融改革【转载】

最近中国公司阿里巴巴成功登陆了纽交所,不少人觉得这是一 件很光荣的事,毕竟阿里创造了美国历史上最大一笔IPO纪录,对一个中国企业实属不易。同时,我也认为这对中国金融体系以及中国广大投资者,这是一个悲 哀。中国是世界上储蓄率最高的国家之一,老百姓现在也急需很好的投资产品,遗憾的是大多数中国投资者都没有办法买到阿里巴巴的股票,阿里巴巴还要不远万里 到美国跨过制度、法律、语言的各种障碍寻求上市。

从中国金融体系角度来看,这种情况为什么会发生?你可以说是美国金融体系或者美国金融市场 具有很大的吸引力,他们拥有非常有效的制度和规则,而中国在这一点上望尘莫及。美国金融市场有两个特点,其一是其筛选功能,将一些非常优秀的创业型企业从 众多的企业里挑选出来交给投资者,筛选的能力很强;其二是市场监督的机制,不仅可以把企业甄选出来,而且还可以让企业选择适合它们需求的治理和管理体系, 这既能够满足企业治理模式和融资需求,同时又能够保护好投资者。

众所周知,阿里巴巴起先想在香港上市,但香港联交所并没有同意,因为阿里有 一套治理结构,比如说合伙人要主导董事会成员的提名权,这个其实在美国市场也存在一定风险,但是美国市场接受了阿里巴巴,因为美国相信在公司治理上它还是 有其他的方法来保护投资者,例如它的法律制度的一些安排是能够更好地保护到它的投资者。相较于中国大陆甚至香港的金融市场,美国金融体系具备很大优势。这 一问题就牵涉到中国金融体系改革的战略抉择问题,中国不光是阿里巴巴一家在境外上市,类似优质的企业现在已经有几家了,比如腾讯、京东等等,中国的老百姓 不能够享有这些优秀企业成长中的投资机会。

在经济“新常态”下,今后五到十年中国整个经济转型的过程中,会涌现出一批有中国特色的、引领世 界潮流的创新型的企业,而这些企业今后到哪里融资,对这些企业中国的老百姓能不能投资,是中国金融体系改革亟需要关注的一点。如果在今后五到十年这些企业 还是跑到美国去上市,这就不是一个悲哀的问题了,我觉得那会是一个耻辱,我相信这种压力肯定会要倒逼中国金融体系有更大更快的变革。目前关键的问题就是中 国下一步金融体系要怎么改?在我看来未来可能会有三种情景,而且这三种情景取决于国内的金融制度改革的战略选择。

第 一种情景,大多数优秀的中国企业继续在美国上市,在中国投资者的压力下,中国的资本账户会有更大的开放,允许中国的投资者有更多的钱可以兑换成美元,到美 国市场上进行投资。中国实体经济对外投融资巨大的需求正在倒逼资本账户的开放,最近几年中国央行也在推动资本账户下可兑换,我相信今后几年会有很快的进 展。但如果在这个情景下,中国没有开发出能吸引自己企业的融资平台,中国的融资投资就只能通过美国市场(或其他国际市场)来运作,于是美国金融市场成为了 中国这些新型创新型企业的投资银行,这个结果肯定不是大家想要看到的。更进一步,这存在两个问题,一是中国有很多投资者,资金在中国,同时还是中国企业需 要融资,但是要到美国去才能做这件事情,交易成本就会非常高,这个肯定不是最优的解决方案。还有一些企业甚至国际化程度没有像阿里巴巴这么高,可能还走不 到美国去,融资就很困难,这就是我们讲的中小企业融资难的问题。二是汇率风险和国家风险,中国企业都在美国融资,而中国企业需要的都是人民币,中国投资者 到美国投资,最后也还是需要人民币,这里就存在汇率风险的问题;这些企业的融资都是在与国内各种制度完全不同的国家进行,肯定也有各种各样的国家和政治风 险。

第二种情景,中国企业去香港上市,中国现在有不少企业这么做,比如腾讯。香港市场相对来说离中国比较接近,而它的制度、资本市场的成熟 度、为金融企业服务的程度、公司治理的监管以及对投资者的保护都比大陆发展得要好。当然,香港市场的上市制度也存在某些限制,比如香港市场也有汇率问题, 至少现在港币是紧盯美元的,同时也有制度的风险。最近沪港通、深港通都在筹备当中,可能也是希望在这个方面起到一定的作用。如果香港成为重要的人民币离岸 市场,投融资也用人民币来计价,这种情景相比第一种情景对中国内地的投资者和融资企业风险和成本都要低一点,但是这毕竟不是最优的。更重要的是人民币金融 市场的定价权是不应该由一个离岸市场来主导的。

第三种情景,在中国的某一个地方打造一个具有国际水平的、比较开放的金融市场,按照人民币来 计价,让中国众多的投资者和需要融资的企业的投融资需求可以在境内得到满足。可能大家觉得这个情景还是天方夜谭,但是我觉得不完全是,而且我相信只要有开 放和改革的勇气,这在今后十年是可以实现的。上海自由贸易试验区的设立和实践就是为了在投融资便利、制度创新上发挥更大作用,所以我觉得有很多事情是可以 放到上海自贸区来实现的,中国的投资者缺乏投资品种,大量的融资者也在中国,但是没有好的市场把他们撮合在一起。说到底这是一个制度的问题,所以需要有制 度上的创新。

举一个可以创新的例子,中国现在非常缺的市场是中长期债券市场,中国的中长期发债方只有那些风险较小、信用评级较高的大企业。 如何为中国的中小企业提供一个平台,让他们也有中长期的债券融资的可能,而且还要能规避国内的所谓刚性兑付的潜规则?我认为,在自贸区发展这样的高收益债 券市场是一个很好的选择,为什么这样说?自贸区是对外开放的,债券市场开始可以主要引进境外持人民币的投资者,让境外投资者按照国际规则来进行风险定价, 该破产就破产,这样就可以打破刚性兑付的潜规则。这个债券市场要用人民币定价和结算,并通过自贸区已基本建成的分账户核算体系,逐渐地开放与境内账户的渗 透的程度让境内和境外互通,最后境内的投资者也可以没有限制地买这些债券。这样一个平台的建立是对中国的金融体系制度上的创新,真正能够为中国的投资者和 融资者服务,同时也能够推动人民币的国际化。而要实现这样一个平台关键是相关监管部门要看到中国整个金融体系的改革发展的大趋势,不要再为部门的利益而扯 皮,因为时间已经非常紧迫,今后五到十年中国会有一大批企业需要这样的服务,而如果中国市场不提供这样的服务,这些企业就会投奔美国或香港金融市场了。

这三种情景都比现在中国的情况是一种进步。其中哪一种情景在今后五到十年更可能发生就取决于今后三到五年的决策。我们当然应该争取最好的第三种情景,但这更需要中国改革者高度的勇气和智慧。

 

=============拓展讨论===========

1. 阿里巴巴在美国IPO居然是中国错失网络盛宴的证明?

Posted in 时评随笔 | Comments Off on 从阿里上市反观金融改革【转载】

SCITE as nodejs groovy and qml (qtquick 2.0) c++11 IDE

in cpp.properties global setting file (sudo scite on  Linux)

#at the begining of this config file:

file.patterns.java=*.java;*.jad;*.pde;*.groovy

file.patterns.js=*.js;*.es;*.js6
#file.patterns.qml=*.qml

##############add for C++11 mingw32##########

#add more header and lib file path to support third party lib

cpluspluspts= -pedantic  -Os   -std=c++11  -I D:\Software\mingw64\include -L D:\Software\mingw64\lib

# support only single file compile directly into binary, no makefile is needed
cc=$(GCCPATH)\g++ $(ccopts)  -c $(FileNameExt) -o $(FileName).o

#################modify #####################
command.compile.$(file.patterns.cplusplus)=$(GCCPATH)\g++ $(cpluspluspts) $(FileNameExt) -o $(FileName)
command.build.$(file.patterns.cplusplus)=$(make.command)
command.go.$(file.patterns.cplusplus)=PATH $(GCCPATH);%PATH%  &&  $(FileName)
command.go.needs.$(file.patterns.cplusplus)=$(GCCPATH)\g++ $(cpluspluspts) $(FileNameExt) -o $(FileName)

##################add ######################
command.go.*.js=node.exe $(FileNameExt)
#es6 is not standard file suffix
command.go.*.js6=node.exe  –harmony $(FileNameExt)
###################################
keywords.$(file.patterns.qml)=$(keywordclass.javascript)
QT5PATH=C:\Qt\5.2.0\mingw48_32\bin;C:\Qt\Tools\mingw48_32\bin;%PATH%
command.go.*.qml=PATH $(QT5PATH) && qmlscene  $(FileNameExt)
#if it does not work, ->  start qmlscene from Qt for desktop command prompt!
#######################################
#tab openning needs to be adjusted,  append *.groovy    to java pattern for the timebeing
#file.patterns.groovy=*.groovy
#GROOVYPATH=D:\Software\Groovy2\bin\
#script need not compile and make
#command.compile.*.groovy=groovyc $(FileNameExt)
keywords.$(file.patterns.groovy)=$(keywordclass.java)
command.go.*.groovy=groovy $(FileNameExt)
###################################

Posted in Uncategorized | Comments Off on SCITE as nodejs groovy and qml (qtquick 2.0) c++11 IDE

Using matplotlib to plot NI DAQmx data file (big data)

Due to the recent research requirement, I need to replot and analysis signal of high sampling rate (several mega samples per seconds) with PCIe card.

I planned to use numpy and matplotlib to plot, but I was a bit worried on the capability of using npTDMS and matplotlib to processing big data (100MB to 1GB, but big data in modern sense)

A quick test shows it works (to draw array of several mega samples), seems not worse than NI AIdem for visualization, all subject to serious delay during zooming in. However, the loading is much slower,  as npTDMS is pure python, not C API implemented.

And the program just consume as little memory as it is on disk size.

Continue reading

Posted in Uncategorized | Comments Off on Using matplotlib to plot NI DAQmx data file (big data)

using OpenCV in Qt4 GUI using python

This python read from webcam and display into Qt4 widget(not highGUI) code is adapted from example code from : #http://wrdeoftheday.com/?page_id=2

since not all source code is attached, I complete the code and make it available for downland. This can serve as a better starting point for more complicated app.

zip password: iesensor.com

zip file:  qtcvpy

Continue reading

Posted in Programming | Comments Off on using OpenCV in Qt4 GUI using python