2021年7月29日 星期四

[RPi] Pi 3 網路設定維修

最近拿到一片 Pi 3 網路有問題。設定 static ip 可以,但 dhcp 不行。

看到 ethtool 這指令,搭配這篇文章試了一下,原理可以參考這裡

原本的設定

$ sudo ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: pumbag
    Wake-on: d
    Current message level: 0x00000007 (7)
                   drv probe link
    Link detected: yes
    
$ ifconfig eth0
eth0: flags=4163  mtu 1500

改成 speed 10 之後,竟然可以 dhcp 了~

$ sudo ethtool -s eth0 autoneg on speed 10 duplex full
測試結果
$ sudo ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full 
	                        100baseT/Half 100baseT/Full 
	Supported pause frame use: No
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Full 
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Link partner advertised link modes:  10baseT/Full 
	Link partner advertised pause frame use: Symmetric Receive-only
	Link partner advertised auto-negotiation: Yes
	Link partner advertised FEC modes: Not reported
	Speed: 10Mb/s
	Duplex: Full
	Port: MII
	PHYAD: 1
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbag
	Wake-on: d
	Current message level: 0x00000007 (7)
			       drv probe link
	Link detected: yes

$ ifconfig eth0
eth0: flags=4163  mtu 1500
        inet 192.168.1.129  netmask 255.255.255.0  broadcast 192.168.1.255
...
將 eth0 重新設定
$ sudo ethtool -r eth0

2021年7月23日 星期五

[Wordpress] WP Offload Media plugin

之前用 WP Offload Media Lite plugin 蠻開心的,但移機發現竟然產品的 url 沒有跟著匯出。 

有發現一篇可能可以解決的方法,但有點麻煩而且怕不小心誤砍了資料庫就更糟糕了。

 最後還是花錢升級成 pro,有一個功能會將移過去的圖片上傳到 S3。

不知道還有沒有其他解決方法? 看來要等人 support 了