mieki256's diary



2024/06/12(水) [n年前の日記]

#1 [digital] 無線LAN関係を再設定中

_昨日、 無線LANルータを交換したので、各機器の無線LANを再設定中。

Lenovo IdeaPad Tablet A1 はバッテリーが切れていたので充電してみたのだけど、100%になるまで半日近くかかった。でもまあ、一応充電できたし、無線LANの設定もできた。ただ、Android 2.3機なので、色々なアプリが動かず…。Googleカレンダーとの同期ができない、と必ずエラーが表示されるし…。使い道も思いつかない…。

Raspbery Pi3 も発掘して再設定。これはメンテナンス作業が大変だったので別記事でメモしておく。

#2 [raspberrypi] Raspberry Pi3のメンテナンス作業をした

無線LANルータが、Aterm WR8300N から Aterm WG1200HS4 に置き換わったので、Raspberry Pi3 の無線LAN設定も変更しないといけない。久々に電源を入れて、メンテナンス作業をした。

sudo apt update が通らない :

sudo apt update が通らない。エラーが出る。Raspberry Pi3 には raspbian stretch をインストールしてあったけれど、古いバージョンのOSだから、パッケージ更新サイトのURLが既に消滅していた。

_Raspbian Stretch apt server gone? - Raspberry Pi Forums
_legacy materials moving from archive.raspbian.org to legacy.raspbian.org - Raspberry Pi Forums

URL を書き換える。/etc/apt/sources.list に以下を追加。
deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi

nano というテキストエディタが入っているだろうから、sudo nano /etc/apt/sources.list を実行すれば編集できる。

以下のような内容になった。
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
#deb http://ftp.jaist.ac.jp/raspbian/ stretch main contrib non-free rpi
#deb http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian/ stretch main contrib non-free rpi
deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi

DHCPが自動取得になってなかった :

Raspberry Pi3側で、Aterm WG1200HS4 のSSIDを選んで、キーを入力して、無線LAN接続できるようにはなったけれど、割り当てられたIPアドレスが、昔のIPアドレスになっている。

どうやら、昔の自分は、固定IPアドレスになるようにわざわざ設定してたらしい。

DHCP については、/etc/dhcpcd.conf で設定変更できる。

今までの内容は以下。
...

# Example static IP configuration:
#interface eth0
interface wlan0
static ip_address=192.168.1.27/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

noipv6rs
noipv6

以下のように書き換え。

...

# Example static IP configuration:
#interface eth0
#interface wlan0
#static ip_address=192.168.1.27/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1 8.8.8.8

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0

#noipv6rs
#noipv6

自動起動スクリプトを無効化しておいた :

これはウチの環境固有の話。モータ関係を制御するためプログラムをOS起動時に呼び出していたけれど、もうその手の実験はしばらくやらないだろうから、無効化しておいた。

/etc/rc.local を編集。
$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

# RTC
/sbin/hwclock --hctosys

# python /home/mieki256/prg/gpio/digicame_daemon.py &

#sleep 10
#/usr/sbin/ntpdate -b ntp.nict.jp && /sbin/hwclock --systohc

exit 0

以下の行をコメントアウトしておいた。
python /home/mieki256/prg/gpio/digicame_daemon.py &

stretchからbusterにアップグレード :

raspbian stretch (Debian 9ベース)から、raspbian buster (Debian 10ベース)にアップグレードしようと試みた。Debian stretch は、既にサポート期間が終了しているので。

まあ、Debian 10 buster も 2024/06 でサポート期間が切れるらしいのだけど…。現行バージョンは Debian 12 bookworm らしい…。

以下のページに従って作業。

_いるかのボックス: Raspberry Pi OSをStretchからBusterにアップグレードする

/etc/apt/sources.list と /etc/apt/sources.list.d/raspi.list の中の、stretch を buster に変更。
$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
#deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
#deb http://ftp.jaist.ac.jp/raspbian/ stretch main contrib non-free rpi
#deb http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian/ stretch main contrib non-free rpi
#deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi
$ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ buster main ui
#deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui

aptで更新。
sudo apt autoremove -y
sudo apt autoclean
sudo apt update
sudo apt dist-upgrade -y -d
sudo apt dist-upgrade -y

最初は容量が足りないと言われたけれど、sudo apt autoclean でキャッシュを消去してから試してみたら容量不足と言われなくなった。

1400ファイル以上を更新すると言ってきた。明日までかかりそうな気配。空き容量、大丈夫かな…。

※ 2024/06/13追記。途中で問題発生。アップグレードに失敗した。Raspberry Pi OS Desktop bookworm (Debian 12ベース)をクリーンインストールすることにした。

以上、1 日分です。

過去ログ表示

Prev - 2024/06 - Next
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30

カテゴリで表示

検索機能は Namazu for hns で提供されています。(詳細指定/ヘルプ


注意: 現在使用の日記自動生成システムは Version 2.19.6 です。
公開されている日記自動生成システムは Version 2.19.5 です。

Powered by hns-2.19.6, HyperNikkiSystem Project