Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 116
FreeSandal | 輕。鬆。學。部落客 | 第 263 頁

勇闖新世界︰ W!o《卡夫卡村》變形祭︰感知自然‧工具

即將進入『方陣』,只見一望無際的藕田,

藕田

 

,氣勢磅礡,一眼看不完,或可勝於周瑜漚血的蘆花蕩。原來所謂『迷宮』是指如何尋徑過湖的呀。這『自行船』穿梭『絲連』藕間 ,不見減速,儼然是熟門熟路的耶!因問道︰這船是怎麼曉得行徑方向的呢? Mrphs 說︰『盤谷』山頂周遭有多處高空攝像裝置以及無線定址設施圓布成圜,可以感知且定位全谷之景物。『自行船』就是借此『即時資訊』,知道『方陣』當下狀態,決定行駛方向。 Mrphs 邊說邊將『邀請護照』拿給了我,講︰充好電了。接到手來 ,忽然螢幕上

150px-Meteor_burst    圖像閃閃。

 

還沒來得及問,就聽 Mrphs 說道︰先生好兆頭,偶逢英仙座流星雨將過,一般此時早見不著的了,快抬頭看。同時又邊說邊將『邀請護照』給拿走了。一時流星雨來, Mrphs 確突把螢幕橫在視線前,剛想出聲,只覺螢幕內外穿透通暢,彷彿不存在似的,這時流星雨已過,我尚未回過神來。也不知何時那『邀請護照』又回到了手上 ,自己正楞楞的看著上面的『流星雨』。不知是與 Mrphs 相處漸漸的熟了,還是怎樣?不待發問,就聽到講︰此地的人流行用『裸視 』模式,邊看邊錄,以求無遺。方才突發之舉,希望沒嚇著先生。心想這『裸視 』是什麼?正想間, Mrphs  又講︰所謂的『裸視 』模式能將『邀請護照』變成宛如『透明玻璃』般,一如用眼『親見 』般的相機功能設定。而且一切『目睹』的現象,都如其所見的被『紀錄』下來。其實它還能設定成『顯微觀物』或『望遠觀景』等模式。所觀景物可用『 It 網』作『影像查詢』,絕大多數事物一查立馬便知,也是此地認識自然的工具。

就在這邊聽邊學的過程裡,初步的認識了『邀請護照』強大功能的皮毛。也許應該說,那顯像的『品質』將使『視網膜解析度』成了個小巫的吧!或將超越『紙張』的哩!!或因『蘆花蕩』之憶想起了『盧溝橋』,只覺感嘆這人世間『多事之秋』的今日,奈何人類不能夠誠實面對『歷史』?難到不是常言道︰前事不忘,後事之師 。的嗎??

如果說未來『奈米技術』的發展不可限量。

微機電系統

微機電系統英語Microelectromechanical Systems,縮寫為MEMS)是將微電子技術機械工程融合到一起的一種工業技術,它的操作範圍在微米範圍內。比它更小的,在奈米範圍的類似的技術被稱為奈機電系統。微機電系統在日本被稱作微機械(英語 micromachines),在歐洲被稱作微系統(英語 microsystems)。

微機電系統與分子奈米技術分子電子學的超前概念不同。微機電系統由尺寸為1至100微米(0.001至0.1毫米)的部件組成,而且微機電設備的尺寸通常在20微米到一毫米之間。它們內部通常包含一個微處理器和若干獲取外界信息的微型傳感器。[1]在這種尺寸範圍下,經典物理基本定律通常不適用。而且由於微機電系統相當大的表面積/體積比,諸如靜電浸潤等表面效應要比慣性和比熱等體效應大很多。

微機電系統的加工技術由半導體加工技術改造而來,使其可以應用到實際當中,而後者一般用來製造電子設備。其加工方式包含了molding and plating,濕法刻蝕氫氧化鉀四甲基氫氧化銨)和干法刻蝕RIE和DRIE),電火花加工(EDM),和其他一些能夠製造小型設備的加工方式。

歷史

微型機械的概念在相應的加工技術出現之前就被提出了。1959年,理察·費曼加州理工學院進行題為《底層還有大空間》(英語 There’s Plenty of Room at the Bottom)的演講。費曼在演講中提出了在原子尺度上操縱物質的可能性以及將面臨的挑戰。 1964年,西屋公司的一支團隊製造出了第一批微機電設備。[2][3]這種設備名叫諧振柵極電晶體英語resonant gate transistor),

───

 

