樹莓派 3B+ 筦窺︰先後接續

蕭規曹隨》典故引文︰

蕭何與曹參兩人自少年微賤時便已是好友,後來西漢建國,蕭何身為宰相,曹參身為大將,地位不凡的兩人卻反而有了嫌隙。蕭何擔任相國時,參考前朝文獻制訂典章及制度。蕭死前,推薦曹參繼任 。曹參上任後,認為蕭何訂下的法令已很完備,所以繼續沿用而不作改動。

曹參就任漢相國期間,整日飲酒食肉,政治上清靜無為,繼續執行蕭何留下的政策,不予變動。漢惠帝認為自己被曹參輕視,於是命其子御史大夫曹窋勸諫,曹參把曹窋鞭笞了兩百下並趕出門外,漢惠帝於是親自責問曹參。

曹參摘帽,向皇帝俯首謝罪:「陛下您認為,您與先帝相比,誰較為英明神武?」皇帝回道:「我怎敢與先帝比?」曹參又問說:「我跟蕭何比,誰較賢能?」皇帝說道:「你好像不太比得上他。 」曹參接著說:「陛下說得對,且高祖跟蕭何平定了天下,法令都健全具備。陛下只要垂拱而治,我們這些官吏堅守崗位,遵守他們的法令而不犯過失,不是很適合嗎?」

時人歌頌:「蕭何制定法律,調和整齊如一;曹參繼任相國,遵法而不犯過失。施載清淨無為的政策,人民因而安寧統一。」史稱「蕭規曹隨」。

 

在《『騛罿』── 非同的禪!!》一文裡,我們談過︰

吉多的 Python 『非同』於其他程式語言,居然把『空白』符號寫進了它的『文法』裡,竟然用『對齊的空白』表示程式區塊。如是種種『見地』,匯聚成一條稱作『非同的』pythonic Way 大道。吉多他的『中心思想』,集中的表現在由 Tim Peters 先生所寫的『 Python 的禪』,收錄在『 this 』模組 module 裡︰

Readability counts.
可讀性能加分

或許因為太多人問︰是否有一天,將有一版 Python 可以使用『“{ ” 與 “} ”』來表達『程式區塊』??以至於有了這個特別『復活蛋』之幽默回答!!

pi@raspberrypi ~ python</span> <span style="color: #339966;">Python 2.7.3 (default, Mar 18 2014, 05:13:23)</span> <span style="color: #339966;">[GCC 4.6.3] on linux2</span> <span style="color: #339966;">Type "help", "copyright", "credits" or "license" for more information.</span> <span style="color: #339966;">>>><span style="color: #ff0000;"> <strong><span style="color: #ff99cc;">from __future__ import</span> braces</strong></span></span> <span style="color: #339966;">File "<stdin>", line 1</span> <span style="color: #3366ff;"><strong><span style="color: #cc99ff;">SyntaxError:</span> not a chance</strong></span> <span style="color: #339966;">>>></span>  <span style="color: #008080;">看來這是『<strong>沒機會</strong>』 <strong>not a chance</strong> 的了…,甚至有…</span>  <span style="color: #ff9900;">>>> import __<strong><a style="color: #ff9900;" title="Thue 之改寫系統《三》" href="http://www.freesandal.org/?p=6474">hello</a></strong>__</span> <span style="color: #ff9900;"> Hello world...</span> <span style="color: #ff9900;"> >>></span>  <span style="color: #008080;">其實這個『<strong>空白</strong>』就是源自《<strong><a style="color: #008080;" title="始中終!!" href="http://www.freesandal.org/?p=24700">始中終!!</a></strong>》所說的『<strong><a style="color: #008080;" href="http://en.wikipedia.org/wiki/ABC_%28programming_language%29">ABC</a></strong>』語言,在今天都還有個名稱叫做『<strong><a style="color: #008080;" href="http://zh.wikipedia.org/wiki/%E8%B6%8A%E4%BD%8D%E8%A7%84%E5%88%99">越位規則</a></strong>』,正宛如不同的程式語言有不同的『<strong>聖歌</strong>』 <strong>mantra</strong> 一樣, Python 的禪是︰</span>  <span style="color: #ff99cc;">There should be one- and preferably only one -obvious way to do it.</span> <span style="color: #ff99cc;">總有一個,最好是唯一的一個,明白的作法</span>  <span style="color: #008080;">。而 Perl 與 Ruby 的咒語說︰</span>  <span style="color: #cc99ff;">There's more than one way to do it.</span> <span style="color: #cc99ff;">凡事都有多種作法</span>  <span style="color: #008080;">事實上也沒有太多好爭論的。</span>  <span style="color: #808080;">─ 《<a style="color: #808080;" href="http://www.freesandal.org/?p=25601">PHYSICAL COMPUTING ︰ PYTHON 《補充》︰ IDE 用法…</a>》</span>     <span style="color: #666699;">『蕭規曹隨』是講︰</span>  <span style="color: #cc99ff;">好的法令制度,切莫將之改壞!</span>  <span style="color: #666699;">一如派生二到派生三︰</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170124] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> from __future__ import braces
File “<stdin>”, line 1
SyntaxError: not a chance

>>> import __hello__
Hello world!
>>>

 

先後接續也☆

所以有關『UARTS』與『Bluetooth』之事,請讀

THE RASPBERRY PI UARTS

The SoCs used on the Raspberry Pis have two built-in UARTs, a PL011 and a mini UART. They are implemented using different hardware blocks, so they have slightly different characteristics. However, both are 3.3V devices, which means extra care must be taken when connecting up to an RS232 or other system that utilises different voltage levels. An adapter must be used to convert the voltage levels between the two protocols. Alternatively, 3.3V USB UART adapters can be purchased for very low prices.

By default, on Raspberry Pis equipped with the wireless/Bluetooth module (Raspberry Pi 3 and Raspberry Pi Zero W), the PL011 UART is connected to the BT module, while the mini UART is used for Linux console output. On all other models the PL011 is used for the Linux console output.

In Linux device terms, by default, /dev/ttyS0 refers to the mini UART, and /dev/ttyAMA0 refers to the PL011. The primary UART is that assigned to the Linux console, which depends on the Raspberry Pi model as described above, and can be accessed via /dev/serial0.

Mini UART and CPU core frequency

The baud rate of the mini UART is linked to the core frequency of the VPU on the VC4 GPU. This means that as the VPU frequency governor varies the core frequency, the baud rate of the UART also changes. This makes the UART of limited use in the default state. Also, when the Linux console uses the mini UART (Raspberry Pi 3, Raspberry Pi Zero W), as a consequence of the UART being disabled, the console is also disabled.