那麼跨學科的知識與技術之『整合』,也就勢在必行的矣。

機械電子學

Mecha

Mechatronics

Mechatronics is a multidisciplinary field of engineering that includes a combination of systems engineering, mechanical engineering, electrical engineering, telecommunications engineering, control engineering and computer engineering.[1][2] As technology advances the subfields of engineering multiply and adapt. Mechatronics’ aim is a design process that unifies these subfields. Originally, mechatronics just included the combination of mechanics and electronics, hence the word is a combination of mechanics and electronics; however, as technical systems have become more and more complex the word has been broadened to include more technical areas.

The word “mechatronics” originated in Japanese-English and was created by Tetsuro Mori, an engineer of Yaskawa Electric Corporation. The word “mechatronics” was registered as trademark by the company in Japan with the registration number of “46-32714” in 1971. However, afterward the company released the right of using the word to public, and the word “mechatronics” spread to the rest of the world. Nowadays, the word is translated in each language and the word is considered as an essential term for industry.

French standard NF E 01-010 gives the following definition: “approach aiming at the synergistic integration of mechanics, electronics, control theory, and computer science within product design and manufacturing, in order to improve and/or optimize its functionality”.

Many people treat “mechatronics” as a modern buzzword synonymous with “electromechanical engineering“.[3][4] However, other people draw a distinction between an “electromechanical component”—does not include a computer; an electro-mechanical computer (such as the Z4)—does not include an electronic computer; vs. a “mechatronic system”—a computer-controlled mechanical system, including both an electronic computer and electromechanical components.[5]

 

然而『行遠必自邇』,就讓我們藉著介紹樹莓派基金會新發行的

Sense HAT 』,展開走向『 MEMS 』『感測器』的第一步吧。

sense-hat-500x388

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰神奇護照‧八

《論語》‧《八佾》
祭如在,祭神如神在。子曰:「吾不與祭,如不祭。」

該如何看待『神話』與『傳說』的呢?歷史的『紀錄』或『考古』是否真能給出『答案』的耶??如果思考︰假使今人能夠回到過去 ,他的智識在那時是否能有作為!難保不會被認作是巫術橫行 !!要是說未來人類已知宇宙『緣起』之因,而且能力大到可以產生『創世紀』,到底有沒有改變了『什麼』的呢!?如是說那時流中『灰色』的地帶也只能講是不定的『灰』。若果在這個宇宙裡人可『覺悟』也可『再來』,人之各種『說法』能超越『如其所知 』的嗎?終極留下的『問題』就算祇有『一個』,到底是什麼『 ○ □ 』起始了這個『時空』,帶出『生命萬象』的哩?!

所以講『祭神』,人得相信『神在』,要不信『神在』,祭的又是什麼的呢?既已相信『神在』,卻又胡作非為,怕是以為神不在的吧!如是顛三倒四,恐無所禱哉!《 易 》易說︰『 ䷜ 』離南,

南贍部洲

贍部洲天城文梵文जम्बुद्वीपJambudvīpa),又譯閻浮提洲琰浮洲閻浮提鞞波等,一般指地球,在佛教耆那教印度教傳說中,都有重要地位。佛教傳說中四大部洲(另包括東勝神洲西牛賀洲北俱蘆洲)之一,因位於南方,又漢譯為南贍部洲南瞻部洲南閻浮提南閻浮洲

印度人也將自己居住印度半島稱為南贍部洲。

概論

梵語jambu,為樹名,即閻浮樹,是一種生長在印度南方的大型喬木。提,梵語dvīpa,洲之意。此地因盛長閻浮樹而得名,在須彌山之南,故又稱南閻浮洲。《阿含經》稱「南面有洲,名閻浮提,其地縱廣七千由旬,北闊南狹。」《阿毘曇論》:「有贍部樹,生此洲。北邊泥民陀羅河南岸,正當洲之中心。北臨水上,於樹下水底,南岸下,有贍部。黃金古名閻浮檀金,樹因金而得名,洲因樹而立號,故名贍部。」

在《往世書》中,南瞻部洲原是指古代印度南方婆羅多(bharata)等七國,隨著印度人地理知識的發達,慢慢變成指整個印度,最後是用以指人類所生存的這個世界。

在佛教傳說中,南贍部洲為人類的起源地。閻浮提中第一個造的城,為瞻婆城,接下來為伽屍婆羅捺城王舍城

 

Map_of_Jambudvipa_Indian_Hindu_Cosmology

 

,當真能如『日明』之兩作,真知真行殆不難矣??

 

於是作者本著《盜亦有道?》的精神︰

 

莊子、外篇『胠篋第十』上有一段文字

故 跖之徒問於跖曰:「盜亦有道乎?」跖曰:「何適而無有道邪? 妄意室中之藏,聖也;入先,勇也;出後,義也;知可否,知也;分均,仁也。五者不備而能成大盜者,天下未之有也。」由是觀之,善人不得聖人之道不立,跖不 得聖人之道不行;天下之善人少而不善人多,則聖人之利天下也少而害天下也多。

並有雜篇、盜跖第二十九一段故事,讀來令人津津有味,難道義賊廖添丁乃盜跖之傳人乎?東方的『大盜』哲學和西方的『駭客』觀點能否作比較呢?如果要比較,當然得知道 hacker 的源流。有位 Ben Yagoda 先生寫了一篇『 Hack 簡史』寫的很好。在此簡略的介紹,文中首先引用作者與美國方言學會會長談 “hack” 和 “hacker” 的對話,會長說︰

the earliest examples share a relatively benign sense of “working on” a tech problem in a different, presumably more creative way than what’s outlined in an instruction manual.

也就是說最早所謂駭客是「創造性的使用說明書,用不一樣的辦法解決工程問題的人」。其後作者寫到,“hack” 一字 1955年就在 M.I.T 出現了,到了 1975 年 M.I.T 的電腦行話語詞表開啟了將 hacker 用於對電腦狂熱份子的宣言,並於所謂『八條定義』中開宗明義的說「駭客原指用大刀闊斧作傢俱的人」;其中第八條寫到︰

[deprecated] A malicious meddler who tries to discover sensitive information by poking around. Hence password hacker, network hacker. The correct term for this sense is cracker.

此條中〔勿用〕deprecated 一詞所說的『懷著惡意愛管閑事』者成了今天的黑帽駭客,或乾脆說黑客;相反的『本著活潑創造精神』者則變成今天的白帽駭客,也許簡稱為素客。同時作者論及駭客一詞的詞意變化、應用領域擴大…等等,於此就不多贅敘了。

───

 

遁之以中性的『工具觀』,略講講

MFOC

MFOC, MiFare classic Offline Cracker, is a tool to help user to recover MIFARE Classic keys.

https://github.com/nfc-tools/mfoc

MFOC is an open source implementation of “offline nested” attack by Nethemba.This program allow to recover authentication keys from MIFARE Classic card.Please note MFOC is able to recover keys from target only if it have a known key: default one (hardcoded in MFOC) or custom one (user provided using command line).

Usage

Put one MIFARE Classic tag that you want keys recovering; Lauching mfoc, you will need to pass options, see

mfoc -h

 

的編譯與安裝,留『 Tool 』之當或不當問題給『大哉辯』者耶!!

 

git clone https://github.com/nfc-tools/mfoc.git
cd mfoc/
autoreconf -vis
./configure --prefix=/usr
make
sudo make install
cd
mfoc -h

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰神奇護照‧七

我們曾經說過『 mifare classic 』這類的卡在『 nfcpy 』上不能使用 ,由於許多應用實務需要可以讀寫的 NFC 卡,在此也就略為說說,以期方便讀者選擇吧。某些坊間的 NFC 卡,所使用的晶片規格為『NXP』

NTAG203

NFC Forum Type 2 Tag compliant IC with 144 bytes user memory

NXP Semiconductors has developed NTAG203 – NFC Forum Type 2 Tag compliant IC – to be used with NFC enabled devices according to NFC Forum technical specifications, according to NFC Forum recommendations or Proximity Coupling Devices (PCD), according to ISO/IEC 14443A. The communication layer (RF Interface) complies to parts 2 and 3 of the ISO/IEC 14443A standard. The NTAG203 is primarily designed for NFC Forum Type 2 Tag applications (i.e. Smart Advertisement, connection handover, Bluetooth simple pairing, WiFi Protected set-up, call request, SMS, goods and device authentication and others).

Contactless energy and data transfer

Communication to NTAG can be established only when the IC is connected to a coil. Form and specification of the coil is out of scope of this document.

When the NTAG is positioned in the RF field, the high speed RF communication interface allows the transmission of the data with a baud rate of 106 kbit/s.

Naming conventions

Table 1. Short naming convention (for easier product identification)
Family name Description
NTAG NXP NFC Tag product family name
2 Platform indicator
0 Generation number (starting from 0)
3 Code number for memory size