The Linux console can be re-enabled by adding enable_uart=1 to config.txt. This also fixes the core_freq to 250Mhz (unless force_turbo is set, when it will fixed to 400Mhz), which means that the UART baud rate stays consistent.

The default value of the enable_uart flag depends on the actual roles of the UARTs, so that if ttyAMA0 is assigned to the BT module, enable_uart defaults to 0. If the mini UART is assigned to the BT module, then enable_uart defaults to 1. Note that if the UARTs are reassigned using a Device Tree Overlay (see below), enable_uart defaults will still obey this rule.

 

或參考

‧ W!O+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之 UART 篇

‧ W!O+ 的《小伶鼬工坊演義》︰樹莓派 3 三兩事之藍牙篇【上】

哩☺

 

 

 

 

 

 

 

樹莓派 3B+ 筦窺︰ 放眼未來?

網際網路 Internet 興起以來,各類『中英新語詞』紛紛出籠,這些新造詞雅俗難辨有時意義晦澀,常常一個字的說法褒貶不一。也許要了解一個字的意思,最好先參考『專業字典』,當然能知道它的語源、出處更好,以免造成不必要的誤解。之所以如此開場是因為 noobs 一字的網路上的中文翻譯及用法常常有著貶意── 比如︰菜鳥小白嫩咖…,當然也有一些譯為新手的。既然樹莓派基金會特別用了這個字來描述建議初學者下載的檔案名稱,就讓我們先看看『劍橋先進學習者字典』上 noob 的定義︰

someone who has just started doing something, especially playing a computer game or using a type of software, and so does not know much about it.

同時對照關聯字 newbie 的定義︰

someone who has just started doing an activity, a job, etc.: The guide helps newbies understand the internet.

以及初學者、新手、生手  beginner 的定義︰

a person who is starting to do something or learn something for the first time: This judo class is for beginners only.

由此看來,newbie 是指某種活動、工作的初學者;而 noob 則是指玩遊戲、使用軟體的 newbie。如果再參考『Collins 英文字典』︰

newbie: (slang) a newcomer, esp in computing or on the internet.
C20: origin unknown; possibly from new boy.
noob: (slang) another word for newbie Also written: n00b.

歸結的說,newbie 特指計算運算、網際網路上的初學者,也許看情況可以譯為『…新手』,noob 或可譯為『軟體新手』。

』與『』兩字音同卻字用不同。『辨』意指了別異同、真假 ,類似觀察、檢驗;而『辯』字議是論非、講說對錯。雖然有人說︰真理越辯越明,但古之『小兒論日遠近』上有︰

一說日出時離地較近,因為它比較大。

一說日午時離地較近,因為它比較熱。

所以當辯論不清時,最好本著科學精神──觀察、事實、假說、理論 、實驗──去判斷。

─── 《NOOBS 辨義

 

辯辨總有終了時︰

New approach for Raspberry Pi OMV images

New OMV image for Raspberry Pi 2 and 3!