(0 : < 64 bytes, 1 : 64-96 bytes; 2 : 96-128 bytes; 3 : 128-256 bytes)

F Delivery option:

if stated, it is a HWSON8 package with Field Detection pin

───

 

讀者只要『谷歌』一下,仔細閱讀說明,當可判定它是否為『 nfc 論壇 』相容『標籤型態』。就像 NTAG203 晶片是『NFC Forum Type 2 Tag compliant IC』一樣。下面的讀寫範例,所使用的就是這一類的晶片︰

 

# 讀取測試
pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200 [nfc.clf] searching for reader on path usb:072f:2200 [nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010 ** waiting for a tag ** Type2Tag 'NXP NTAG203' ID=04F7CB1AFE3280 NDEF Capabilities:   readable  = yes   writeable = yes   capacity  = 137 byte   message   = 0 byte pi@raspberrypi ~/0.10.0 

# 寫入測試
pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200 load /home/pi/nfc-test/sp_nfcpy_docs.ndef  [nfc.clf] searching for reader on path usb:072f:2200 [nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010 ** waiting for a tag ** Old message: record 1   type   = ''   name   = ''   data   = '' New message: record 1   type   = 'urn:nfc:wkt:Sp'   name   = ''   data   = '\xd1\x01\x0fU\x03nfcpy.org/docs'  # 格式化測試 pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200 format tt2
[nfc.clf] searching for reader on path usb:072f:2200
[nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010
** waiting for a tag **
Type2Tag 'NXP NTAG203' ID=04F7CB1AFE3280
NDEF Capabilities:
  readable  = yes
  writeable = yes
  capacity  = 137 byte
  message   = 0 byte
pi@raspberrypi ~/0.10.0 # libnfc 相關讀取 pi@raspberrypi ~/nfc-test sudo mifare-ultralight-info 
Tag with UID 04f7cb1afe3280 is a Mifare UltraLight

 

若講到 NFC 的可能應用,純粹想像力之所為。如果說有人寫作一套『Calibre』程式來管理『電子書』,

Calibre

About calibre

calibre started life on 31 October, 2006, soon after the release of the SONY PRS-500, the first e-ink based reader to be sold commercially in the US. At the time, I was a graduate student, with a lot of time on my hands. The PRS-500 did not work at all with Linux, my operating system of choice, so I decided to reverse engineer the USB protocol that it used, to get it working on Linux. This was accomplished with the help of the fine folks over at mobileread.com and calibre was born, albeit named libprs500.

At the time there were no satisfactory tools to convert content into the LRF format, used by the SONY reader, so I decided to implement a converter to convert the most popular e-book formats to LRF. This converter proved to be wildly popular and far better than the (mostly non-existent) offerings from SONY. It was picked up and used by various publishing houses and content digitizers to produce the first generation of books in the LRF format.

As my e-book collection grew, I realized that managing it was quickly becoming unwieldy, so I decided to write a graphical interface to libprs500 to make it easier. This became calibre, in its present form, as a comprehensive e-book management tool. libprs500 was renamed to calibre in mid-2008. The name calibre was chosen by my wife, Krittika. The libre in calibre stands for freedom, indicating that calibre is a free and open source product, modifiable by all. Nonetheless, calibre should be pronounced as cali-ber, not ca-libre.

Today calibre is a vibrant open-source community with half a dozen developers and many, many testers and bug reporters. It is used in over 200 countries and has been translated into a dozen different languages by volunteers. calibre has become a comprehensive tool for the management of digital texts, allowing you to do whatever you could possibly imagine with your e-book library. Reading is very important to me and one of my goals has always been to prevent either the fragmentation or the monopolization of the e-book market by entities that care solely for short-term goals. As the calibre community continues to grow, driven by book lovers, for book lovers, hopefully it will always present an alternative for people that love to read e-books and want to be in control of their own digital libraries.

Kovid Goyal
November 2009

 

那麼有人會如何管理『實體物』的呢?或許『天馬行空』並非壞事 ,不能落實才成了『空中閣樓』的哩!

 

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰神奇護照‧六

即使是在夜晚,只藉著月光,總覺得湖水的顏色,隨著船行,逐漸的變化。因問道︰這是個變色湖嗎? Mrphs 說︰此湖北淺南深,宛如一個『圓硯』,中央之東西線分界。南邊湖底古通大海,至今水還是鹹的。北邊之水來自『盤谷』北方的『湧泉』,是極為甘甜的淡水。眼前將入『方陣』,一會東西分界線就看的一清二楚的了。不知先生可有雅興至『湖心小築』一游?那兒看湖觀星上中天最是合適。答道︰何妨,請帶路。祇見 Mrphs 在『神奇護照』幾處按了按,出現一個『螢幕』,上有一些『圖像』, Mrphs 選了其中之一 ,操作了一下,說︰新路由設好了。由於身在遠處,過程沒瞧清楚 ,但覺最後畫面上的『三百 斤 』很納悶。又問道︰那個『三百』□○是什麼意思? Mrphs 說︰你是說『三百斤』的吧!『 斤 』斤是此地之『計價』單位。遊『湖心小築』的費用大約等於『三百』乘以『孔方』一斤的『當量』。心想︰千文鐵錢,重二十五斤。這一趟得花一萬兩千『孔方』的哩!當真『貴重』的很!!也不知那  W!o^{+} 護照裡有沒有『放錢』的呢??正躊躇該不該問,卻聽 Mrphs 講︰先生此行都無須掛慮費用之事,一切早就料理好了,就請盡心盡興的叻。剛才不過是操作『智慧型護照』的『行動旅遊』界面,產生『路由憑證』之後,『自行船』就會認證更改路程自動前往。那個『三百 斤 』就是衍生的差額費用。看來還真小瞧了這『神奇護照』,……… 突然腦中浮現

 

M♪o 的座右銘《 就 》就

不能堅持,就不能藝術。

沒有信仰,就沒有宗教。

缺乏熱情,就缺乏生命。

只需給孩子一根槓桿,他就能移動地球。

 

《 文 》:就,高也。从京,从尤。尤,異於凡也。 籒文就 ,籒文就

 

也許是 W!o 有話想說的吧!這個『就』字果然難矣哉!!

該怎麼解說那個『路由憑證』的呢?雖然現下此事也很熱門,稱之為『主機‧卡‧倣真』

HCE

Host Card Emulation (HCE)是僅僅使用軟體對智慧卡進行的虛擬而精確的呈現。在HCE架構之前,NFC交易只通過Secure Element進行.

HCE提供了如下能力使得廠家能夠通過移動設備提供:更簡便的支付方案;閉環的非接觸支付方案;實時的支付卡分發;更具有戰略意義的是,不必改變終端軟體即可實現便利的部署。

歷史

HCE術語最初是由SimplyTapp的[來源請求] Doug Yeager和Ted Fifelski在2012年提出的,以描述他們以遠程智慧卡操作進行交易的能力。之前卡模擬只是物理層面存在,即,只能通過一般內置於智慧型手機內的多用途Secure Element進行卡複製。第一個實現是在2012年Engadget對SimplyTapp的報導[1][與來源不符],他們為CyanogenMod Android社群發布了他們的Tapp近場通信支付錢包。

───

 

許多資訊或深陷『技術專利』中??『就』假借公開的資訊,以

M♪o 之學習筆記本《巳》文章︰【䷜】樽酒簋貳 》之精神,

派生碼訊

巳 蛇

來氏《 易 》易註︰

六四,樽酒,簋貳,用缶,納約自牖,終无咎。

四 變,中爻離巽,巽木離中虛,樽之象也。坎,水酒之象也。中爻震竹,簋乃竹器,簋之象 也。缶,瓦器所以盛酒漿者。比卦坤土中虛,初變震,有離象,故曰缶。離卦鼓缶 ,此變離,故曰缶,《漢書》「擊缶而歌烏烏」。貳者副也,言樽酒而簋,即副之 也。言一樽之酒,二簋之食,樂用瓦缶,皆菲薄至約之物也。納約自牖者,自進于牖下,陳列此至約之物而納進之也。在墻曰牖,在屋曰囪。牖乃受明之處,變離, 牖之象也。此與遇主于巷同意,皆其坎陷艱難之時,故不由正道也。蓋樽酒簋二用缶,見無繁文之設 。納約曰自見,無儐介之儀。世故多艱,非但君擇臣,臣亦擇 君,所以進麥飯者不以為簡,而雪夜幸其家,以嫂呼臣妻者,不以為瀆也。修邊幅之公孫,述宜乎為井底蛙矣。

六四柔順得正,當國家險難之時,近九五剛中之君,剛柔相濟,其勢易合,故有簡約相見之象。占者如此,庶能共謀出險之計。始雖險陷,終得无咎矣。

《象》曰:樽酒簋貳,剛柔際也。

剛五柔四。際者相接際也。五思出險而下求 ,四思出險而上交。此其情易合,而禮薄亦可以自通也。

︰習 坎 坎,重 險 險也。孚, 信 信也。 信 信而能唯心習 教事 事,故可出 坎 坎。然而一己之 力 力微薄,更需要合 同 同志 同 同道合者,齊 行 行以濟重 險 險。當此之時也 ,樽酒簋貳,納約自牖,怡然 安 安特。

例假日。

晨起無聊寄,明兒 同 樂 會 同樂會,亦悲亦是喜,喜大家鵬程萬里,悲今後或難再遇。須謹記,破 坎 坎突 險 險,還是有賴志 之 友與道 朋 朋。當懷念,同 學 學共 習 習之情誼。莫期望 ,倚靠 幸 幸 運 運。《 文 》 文說︰

幸,所以驚人也。从大从 辛 。一曰大聲也。凡幸之屬皆从幸。一曰讀若瓠。一曰俗語以盜不止爲幸,幸讀若籋。

運,迻徙也。从辵軍聲。

或應知, 幸 幸,古義枷鎖也。得脫鐐銬,何其有幸! 運 運,本講遷軍。若能安泰!運何能不好?皆因不祥事耶!!??

西諺講︰幸運女神衷情準備好了的人,莫要與之擦身而過;當上帝來敲門時,記得開門。

 

用『 libnfc 』與『 nfcpy 』演示這『 NFC 卡倣真』之旨。

 

# 以 USB ACS / ACR122U 為倣真主體,用 libnfc 之 nfc-emulate-forum-tag4 模擬『 nfc 論壇』的第四類卡。必須與下面的讀卡程式配合。

pi@raspberrypi ~ sudo nfc-emulate-forum-tag4 NFC device: ACS / ACR122U PICC Interface opened Emulating NDEF tag now, please touch it with a second NFC device  # 讀卡時輸出     In: 00  a4  04  00  07  d2  76  00  00  85  01  01       Out: 90  00       In: 00  a4  00  0c  02  e1  03       Out: 90  00       In: 00  b0  00  00  02       Out: 00  0f  90  00       In: 00  b0  00  02  0d       Out: 20  00  54  00  ff  04  06  e1  04  ff  fe  00  00  90  00       In: 00  a4  00  0c  02  e1  04       Out: 90  00       In: 00  b0  00  00  02       Out: 00  21  90  00       In: 00  b0  00  02  21       Out: d1  02  1c  53  70  91  01  09  54  02  65  6e  4c  69  62  6e  66  63  51  01  0b  55  03  6c  69  62  6e  66  63  2e  6f  72  67  90  00   nfc_emulate_target: Target Released pi@raspberrypi ~ 

# 需同時使用 Adafruit PN532 讀卡機,事先準備好等待讀卡狀態。
pi@raspberrypi ~/0.10.0 python examples/tagtool.py --device tty:USB0:pn532 show [nfc.clf] searching for reader on path tty:USB0:pn532 [nfc.clf] using PN532v1.6 at /dev/ttyUSB0 ** waiting for a tag **  # 讀卡時輸出 Type4ATag MIU=63 FWT=0.154657 NDEF Capabilities:   readable  = yes   writeable = yes   capacity  = 65532 byte   message   = 33 byte NDEF Message: record 1   type   = 'urn:nfc:wkt:Sp'   name   = ''   data   = '\x91\x01\tT\x02enLibnfcQ\x01\x0bU\x03libnfc.org' pi@raspberrypi ~/0.10.0 

# 以 Adafruit PN532 為主作倣真主體。

# Type 4 卡 OK
pi@raspberrypi ~ sudo nfc-emulate-forum-tag4 NFC device: pn532_uart:/dev/ttyUSB0 opened Emulating NDEF tag now, please touch it with a second NFC device     In: 00  a4  04  00  07  d2  76  00  00  85  01  01       Out: 90  00       In: 00  a4  00  0c  02  e1  03       Out: 90  00       In: 00  b0  00  00  02       Out: 00  0f  90  00       In: 00  b0  00  02  0d       Out: 20  00  54  00  ff  04  06  e1  04  ff  fe  00  00  90  00       In: 00  a4  00  0c  02  e1  04       Out: 90  00       In: 00  b0  00  00  02       Out: 00  21  90  00       In: 00  b0  00  02  21       Out: d1  02  1c  53  70  91  01  09  54  02  65  6e  4c  69  62  6e  66  63  51  01  0b  55  03  6c  69  62  6e  66  63  2e  6f  72  67  90  00   nfc_emulate_target: Target Released  # Type 2 卡,如 nfc-emulate-forum-tag2 man 文件說明,讀取有誤。 pi@raspberrypi ~ sudo nfc-emulate-forum-tag2
NFC device: pn532_uart:/dev/ttyUSB0 opened
Emulating NDEF tag now, please touch it with a second NFC device
    In: 30  00  
    Out: 00  00  00  00  00  00  00  00  00  00  ff  ff  e1  10  06  0f  
    In: 30  00  
    Out: 00  00  00  00  00  00  00  00  00  00  ff  ff  e1  10  06  0f  
    In: 30  04  
    Out: 03  21  d1  02  1c  53  70  91  01  09  54  02  65  6e  4c  69  
    In: 30  08  
    Out: 62  6e  66  63  51  01  0b  55  03  6c  69  62  6e  66  63  2e  
    In: 30  08  
    Out: 62  6e  66  63  51  01  0b  55  03  6c  69  62  6e  66  63  2e  
    In: 30  0c  
    Out: 6f  72  67  00  00  00  00  00  00  00  00  00  00  00  00  00  

# 錯誤處。※注意讀取端。
nfc-emulate-forum-tag2: RF Transmission Error
pi@raspberrypi ~ # 對應用 USB ACS / ACR122U 當作讀取端。  # Type 4 OK pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200[nfc.clf] searching for reader on path usb:072f:2200
[nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010
** waiting for a tag **
[nfc.tag.tt4] ACS ACR122U on usb:001:010 does not support fsd 256
Type4ATag MIU=63 FWT=0.154657
NDEF Capabilities:
  readable  = yes
  writeable = yes
  capacity  = 65532 byte
  message   = 33 byte
NDEF Message:
record 1
  type   = 'urn:nfc:wkt:Sp'
  name   = ''
  data   = '\x91\x01\tT\x02enLibnfcQ\x01\x0bU\x03libnfc.org'

# Type 2 似乎 OK
pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200[nfc.clf] searching for reader on path usb:072f:2200 [nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010 ** waiting for a tag ** Type2Tag ID=0800B00B NDEF Capabilities:   readable  = yes   writeable = no   capacity  = 46 byte   message   = 33 byte NDEF Message: record 1   type   = 'urn:nfc:wkt:Sp'   name   = ''   data   = '\x91\x01\tT\x02enLibnfcQ\x01\x0bU\x03libnfc.org' pi@raspberrypi ~/0.10.0 


# 自製 NDEF 紀錄之倣真範例
pi@raspberrypi ~/0.10.0 examples/ndeftool.py make smartposter http://nfcpy.org/docs -o sp_nfcpy_docs.ndef pi@raspberrypi ~/0.10.0 mv sp_nfcpy_docs.ndef /home/pi/nfc-test/

pi@raspberrypi ~/0.10.0 sudo python examples/tagtool.py --device usb:072f:2200[nfc.clf] searching for reader on path usb:072f:2200 [nfc.clf] using ACS ACR122U PN532v1.6 at usb:001:010 ** waiting for a tag ** [nfc.tag.tt4] ACS ACR122U on usb:001:010 does not support fsd 256 Type4ATag MIU=63 FWT=0.154657 NDEF Capabilities:  readable = yes  writeable = yes  capacity = 65532 byte  message = 24 byte NDEF Message: record 1  type = 'urn:nfc:wkt:Sp'  name = ''  data = '\xd1\x01\x0fU\x03nfcpy.org/docs' pi@raspberrypi ~/0.10.0 

# 自制紀錄倣真
pi@raspberrypi ~/nfc-test sudo nfc-emulate-forum-tag4 sp_nfcpy_docs.ndef  NFC device: pn532_uart:/dev/ttyUSB0 opened Emulating NDEF tag now, please touch it with a second NFC device  In: 00 a4 04 00 07 d2 76 00 00 85 01 01   Out: 90 00   In: 00 a4 00 0c 02 e1 03   Out: 90 00   In: 00 b0 00 00 02   Out: 00 0f 90 00   In: 00 b0 00 02 0d   Out: 20 00 54 00 ff 04 06 e1 04 ff fe 00 00 90 00   In: 00 a4 00 0c 02 e1 04   Out: 90 00   In: 00 b0 00 00 02   Out: 00 18 90 00   In: 00 b0 00 02 18   Out: d1 02 13 53 70 d1 01 0f 55 03 6e 66 63 70 79 2e 6f 72 67 2f 64 6f 63 73 90 00  nfc_emulate_target: Target Released pi@raspberrypi ~/nfc-test 

 

成就那《吃著魚釣魚!!有何不可?》之真誠『信念』︰

過去有人說︰『給人一條魚,不如教他釣魚』。這話雖然很好,可是對釣不到魚的人來說,可不是件好事。難道說有釣魚的本事,就一定能釣到魚嗎?就像又有人說︰『不要在沒有魚的地方釣魚 』!!

到底『誰對誰錯』?

吃著魚釣魚』── 一個理念、一種方法、一門生活哲學

 

 

 

 

 

 

 

 

 

勇闖新世界︰ W!o《卡夫卡村》變形祭︰神奇護照‧五

假使不介紹一下『 RFIDIOt.org 』,恐讀者會少了一個學習派生 NFC 程式的園地,故此特別的加以補足。

rfidiot qr code

News

October 2012: Migrated source code to https://github.com/AdamLaurie/RFIDIOt. I realised one of the reasons I haven’t been doing many updates is because it’s always such a faff getting a new tarball together, updating the webpage etc., etc. Now, should you be vaguely interested, you can simply watch the project on github and get notified whenever a change is committed… Even better, if you have updates you want to contribute, just fork and create a merge request… (The first of which was Nick von Dadelszen’s Android support package). Sweet!

I will follow my usual practice of ‘commit early, commit often’, so whenever I’m working on something, expect daily updates… Speaking of which, I finally got around to bringing libNFC support up to date, so it now works with libnfc 1.6.0-rc1.

………

What is RFIDIOt?

RFIDIOt is an open source python library for exploring RFID devices. It’s called “RFIDIOt” for two reasons:

  1. I like puns. This one stands for “RFID IO tools”
  2. Since I haven’t done any serious programming for a long time, I felt like an idiot having to learn a whole new language and the code probably looks like it’s written by an idiot. However, python rocks, so it was worth it!

What does it do?

It currently drives a range of RFID readers made by ACG, called the HF Dual ISO and HF Multi ISO, which are both 13.56MHz devices, and the LF MultiTag which is 125/134.2kHz. Frosch Hitag reader/writers are also now supported. There’s no reason it couldn’t work with others, these are just the first ones I got my hands on, and since they present themselves to the O/S as standard serial devices without having to install any drivers, it made interfacing very simple (but see the Technical Note section below as I’ve had some issues recently). I have written some example programs to read/write tags and have started on the library routines to handle the data structures of specific tags like MIFARE. It is far from complete but I thought I’d follow the “publish early, publish often” philosophy on this one…

PC/SC (MUSCLE) devices, such as the Omnikey CardMan are also supported. I am curently testing with a CardMan 5321.

───

 

考之以『 pynfc.py 』原始碼,

RFIDIOt/rfidiot/pynfc.py

#!/usr/bin/python
#
# pynfc.py – Python wrapper for libnfc
# version 0.2 (should work with libnfc 1.2.1 and 1.3.0)
# version 0.2a – tweaked by rfidiot for libnfc 1.6.0-rc1 october 2012
# Nick von Dadelszen (nick@lateralsecurity.com)
# Lateral Security (www.lateralsecurity.com)
# Thanks to metlstorm for python help 🙂
#
# This code is copyright (c) Nick von Dadelszen, 2009, All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

 

可知這些程式範例需要『 libnfc-1.6.0-rc1 』,底下略講取得及編譯之方法 。務須注意,不要安裝到已經裝有『 libnfc-1.7.1 』程式庫的系統上,以免發生版本衝突。

 

# libnfc 1.6.0-rc1 編譯與安裝
sudo apt-get install libudev-dev
sudo apt-get install libusb-dev
sudo apt-get install libpcsclite-dev

# 取得檔案
wget http://libnfc.googlecode.com/files/libnfc-1.6.0-rc1.tar.gz

# 編譯及安裝
./configure --prefix=/usr --sysconfdir=/etc --with-drivers=all

make

sudo make install

 

最後用

git clone https://github.com/AdamLaurie/RFIDIOt.git

取得『 RFIDIOt 』。至於說該如何開始的呢?就請讀者自行閱讀

rfidiot qr code    說明文件的了。
Documentation

 

 

 

 

 

 

 

 

 

輕。鬆。學。部落客