[IMG:http://kaiser-edv.de/tmp/NumpU6/Raspberry_Pi_OMV.jpg]
Important:

  • This image is not compatible with single core Raspberries (A, B, A+, B+, Zero, Zero W) since they’re too slow anyway and their CPU architecture is not supported any more (it’s not based on Raspbian any longer but on upstream Debian ‘armhf’ branch which supports ARMv6 architecture not any longer)
  • For satisfying results burn it only with Etcher (no need to decompress, Etcher will verify burning process and save you from some common SD card troubles). It’s strongly recommended to always test your SD card with either F3 or H2testw first to check for counterfeit/broken cards.
  • On first boot OMV installation will be finished. This requires your RPi being connected to network/Internet and might take between 10 and 40 minutes (depends solely on the random write speed of your SD card). After installation is finalized the Raspberry will reboot automatically and can then be used. Be patient please and in doubt watch the green led for activity.
  • Flashmemory plugin is enabled and monitoring is disabled to reduce wear on SD card (for reasons see here)
  • A quick guide to do initial Wi-Fi setup has been added to the end of the thread.
  • RPi 3+ users please read here at the end of the thread.

While this image uses upstream Debian repositories it is configured to fetch kernel/bootloader directly from official archive.raspberrypi.org repositories and also some proprietary binaries to deal with VideoCore IV (eg. vcgencmd, raspividand others).

Not so important (but still worth a read!):

  • This image does some ‘health logging’ in /var/log/raspihealth.log. On every shutdown there will be a single line logged that is either a timestamp plus a single zero (0) or a timestamp plus a bunch of digits. If the most left of these digits are a 1 instead of 0 your Raspberry either overheats or is powered insufficiently or both. If you run in instabilities please always check this first
  • There’s /usr/local/sbin/raspimon included. This tool executed via SSH as ‘sudo raspimon’ reports real CPU clockspeeds by asking the firmware and also reports throttling, under-voltage and as a result the firmware doing ‘frequency capping’ (reducing all clockspeeds to save you from underpowering hassles negatively impacting performance). For a more detailed explanation please see here.
  • If you experience troubles you can always execute in a terminal ‘sudo armbianmonitor -u’ which will try to upload debug info to an online pasteboard service (RPi 3 B+ example here). It’s a great idea to check the output yourself and at least to provide the URL if you ask for help in the forum.
  • The image resizes the rootfs automagically to ~7.3GB on first boot and creates a 3rd partition using the remaining space of the SD card you need to initialize manually if you want to use it for OMV shares (‘mkfs.ext4|mkfs.btrfs /dev/mmcblk0p3’)
  • While this OMV image looks like Armbian it’s not (no support from Armbian team or in Armbian forum). We only chose the proven way to use Armbian’s build system to generate OMV images for ARM boards now for Raspberries too (technically inclined people should look at the bottom of this post what is different)

Please always keep in mind that on cheap single board computers like Raspberries the most common problem sources aren’t software related but powering and/or SD card troubles. Please always check this first before reporting problems (see above for under-voltage detection, how to ensure to write OMV to SD card properly and if you report problems how to provide a debug log!)

Technical details (nerd stuff!):

  • The rootfs of this image has been created fully automated by Armbian’s build system on 12-Jun-2017 for a different ARMv7 device (fully automated means debootstrapped from scratch so no one ever logged in so far)
  • It has then been combined with an RPi image skeleton based on pi64 project and contains both a 64-bit 4.11 mainline kernel (inactive by intention) and latest official RPi 4.9.80 as the active 32-bit kernel (since this kernel variant will be updated through an apt repo so security fixes that require kernel updates aren’t an issue). If you’re adventurous you can transform this image into something that runs true 64-bit ARMv8 software on an RPi 3 (don’t ask for support, better check out pi64 instead)
  • Since this OMV image has been created by Armbian’s build system it contains a lot of Armbian utilities. Most of these aren’t supported and must not be used. Only exception: ‘sudo armbianmonitor -u’ to provide a debug log.
  • /etc/update-motd.d/10-header has been changed to output the RPi model at login: BOARD_NAME=”$(/usr/bin/awk -F” ” ‘{print $1 $2″ “$3}’ </proc/device-tree/model)”
  • Two more Armbian specific login hints below /etc/update-motd.d/ have been removed
  • /etc/apt/sources.list.d/armbian.list has been removed so you won’t receive any Armbian updates
  • /etc/armbian-release has been manually adjusted to mark this image being unsupported and made for Raspberries
  • /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service renamed to reflect the fact that it’s tty1S0 on Raspberries
  • /etc/hostname has been set manually to ‘raspberrypi’
  • /etc/rsyslog.d/raspberrypi.conf included to filter out some annoying log messages
  • /etc/fstab is the standard Raspbian one (you might want to change / mount options to ‘defaults,noatime,nodiratime,commit=600,errors=remount-ro’ to reduce SD card wear out if you can ensure that your RPi is powered appropriately)
  • timezone is set automatically on first boot via tzupdate (not yet reflected in OMV UI)
  • Minor RPi specific logging/monitoring improvements
  • Everything else is from an Armbian armhf userland made for a Clearfog Base with some Raspberry specific additions below /lib/modules/ and /lib/firmware/
  • The changes are contained/documented in a repository

 

憤啟悱發是初心︰

tkaiser wrote:

Well, it’s time to not only stop supporting the lousy RPi but SBC in general. Way too frustrating since users all the time blame software for simple hardware issues.

I started using OMV recently on a RPi 3B+. For my case, it works well and I like it. Wireless NAS (!!!), rarely used by two users, and absolutely nothing about speed. 15MB/s transfer speed over WiFi is more than three times of that what needs most speed in my use case (MiniDLNA for some tv shows). I could replace that very well with a simple “apt install samba minidlna” and a small config file for each of the two, but I like how i can configure the shares and the DLNA server in the clicky clicky WebGUI. A welcome alternation to all my other more used servers/services which I have to maintain on the command line. A simple short THANKS for your work!

I can understand your desire to drop RPi support. The Raspberry Pis draw a lot of attention and pull a lot of n00Bs into the business. Most n00Bs stay with the RPi, the freaks and more interested go with other platforms. If the other platforms would do more marketing, they would pull in also more people of the kind, that attach a rocked down 15-20 year old 100MBit cable (the blue Netgear cable, we all have at least one of them somewhere) and complain about speed. But I like the Pis because of the price point and the availability. I’m especially interested in the ROCK64 (and also looking at the Asus tinker board probably just for some marketing reasons), but it’s double the price in europe, or you need to order it from china and wait weeks for it. I can get a new Pi in 15 minutes from home.

To cut the long story short now: How is your actual view about the Pi things? Do you think you gonna support it in the future, or would you better drop the “apt install samba minidlna” line on a fresh raspbian lite in my case?

 

『新學』豈不原『綠手』green hand ?

改日自然念舊情!

特為讀者介紹

What is openmediavault?

openmediavault is the next generation network attached storage (NAS) solution based on Debian Linux. It contains services like SSH, (S)FTP, SMB/CIFS, DAAP media server, RSync, BitTorrent client and many more. Thanks to the modular design of the framework it can be enhanced via plugins.

openmediavault is primarily designed to be used in small offices or home offices, but is not limited to those scenarios. It is a simple and easy to use out-of-the-box solution that will allow everyone to install and administrate a Network Attached Storage without deeper knowledge.

Download

Features

  • Running out-of-the-box
  • Debian Linux OS
  • Web based administration
  • Easy system updates via Debian package management
  • Volume management
  • S.M.A.R.T.
  • Link aggregation
  • Wake On Lan
  • IPv6 support
  • Email notifications
  • File sharing
  • Extendible via plugins

More features

 

 

 

 

 

 

 

 

樹莓派 3B+ 筦窺︰ 正視過去!

隱約聽著 Mrphs 繼續說道︰這湖心小築裡有六個『學園』 Campus 是為小學堂暑修寒訓之『學習營』而預備。湖心平台上的是『天文 ‧氣象營』,其餘往下數,『科技營』在二十五層,『人文營』位於五十層,『海洋營』居七十五層,『地理營』佔第一百層。其實還有一個『生命館』屬於全體谷民,就設立於入口大廳。這個大廳的格局象個『 田 』田字,分有東南西北四館。其中東西北三館是『水』的三相 ── 水‧溼‧冰 ── 之展示館。這南館最特別,是『模擬』館,內有百座『計算單位』所構成的 It 網『平行運算器』 。所謂一個『計算單位』是由萬台『碼訊』machine 所集成。可以即時動態計算巨量的『非線性』方程式之『數值分析』,用以演示`『光』、『水』、『氣』交互系統之各種現象變化。傳達『生命』可貴的『科技護生』之旨。也是『學園』教與習『理化模型』使用的主機。……

只覺得腦海內哄鳴作響,想到曾以

觀水 ───

宋朝邵康節安樂先生,居地叫做『安樂窩』,著有『皇極經世 』一書,將歷史紀年『卦象化』說能推知數百千年的現象;傳聞又有『梅花心易』一本,專講『見機』起卦之法,其中用著『京房八宮卦』,論斷之準真真神乎其技!!歷史上『科學』雖與『巫術 』有千絲萬縷的關聯,當細思

子不語:怪、力、亂、神。

季路問事鬼神。子曰:未能事人,焉能事鬼?敢問死?曰:末知生 ,焉知死?

;然而【易繫辭】裡卻又有

易與天地準,故能彌綸天地之道。天文地理。是故知幽明之故原始反終故知死生之說。是故君子所者 ,易之序也,所者,爻之辭也。是故觀其象,而玩其辭觀其變玩其占,是以自天佑之吉無不利

這個『死生之說』怎麼說?這是從大自然一年四季的循環,草木的一歲一枯榮,『原始反終』推論而知,絲毫沒有『迷信』的色彩。最後藉著『京房上飛下飛』觀『坎水』之死生之說,以饗讀者︰

京房『心要』︰自初至五不動復,下飛四往伏用飛,上飛下飛復本體,便是十六變卦例。

坎為水
主卦十六變還原︰再下飛二爻
水澤節
一爻變
水雷屯
二爻變
水火既濟
三爻變
澤火革
四爻變
雷火豐
五爻變
地火明夷
遊魂卦不變宗廟,下飛四往
地雷復
外在卦下飛三爻
地澤臨
內在卦下飛二爻
地水師
歸魂卦下飛初爻
坤為地
絕命卦上飛二爻
地山謙
血脈卦上飛三爻
雷山小過
肌肉卦再上飛四爻
澤山咸
骸骨卦再上飛五爻
水山蹇
棺槨卦再下飛四爻
水地比
墓庫卦再下飛三爻

───

之『坎水』之死生之說,寓寫

【Sonic π】電路學之補充《四》無窮小算術‧上

一系列七上八下的文本,實以為『算術』何時成了學習『科學』的障礙!而今看來或許可以用計算機另闢蹊徑乎?不知有了個人超級電腦,再假以『體驗式』的環境,是否人們就能解決

水的生命!!上

金文大篆坎

,田野或道路上的坑陷

説文解字》:坎,陷也。从土,欠聲。

詩經魏風.伐檀

坎坎伐檀兮,寘之河之干兮,
河水清且漣猗。
不稼不穡,胡取禾三百廛兮?
不狩不獵,胡瞻爾庭有縣貆兮?
彼君子兮,不素餐兮!

坎坎伐輻兮,寘之河之側兮,
河水清且直猗。
不稼不穡,胡取禾三百億兮?
不狩不獵,胡瞻爾庭有縣特兮?
彼君子兮,不素食兮!

坎坎伐輪兮,寘之河之漘兮,
河水清且淪猗。
不稼不穡,胡取禾三百囷兮?
不狩不獵,胡瞻爾庭有縣鶉兮?
彼君子兮,不素飧兮!

─── 《勇闖新世界︰ W!O《卡夫卡村》變形祭︰感知自然‧尖端‧五

 

今天是紀念

孔子誕辰日

孔子誕辰日,是中國古代儒家代表人物孔子誕辰的日子,現在設定為農曆八月廿七陽曆9月28日

至聖先師,孔子行教像

各方說法

孔子的誕辰日農曆八月廿七,據說出自孔元措孔氏祖庭廣記》,民國23年(1934年)孔子誕辰日時,柳翼謀張其昀等人主辦的國立中央大學國風》雜誌曾出版〈聖誕特刊〉。民國28年(西元1939年),孔子誕辰日被國民政府確立為法定節日,由於民國政府官方廢止傳統的農曆及春節,故先定於西曆8月27日為孔誕紀念日 。民國41年,改為9月28日,以之為「教師節[1]

然而,江曉原畢寶魁徐文新等人均認為孔子誕辰日的日期是錯誤的,江曉原畢寶魁推算孔子誕生於魯襄公二十一年十月庚子,即儒略曆前552年10月9日[2][3]徐文新也推算孔子誕生於魯襄公二十一年十月庚子,但是轉化為格里曆前552年10月3日[4]

2015年,海昏侯墓出土了一件孔子屏風,第二列文字記載「魯昭公六年,孔子蓋卅矣」,北京聯合大學歷史專家王楚寧據此推算出孔子的生年為魯襄公七年(公元前566年),他也認為這個年份與史籍差異較大[5][6]

 

彷彿見老人家笑呵呵的說︰

未知生!焉知死?

所以

『非生日』日,『不放假』一天◎

別皺眉,

[SOLVED] Crashes with new Raspberry 3B+

Hello cummunity!

Unfortunately I have big troubles with my new Raspberry 3B+ and LibreElec (8.2.4 and also latest 8.2.5):

several crashes/permanent freezes during video playback or other operations like movie library update. I did the 8.2.5 Update

30 min before and sadly no improvements; the bugs are still there! :-(

Any suggestions? (with Raspberry Pi 2 LibreElec was very stable)

Greets leon22

PS: I use a recommended 5.1V/2.5A power supply

PPS: no /storage/.kodi/temp/kodi_crash.log present

Edited once, last by leon22 ().

 

誰弄壞了我的播放器?!

USING KODI ON THE RASPBERRY PI

Kodi is media centre software which runs on Raspberry Pi.

LibreELEC

 

Two Kodi distributions are included in our easy operating system installer NOOBS:LibreELEC and OSMC.

 

以『失敗』為師,能學會『明智』☆

何況秋裝當令正新!?

pi@raspberrypi:~ cat /proc/version  Linux version 4.14.70-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1144 SMP Tue Sep 18 17:34:46 BST 2018 pi@raspberrypi:~

 

 

 

 

 

 

 

 

樹莓派 3B+ 筦窺︰ GigaBit ︰ 300MBit !認識工具‧下

雖說最好一事畢後,再起一事。然而行文筆法,總得依著故事情節以及節奏,就讓我們暫將 RSSI 定向器放下,隨著 W!o^{+} 的腳步繼續趕路吧。

一時只覺或前行、或右迴旋、或左迴旋、九彎十八拐的向著出口走 。突然狂風呼嘯,沙塵滾滾橫亙眼前不遠處。這時感覺 W!o 放慢了步伐,說道︰出口快到,恰遇『無常風』,需要等風沙退後,方可急度『不歸路』,穿越『無影牆』入谷。一段嗚哩哇啦的聲音,盡講些『聽譕』的字詞。或許 W!o 早料著了,接著又講︰出口林子外接著東西向的過道,兩頭皆通大海,若是俯瞰形狀像個『沙漏』。此處最窄,風沙極強,直能將人吹落幾里外的海中。而且東西林徑交接處有兩座『石敢當』,西邊的刻著『 疾 風 』,東邊之上有『 勁 草 』。由於在地原鄉人不識古文,因傷人害命之故,將之稱之為『不歸路』。後來 M♪o 帶著學生在此作『科研調查』時,始解讀了西邊刻的是『疾風』,東邊上的為『勁草』。而且這裡的『徑邊草』,貌似『菰』

不死草

 

卻秋生春死,又嚐之酸苦,不類茭白。雖說《 典 》典裡有︰

《十洲記》:「上有不死之草,草形如菰,苗長三四尺,人已死三日者,以草覆之皆當時活也。服之令人長生。昔秦始皇大苑中,多枉死者橫道,有鳥如烏狀,銜此草覆死人面,當時起坐而自活也。有司聞奏,始皇遣使者齎草以問北郭鬼谷先生。鬼谷先生云:「臣嘗聞東海祖洲上有不死之草,生玉田中,或名為養神芝。其葉似菰 ,苗叢生,一株可活一人。」始皇於是慨然言曰,可採得否?乃使使者徐福,發童男童女五百人,率攝樓船等入海尋祖洲,遂不返。 」

,此草卻無不死之效,難道果有名叫『勁草』之草的耶?後來也許 M♪o 也自覺好笑,既是『生生』,既已『生生』,誰又該管那誰知誰不知曉的呢?不知是因設想那當年之人選址植栽,真有『憂患』乎之思,還是對目下之境『傷感』之意,隨筆也記下了︰

天若有情,天亦老,

北宋‧晏幾道 《鷓鴣天》

其一

彩袖殷勤捧玉鐘。當年拚卻醉顏紅。

舞低楊柳樓心月,歌盡桃花扇底風。

從別后,憶相逢。幾回魂夢與君同。

今宵剩把銀釭照,猶恐相逢是夢中。

其二

醉拍春衫惜舊香。天將離恨惱疏狂。

年年陌上生秋草,日日樓中到夕陽。

云渺渺,水茫茫。征人歸路許多長。

相思本是無憑語,莫向花箋費淚行!

疾風知勁草。

後有好事者得知此事,設法取得 M♪o  筆記抄本將之公開,從此此路有了個大名叫『真情小徑』,當真『疾風配勁草』的哩!!

── 《勇闖新世界︰ W!O《卡夫卡村》變形祭︰ ○ 局 □ 陣【☯】

 

『衝浪』者,追求『疾風』;『行遠』者,愛好『勁草』!

從事『科研』的人,想要清楚其間『關係』嘍?

所以創新『工具』

 

iperf3

The iperf series of tools perform active measurements to determine the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, protocols, and buffers. For each test it reports the measured throughput, loss, and other parameters.

This version, sometimes referred to as iperf3, is a redesign of an original version developed at NLANR / DAST. iperf3 is a new implementation from scratch, with the goal of a smaller, simpler code base, and a library version of the functionality that can be used in other programs. iperf3 also incorporates a number of features found in other tools such as nuttcp and netperf, but were missing from the original iperf. These include, for example, a zero-copy mode and optional JSON output. Note that iperf3 is not backwards compatible with the original iperf.

Primary development for iperf3 takes place on CentOS Linux, FreeBSD, and macOS. At this time, these are the only officially supported platforms, however there have been some reports of success with OpenBSD, Android, and other Linux distributions.

iperf3 is principally developed by ESnet / Lawrence Berkeley National Laboratory. It is released under a three-clause BSD license.

iperf2 is no longer being developed by its original maintainers. However, beginning in 2014, another developer began fixing bugs and enhancing functionality, and generating releases of iperf2. Both projects (as of late 2017) are currently being developed actively, but independently. More information can be found in the iperf3 FAQ.

 

好『度量』呀◎

不知『舊聞』者,何妨『重學』乎??

Invoking iperf3

iperf3 includes a manual page listing all of the command-line options. The manual page is the most up-to-date reference to the various flags and parameters.

For sample command line usage, see:

https://fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/

Using the default options, iperf3 is meant to show typical well designed application performance. “Typical well designed application” means avoiding artificial enhancements that work only for testing (such as splice()-ing the data to /dev/null). iperf3 does also have flags for “extreme best case” optimizations but they must be explicitly activated. These flags include the -Z (--zerocopy) and-A (--affinity) options.

iperf3 Manual Page

This section contains a plaintext rendering of the iperf3 manual page. It is presented here only for convenience; the text here might not correspond to the current version of iperf3. The authoritative iperf3 manual page is included in the source tree and installed along with the executable.

……

iperf2 / iperf3

 iperf is a simple tool to let you measure memory-to-memory performance access a network. iperf3 is a new implementation from scratch, with the goal of a smaller, simpler code base, and a library version of the functionality that can be used in other programs. iperf3 is not backwards compatible with iperf2.x. The most recent iperf3 release is always available for both Debianand RHEL-based systems from the perfSONAR repository. We recommend iperf3 over older versions iperf2 because the TCP retransmit and CWND report is very helpful for troubleshooting. iperf2.0.8 and higher now support this via the ‘-e’ flag.

On public test hosts, we recommend that pScheduler should be used to ensure only one iperf test runs at a time.

A comparison of throughput measurement tools is available here.

The basic commands are the same for iperf2 and iperf3:

SAMPLE IPERF / IPERF3 COMMANDS
Server:
iperf -s / iperf3 -s Start server on the default port
iperf -s -w 32M -D / iperf3 -s -D Start server with larger TCP window, and in daemon mode
iperf -i1 -u -s -p 5003 / iperf3 -s -p 5003 Start UDP server on port 5003, and give 1 sec interval reports. Note that for iperf3 the -u option is passed to the server from the client.
Client
iperf/iperf3 -c remotehost -i 1 -t 30 Run a 30 second tests, giving results every 1 second
iperf/iperf3 -c remotehost -i 1 -t 20 -r Run a test from remotehost to localhost
iperf/iperf3 -c remotehost -i 1 -t 20 -w 32M -P 4 Run a test with 4 parallel streams, and with a 32M TCP buffer
iperf/iperf3 -c remotehost -u -i 1 -b 200M Run a 200 Mbps UDP test

iperf3 adds a number of additional features. For example, the -i mode now reports TCP retransmit info (and is on by default), and the verbose mode now gives a lot of useful information on CPU usage, etc. Other new options include:

NEW IPERF3 COMMANDS
Client:
iperf3 -c remotehost -i.5 -0 2 Run the test for 2 seconds before collecting results, to allow for TCP slowstart to finish. (Omit mode)
iperf3 -Z -c remotehost Use the sendfile() system call for “Zero Copy” mode. This uses much less CPU on older hardware.
iperf3 -c 192.168.12.12 -T s1 & iperf3 -c 192.168.12.13 -T s2 Run tests to multiple interfaces at once, and label the lines to indicate which test is which
iperf3 -c remotehost -J Output the results in JSON format for easy parsing.
iperf3 -A 4,4 -c remotehost Set the CPU affinity for the sender,receiver (cores are numbered from 0). This has the same affect as doing ‘numactl -C 4 iperf3′ on both client and server.
iperf3 -c 10.20.1.20 -A2,2 -T “1” & ; iperf3 -c 10.20.1.20 -p 5400 -A3,3 -T “2” & Run 2 streams on 2 different cores, and label each using the “-T” flag.

iperf3 is normally used to measure memory to memory performance, but you can also use iperf3 for determine if the network or the disk is the bottleneck.

iperf3 thread model

In order to keep the code as simple and maintainable as possible, iperf3 is single threaded. This means that that you may be CPU-bound on some hosts, or on 40G/100G NICs. To run parallel stream iperf3 on multiple cores, use the method shown in the table above. Or use iperf2.

For more information, see the iperf3 FAQ.

 

試著解讀『親身經驗』︰

測試環境︰

GigaBit ethernet switch + CAT5e cable 。

Server︰ RPI 3B+ boot from SD card

pi@raspberrypi:~ iperf3 -s ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 5.168.168.5, port 39354 [  5] local 5.168.168.5 port 5201 connected to 5.168.168.5 port 39356 [ ID] Interval           Transfer     Bandwidth [  5]   0.00-1.00   sec   491 MBytes  4.12 Gbits/sec                   [  5]   1.00-2.00   sec   512 MBytes  4.29 Gbits/sec                   [  5]   2.00-3.00   sec   514 MBytes  4.31 Gbits/sec                   [  5]   3.00-4.00   sec   511 MBytes  4.29 Gbits/sec                   [  5]   4.00-5.00   sec   519 MBytes  4.36 Gbits/sec                   [  5]   5.00-6.00   sec   526 MBytes  4.41 Gbits/sec                   [  5]   6.00-7.00   sec   544 MBytes  4.56 Gbits/sec                   [  5]   7.00-8.00   sec   528 MBytes  4.43 Gbits/sec                   [  5]   8.00-9.00   sec   530 MBytes  4.45 Gbits/sec                   [  5]   9.00-10.00  sec   528 MBytes  4.43 Gbits/sec                   [  5]  10.00-10.02  sec  10.5 MBytes  4.16 Gbits/sec                   - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval           Transfer     Bandwidth [  5]   0.00-10.02  sec  0.00 Bytes  0.00 bits/sec                  sender [  5]   0.00-10.02  sec  5.09 GBytes  4.36 Gbits/sec                  receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 5.168.168.6, port 58986 [  5] local 5.168.168.5 port 5201 connected to 5.168.168.6 port 58988 [ ID] Interval           Transfer     Bandwidth [  5]   0.00-1.00   sec  26.8 MBytes   225 Mbits/sec                   [  5]   1.00-2.00   sec  26.0 MBytes   218 Mbits/sec                   [  5]   2.00-3.00   sec  26.1 MBytes   219 Mbits/sec                   [  5]   3.00-4.00   sec  27.5 MBytes   230 Mbits/sec                   [  5]   4.00-5.00   sec  26.7 MBytes   224 Mbits/sec                   [  5]   5.00-6.00   sec  26.5 MBytes   223 Mbits/sec                   [  5]   6.00-7.00   sec  27.6 MBytes   231 Mbits/sec                   [  5]   7.00-8.00   sec  27.5 MBytes   231 Mbits/sec                   [  5]   8.00-9.00   sec  26.5 MBytes   223 Mbits/sec                   [  5]   9.00-10.00  sec  26.8 MBytes   225 Mbits/sec                   [  5]  10.00-10.04  sec   735 KBytes   160 Mbits/sec                   - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval           Transfer     Bandwidth [  5]   0.00-10.04  sec  0.00 Bytes  0.00 bits/sec                  sender [  5]   0.00-10.04  sec   269 MBytes   225 Mbits/sec                  receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 5.168.168.17, port 40102 [  5] local 5.168.168.5 port 5201 connected to 5.168.168.17 port 40104 [ ID] Interval           Transfer     Bandwidth [  5]   0.00-1.00   sec  11.0 MBytes  92.0 Mbits/sec                   [  5]   1.00-2.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   2.00-3.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   3.00-4.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   4.00-5.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   5.00-6.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   6.00-7.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   7.00-8.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   8.00-9.00   sec  11.2 MBytes  94.1 Mbits/sec                   [  5]   9.00-10.00  sec  11.2 MBytes  94.1 Mbits/sec                   [  5]  10.00-10.02  sec   272 KBytes  93.6 Mbits/sec                   - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval           Transfer     Bandwidth [  5]   0.00-10.02  sec  0.00 Bytes  0.00 bits/sec                  sender [  5]   0.00-10.02  sec   112 MBytes  93.9 Mbits/sec                  receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- </pre>    <span style="color: #008080;">‧ Local loopback</span> <pre class="lang:default decode:true">pi@raspberrypi:~ iperf3 -c 5.168.168.5 -V
iperf 3.1.3
Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l
Time: Sat, 22 Sep 2018 08:30:57 GMT
Connecting to host 5.168.168.5, port 5201
      Cookie: raspberrypi.1537605057.293666.36e2d1
      TCP MSS: 21888 (default)
[  4] local 5.168.168.5 port 39356 connected to 5.168.168.5 port 5201
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 10 second test
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec   510 MBytes  4.27 Gbits/sec    0   1.19 MBytes       
[  4]   1.00-2.00   sec   511 MBytes  4.29 Gbits/sec    0   1.19 MBytes       
[  4]   2.00-3.00   sec   514 MBytes  4.31 Gbits/sec    0   1.19 MBytes       
[  4]   3.00-4.00   sec   512 MBytes  4.29 Gbits/sec    0   1.19 MBytes       
[  4]   4.00-5.00   sec   519 MBytes  4.35 Gbits/sec    0   1.19 MBytes       
[  4]   5.00-6.00   sec   525 MBytes  4.41 Gbits/sec    0   1.19 MBytes       
[  4]   6.00-7.00   sec   544 MBytes  4.56 Gbits/sec    0   1.19 MBytes       
[  4]   7.00-8.00   sec   529 MBytes  4.43 Gbits/sec    0   1.19 MBytes       
[  4]   8.00-9.00   sec   530 MBytes  4.45 Gbits/sec    0   1.19 MBytes       
[  4]   9.00-10.00  sec   528 MBytes  4.43 Gbits/sec    0   1.19 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec  5.10 GBytes  4.38 Gbits/sec    0             sender
[  4]   0.00-10.00  sec  5.09 GBytes  4.37 Gbits/sec                  receiver
CPU Utilization: local/sender 81.2% (1.6%u/79.7%s), remote/receiver 65.8% (1.9%u/63.9%s)

iperf Done.
pi@raspberrypi:~ </pre>    <span style="color: #008080;">‧ Connected by RPI 3B+ boot from USB flash drive</span> <pre class="lang:default decode:true">pi@raspberrypi:~ iperf3 -c 5.168.168.5 -V
iperf 3.1.3
Linux raspberrypi 4.14.70-v7+ #1144 SMP Tue Sep 18 17:34:46 BST 2018 armv7l
Time: Sat, 22 Sep 2018 08:31:15 GMT
Connecting to host 5.168.168.5, port 5201
      Cookie: raspberrypi.1537605075.760197.69cb49
      TCP MSS: 1448 (default)
[  4] local 5.168.168.6 port 58988 connected to 5.168.168.5 port 5201
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 10 second test
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  29.2 MBytes   245 Mbits/sec    0    604 KBytes       
[  4]   1.00-2.00   sec  26.2 MBytes   219 Mbits/sec    0    635 KBytes       
[  4]   2.00-3.00   sec  26.1 MBytes   219 Mbits/sec    0    635 KBytes       
[  4]   3.00-4.02   sec  27.5 MBytes   226 Mbits/sec    0    635 KBytes       
[  4]   4.02-5.00   sec  26.7 MBytes   228 Mbits/sec    0    635 KBytes       
[  4]   5.00-6.00   sec  26.6 MBytes   223 Mbits/sec    0    666 KBytes       
[  4]   6.00-7.00   sec  27.1 MBytes   227 Mbits/sec    0    666 KBytes       
[  4]   7.00-8.00   sec  28.0 MBytes   235 Mbits/sec    0    666 KBytes       
[  4]   8.00-9.00   sec  26.5 MBytes   223 Mbits/sec    0    666 KBytes       
[  4]   9.00-10.00  sec  26.5 MBytes   222 Mbits/sec    0    666 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   270 MBytes   227 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   269 MBytes   225 Mbits/sec                  receiver
CPU Utilization: local/sender 5.4% (0.6%u/4.8%s), remote/receiver 9.7% (0.6%u/9.1%s)

iperf Done.
pi@raspberrypi:~ </pre>    <span style="color: #008080;">‧ Connected by RPI 3B boot from SD card</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ iperf3 -c 5.168.168.5 -V
iperf 3.1.3
Linux raspberrypi 4.14.69-v7+ #1141 SMP Mon Sep 10 15:26:29 BST 2018 armv7l
Time: Sat, 22 Sep 2018 08:31:52 GMT
Connecting to host 5.168.168.5, port 5201
      Cookie: raspberrypi.1537605096.310941.3ebcea
      TCP MSS: 1448 (default)
[  4] local 5.168.168.17 port 40104 connected to 5.168.168.5 port 5201
Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 10 second test
[ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
[  4]   0.00-1.00   sec  11.3 MBytes  94.5 Mbits/sec    0   36.8 KBytes       
[  4]   1.00-2.00   sec  11.2 MBytes  94.1 Mbits/sec    0   39.6 KBytes       
[  4]   2.00-3.00   sec  11.2 MBytes  94.1 Mbits/sec    0   41.0 KBytes       
[  4]   3.00-4.00   sec  11.2 MBytes  94.3 Mbits/sec    0   50.9 KBytes       
[  4]   4.00-5.00   sec  11.3 MBytes  94.6 Mbits/sec    0   76.4 KBytes       
[  4]   5.00-6.00   sec  11.2 MBytes  94.1 Mbits/sec    0   76.4 KBytes       
[  4]   6.00-7.00   sec  11.2 MBytes  94.1 Mbits/sec    0   76.4 KBytes       
[  4]   7.00-8.00   sec  11.2 MBytes  94.1 Mbits/sec    0   76.4 KBytes       
[  4]   8.00-9.00   sec  11.2 MBytes  94.2 Mbits/sec    0   76.4 KBytes       
[  4]   9.00-10.00  sec  11.2 MBytes  94.1 Mbits/sec    0   76.4 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-10.00  sec   112 MBytes  94.2 Mbits/sec    0             sender
[  4]   0.00-10.00  sec   112 MBytes  94.1 Mbits/sec                  receiver
CPU Utilization: local/sender 4.9% (0.4%u/4.5%s), remote/receiver 6.5% (0.7%u/5.9%s)

iperf Done.
pi@raspberrypi:~ $ 

 

自己定奪哩!!

或可更上一層樓呦☆

iperf3 python wrapper

Release v0.1.10.

iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. More information on the iPerf3 utility can be found on their official website

The python iperf3 module is a wrapper around the iperf3 utility. It utilises the API libiperf that comes with the default installation. It allows you to interact with the utility in a nice and pythonic way.

warning This module is not compatible with the original iperf/iperf2 utility which is no longer under active development

※ 安裝︰

sudo pip3 install iperf3

 

 

 

 

 

 

 

 

樹莓派 3B+ 筦窺︰ GigaBit ︰ 300MBit !認識工具‧上

派生碼訊

子 鼠

最高樓‧杜甫

城尖徑厭施篩愁,獨立縹緲之飛樓。
峽坼雲霾龍虎臥,江清日抱黿鼉游。
扶桑西枝對斷石,弱水東影隨長流。
杖藜嘆世者誰子?泣血迸空回白頭。

︰老杜倡議拗體詩,誰知拗得拗不得?

今天小企鵝學堂上,吵吵鬧鬧,此時那些小企鵝們正憤愾的議論著禮拜天還『補課』之事的呢 !!

有的主張︰既然是天放假,幹嘛要補課。

有的辯證︰就算今天不補,改天補還不是一樣?

有的議論︰早補早了,有什麼好議論的!!

有的搞笑︰『始』安息日,『終』禮拜天!不就一天嗎??

那你可有說法?

哦!我唱ㄏㄡˇ你ㄗㄞ︰今天不只要補課,……

而且ㄍㄡˋ要實習,但是用的是『咸澤碼訊』

‧高級的

‧沒學過的

‧ㄍㄚˋ伊講不通的

唔是□派○生的呦!!

啞是甲意喝一杯咖啡??

BabyTux

graphics-tux-638974

sonictux

starbucks_tux_linux_art-555px

─── 摘自《M♪o 之學習筆記本《子》開關︰【䷝】狀態編碼

 

補課不易加課難,惟因學堂不好玩。

授業解惑苦失傳,道鎖高樓難復還。

讀書原是本家事,學問方田自耕耘。

─── 《神經網絡【學而堯曰】十

 

欲上最高樓者,焉能不知『登高必自卑,行遠必自邇』之理︰

禮記‧中庸

子曰:射有似乎君子,失諸正鵠,反求諸其身。君子之道,辟如行遠必自邇,辟如登高必自卑。《詩》曰:『妻子好合,如鼓瑟琴;兄弟既翕,和樂且耽。宜爾室家,樂爾妻帑。』 子曰:父母其順矣乎!

─ 《【鼎革‧革鼎】︰ RASPBIAN STRETCH 《六之 K.2-SD.I 》

 

『科技』畢竟非『詩詞』,豈用『拗』?

近日聽聞樹莓派工程師說︰

Re: PoE HAT – USB Ports not working – over-current

  • jamesh
    Raspberry Pi Engineer & Forum Moderator
    Raspberry Pi Engineer & Forum Moderator

Wed Sep 19, 2018 8:59 am

leol wrote:

Tue Sep 18, 2018 3:16 pm

Any news on the promised blog?

We are still investigating the issue – it seems to be a lot more complicated that first thought and we want to make sure we have a decent handle on the situation. We’ve put a hold on sales for the moment, and we are geting some returned here which show up a particular issue we want to get to the bottom of.

 

問題解決前, PoE HAT 暫停銷售!

難到不是之『最高樓』者,所應為乎?故樂於按讚呦!

一位善長『實務』的人,能不善用『工具』耶?!

倘伊止於聲聞,果可得門徑嘛!?

Linux Foundation Wiki

project collaboration site

Trace: net-tools

Overview

A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system. This package includes arp(8), hostname(1), ifconfig(8), ipmaddr, iptunnel, mii-tool(8), nameif(8), netstat(8), plipconfig(8), rarp(8), route(8) and slattach(8).

Please keep in mind that most net-tools programs are obsolete now:

PROGRAM OBSOLETED BY
arp ip neigh
ifconfig ip addr
ipmaddr ip maddr
iptunnel ip tunnel
route ip route
nameif ifrename
mii-tool ethtool

You would probably want to review iproute2 page. See also net-tools future thread.

 

『術』即使早學,有時望洋興嘆哩!★

與時並進者,若陷於

ethtool

ethtool is a utility for Linux kernel-based operating system for displaying and modifying some parameters of network interface controllers (NICs) and their device drivers. ethtool is developed parallel to the Linux kernel.

Usage

The command is useful for

  • Identification and diagnosis of Ethernet devices
  • Extended Ethernet devices statistics
  • Control speed, duplex, auto-negotiation and flow control for Ethernet devices
  • Control checksum offload and other hardware offload features
  • Control DMA ring sizes and interrupt moderation
  • Control receive queue selection for multiqueue devices
  • Upgrade firmware in flash memory

 

手冊

pi@raspberrypi:~ <a style="color: #ff9900;" href="https://linux.die.net/man/8/ethtool">man ethtool</a></span>  <span style="color: #666699;">言簡意賅之大部頭命令裡,實不如</span>  <span style="color: #666699;">隨興而動,自得其樂也?☆</span>  <span style="color: #666699;">就像當『曾行』之事,眼前『水窮處』☻</span> <pre class="lang:default decode:true ">pi@raspberrypi:~ ethtool -p eth0 5
Cannot identify NIC: Operation not permitted
pi@raspberrypi:~ $
 

正好探其原『認識』勒☺

ethtool – utility for controlling network drivers and hardware

Introduction

ethtool is the standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. It can be used to:

  • Get identification and diagnostic information
  • Get extended device statistics
  • Control speed, duplex, autonegotiation and flow control for Ethernet devices
  • Control checksum offload and other hardware offload features
  • Control DMA ring sizes and interrupt moderation
  • Control receive queue selection for multiqueue devices
  • Upgrade firmware in flash memory

Most features are dependent on support in the specific driver. See the manual page for full information.

 

ethtool-4.18.tar.xz

/*
* ethtool.c: Linux ethernet device configuration tool.
*
* Copyright (C) 1998 David S. Miller (davem@dm.cobaltmicro.com)
* Portions Copyright 2001 Sun Microsystems
* Kernel 2.4 update Copyright 2001 Jeff Garzik <jgarzik@mandrakesoft.com>
* Wake-on-LAN,natsemi,misc support by Tim Hockin <thockin@sun.com>
* Portions Copyright 2002 Intel
* Portions Copyright (C) Sun Microsystems 2008
* do_test support by Eli Kupermann <eli.kupermann@intel.com>
* ETHTOOL_PHYS_ID support by Chris Leech <christopher.leech@intel.com>
* e1000 support by Scott Feldman <scott.feldman@intel.com>
* e100 support by Wen Tao <wen-hwa.tao@intel.com>
* ixgb support by Nicholas Nunley <Nicholas.d.nunley@intel.com>
* amd8111e support by Reeja John <reeja.john@amd.com>
* long arguments by Andi Kleen.
* SMSC LAN911x support by Steve Glendinning <steve.glendinning@smsc.com>
* Rx Network Flow Control configuration support <santwona.behera@sun.com>
* Various features by Ben Hutchings <bhutchings@solarflare.com>;
* Copyright 2009, 2010 Solarflare Communications
* MDI-X set support by Jesse Brandeburg <jesse.brandeburg@intel.com>
* Copyright 2012 Intel Corporation
* vmxnet3 support by Shrikrishna Khare <skhare@vmware.com>
* Various features by Ben Hutchings <ben@decadent.org.uk>;
* Copyright 2008-2010, 2013-2016 Ben Hutchings
* QSFP+/QSFP28 DOM support by Vidya Sagar Ravipati <vidya@cumulusnetworks.com>
*
* TODO:
* * show settings for all devices
*/

 

static int do_phys_id(struct cmd_context *ctx)
{
	int err;
	struct ethtool_value edata;
	int phys_id_time;

	if (ctx->argc > 1)
		exit_bad_args();
	if (ctx->argc == 1)
		phys_id_time = get_int(*ctx->argp, 0);
	else
		phys_id_time = 0;

	edata.cmd = ETHTOOL_PHYS_ID;
	edata.data = phys_id_time;
	err = send_ioctl(ctx, &edata);
	if (err < 0)
		perror("Cannot identify NIC");

	return err;
}

 

……

linux/net/core/ethtool.c

/*
* net/core/ethtool.c – Ethtool ioctl handler
* Copyright (c) 2003 Matthew Wilcox <matthew@wil.cx>
*
* This file is where we call all the ethtool_ops commands to get
* the information ethtool needs.
*
* 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 2 of the License, or
* (at your option) any later version.
*/

 

static int ethtool_phys_id(struct net_device *dev, void __user *useraddr)
{
	struct ethtool_value id;
	static bool busy;
	const struct ethtool_ops *ops = dev->ethtool_ops;
	int rc;

	if (!ops->set_phys_id)
		return -EOPNOTSUPP;

	if (busy)
		return -EBUSY;

	if (copy_from_user(&id, useraddr, sizeof(id)))
		return -EFAULT;

	rc = ops->set_phys_id(dev, ETHTOOL_ID_ACTIVE);
	if (rc < 0)
		return rc;

	/* Drop the RTNL lock while waiting, but prevent reentry or
	 * removal of the device.
	 */
	busy = true;
	dev_hold(dev);
	rtnl_unlock();

	if (rc == 0) {
		/* Driver will handle this itself */
		schedule_timeout_interruptible(
			id.data ? (id.data * HZ) : MAX_SCHEDULE_TIMEOUT);
	} else {
		/* Driver expects to be called at twice the frequency in rc */
		int n = rc * 2, i, interval = HZ / n;

		/* Count down seconds */
		do {
			/* Count down iterations per second */
			i = n;
			do {
				rtnl_lock();
				rc = ops->set_phys_id(dev,
				    (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
				rtnl_unlock();
				if (rc)
					break;
				schedule_timeout_interruptible(interval);
			} while (!signal_pending(current) && --i != 0);
		} while (!signal_pending(current) &&
			 (id.data == 0 || --id.data != 0));
	}

	rtnl_lock();
	dev_put(dev);
	busy = false;

	(void) ops->set_phys_id(dev, ETHTOOL_ID_INACTIVE);
	return rc;
}