2020年9月29日火曜日

Boot Raspberry Pi 4 from USB (headless) 32 bit ver.

 正式にリリースされたか否か判りませんが、Raspberry Pi 4 の USB deviceからの

 bootを試してみました。

とりあえずbootしましたね。

#USB-C電源問題で話題になった初期の残念な1.1ボードなんですがね。。。

Hardware        : BCM2711
Revision        : c03111
Serial          : 
Model           : Raspberry Pi 4 Model B Rev 1.1


[やった事]

#apt update

#apt upgrade

#raspi-configコマンドで、

  B4 Boot Orderの方でUSB起動する設定

    B1 USB Boot  Boot from USB device if SD card fails   を選択

  B5 Boot ROM Version

   E1 Latest   Use the latest version boot ROM software を選択

再起動

以下コマンドで、USBデバイスにコピー

#rpi-clone -f -p 256M sda

SDカード抜いて、USBデバイスで起動

[設定(されてる)情報]

uname -a

Linux raspi4 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux

# vcgencmd bootloader_version

 Sep  3 2020 13:11:43

 version c305221a6d7e532693cc7ff57fddfc8649def167 (release)

 timestamp 1599135103

# cat /etc/default/rpi-eeprom-update

 FIRMWARE_RELEASE_STATUS="stable"

# cat /etc/os-release

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"

NAME="Raspbian GNU/Linux"

VERSION_ID="10"

VERSION="10 (buster)"

VERSION_CODENAME=buster

ID=raspbian

ID_LIKE=debian

HOME_URL="http://www.raspbian.org/"

SUPPORT_URL="http://www.raspbian.org/RaspbianForums"

BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

root@raspi4:~# vcgencmd bootloader_version

Sep  3 2020 13:11:43

version c305221a6d7e532693cc7ff57fddfc8649def167 (release)

timestamp 1599135103

# vcgencmd bootloader_config

[all]

BOOT_UART=0

WAKE_ON_GPIO=1

POWER_OFF_ON_HALT=0

DHCP_TIMEOUT=45000

DHCP_REQ_TIMEOUT=4000

TFTP_FILE_TIMEOUT=30000

ENABLE_SELF_UPDATE=1

DISABLE_HDMI=0

BOOT_ORDER=0xf41


#df -h

ファイルシス   サイズ  使用  残り 使用% マウント位置

/dev/root        3.4G  2.3G  1.1G   69% /

devtmpfs         1.9G     0  1.9G    0% /dev

tmpfs            1.9G     0  1.9G    0% /dev/shm

tmpfs            1.9G  8.4M  1.9G    1% /run

tmpfs            5.0M  4.0K  5.0M    1% /run/lock

tmpfs            1.9G     0  1.9G    0% /sys/fs/cgroup

/dev/sda1        253M   54M  199M   22% /boot

tmpfs            388M     0  388M    0% /run/user/0





2020年3月31日火曜日

rpi-clone 4 Rasbian Buster option

最近知りました。
これで、Busterへのupgradeが楽になった。

The examples below show a /boot partition smaller than recommended for the recent Rasbian Buster release.
rpi-clone version 2.0.21 adds the -p option so the /boot partition can be resized at the same time
the root partition is resized to the end of the disk.
If you upgraded Stretch to Buster and are running with a small /boot,
then for the clone to have a resized /boot, run:

$ rpi-clone -f -p 256M sda

2020年3月26日木曜日

Show weather reports Controlling MAX7219 8x8 Matrix LED with Raspberry Pi

MAX7219 制御の8x8 Matrix LEDに天気情報を流すPython scriptです。


[MAX7219_matrix_weather3.py]

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time
import argparse

from luma.led_matrix.device import max7219
from luma.core.interface.serial import spi, noop


import local_weather
import img_gen2


def text_get():

   text=local_weather.get_weather()
   return text

def main(n, block_orientation, rotate, inreverse):
    # create matrix device
    serial = spi(port=0, device=0, gpio=noop())
    device = max7219(serial, cascaded=n or 1, block_orientation=block_orientation,
                     rotate=rotate or 0, blocks_arranged_in_reverse_order=inreverse)

    text=text_get()
    image_list = img_gen2.text_img_gen(n, text)
    max_images = len(image_list)
    while True:
      for i in range(0, max_images):
         device.display(image_list[i].convert(device.mode))
         time.sleep(0.1)
#         time.sleep(0.5)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='matrix_demo arguments',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument('--cascaded', '-n', type=int, default=4, help='Number of cascaded MAX7219 LED matrices')
#    parser.add_argument('--block-orientation', type=int, default=0, choices=[0, 90, -90], help='Corrects block orientation when wired vertically')
    parser.add_argument('--block-orientation', type=int, default=-90, choices=[0, 90, -90], help='Corrects block orientation when wired vertically')
#    parser.add_argument('--rotate', type=int, default=0, choices=[0, 1, 2, 3], help='Rotate display 0=0°, 1=90°, 2=180°, 3=270°')
    parser.add_argument('--rotate', type=int, default=2, choices=[0, 1, 2, 3], help='Rotate display 0=0°, 1=90°, 2=180°, 3=270°')
    parser.add_argument('--reverse-order', type=bool, default=False, help='Set to true if blocks are in reverse order')

    args = parser.parse_args()

    try:
        main(args.cascaded, args.block_orientation, args.rotate, args.reverse_order)
    except KeyboardInterrupt:
        pass
        
        

[img_gen2.py]

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

_WIDTH=8

def text_img_gen(n, text):

    text_len=len(text)
    image = Image.new('1', (text_len*8, 8))
    draw  = ImageDraw.Draw(image)
    font  = ImageFont.truetype("/home/pi/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')
    draw.text((0,0), text, font=font, fill=255)

    image_list = horizontal_scroll(n, image)
    return image_list

def horizontal_scroll(n, image, padding=True):

        image_list = list()
        width = image.size[0]
        w, hight = image.size

        # Scroll into the blank image.
        if padding:
            for x in range(n*_WIDTH):
                section = image.crop((0, 0, x, hight))
                display_section = create_blank_image(n, hight)
                display_section.paste(section, (_WIDTH*n - x, 0, _WIDTH*n, hight))
                image_list.append(display_section)

        #Scroll across the input image.
        for x in range(8*n, width + 1):
            section = image.crop((x - _WIDTH*n, 0, x, hight))
            display_section = create_blank_image(n, hight)
            display_section.paste(section, (0, 0, _WIDTH*n, hight))
            image_list.append(display_section)

        #Scroll out, leaving the blank image.
        if padding:
            for x in range(width - (_WIDTH*n-1), width + 1):
                section = image.crop((x, 0, width, hight))
                display_section = create_blank_image(n, hight)
                display_section.paste(section, (0, 0, ((_WIDTH*n)-1) - (x - (width - ((_WIDTH*n)-1))), hight))
                image_list.append(display_section)

        #Return the list of images created
        return image_list

def create_blank_image(n, hight):
      return Image.new("RGB", (_WIDTH*n, hight))
      
      


[local_weather.py]

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import re
import json
import requests

#import sys
#sys.dont_write_bytecode = True

def get_weather():
#  url = 'http://weather.livedoor.com/forecast/webservice/json/v1'
  url = 'https://weather.tsukumijima.net/api/forecast'    ### 2021/2/21 update
  # 東京のcityタグのid
  payload = {'city': '130010'}
  # 天気情報をjsonで取得
  try:
     data = requests.get(url, params = payload).json()
  except Exception as e:
#     return e
     return '天気情報がありません'


  # 天気情報をedit
  rt=''
  max_len=len(data['forecasts'])
# 今日、明日、(明後日)の情報
  for forecast in data['forecasts']:
     rt+=('{0} ({1}) '.format(forecast['date'], forecast['dateLabel']))
     rt+=(' {} '.format(forecast['telop']))
     if forecast['temperature'].get('max') is not None:
        rt+= ('最高気温 {}℃  '.format(forecast['temperature']['max']['celsius']))
        rt+= ('最高湿度 {}% '.format(forecast['temperature']['max']['fahrenheit']))
     if forecast['temperature'].get('min') is not None:
        rt+= (' 最低気温 {}℃  '.format(forecast['temperature']['min']['celsius']))
        rt+= (' 最低湿度 {}% '.format(forecast['temperature']['min']['fahrenheit']))
     rt += ('{}の天気は、{}でしょう '.format(forecast['dateLabel'], forecast['telop']))

  rt+=('以降が{}の天気概況 '.format(data['location']['city']))
  rt+=(' ' + data['description']['text'])
  rt=re.sub(r'\n|。|、', "", rt)
  return rt

if __name__ == '__main__':
   rt=get_weather()
   print(rt)

2020年2月23日日曜日

Using 8x8 Dot Matrix LED with Raspberry Pi & Cascade Connection


MAX7219 Arduino用ドットマトリクスモジュール4-in-1ディスプレイ5pinライン 

てのを衝動買いしてしまったので、Raspberry Piで試してみました。




























3.3Vで動きましたね

配線
MAX7219 Pin Name Remarks RPi Pin RPi Function
1 VCC +5V Power      1 3.3V
2 GND Ground             6 GND
3 DIN Data In            19 GPIO 10 (MOSI)
4 CS Chip Select        24 GPIO 8 (SPI CE0)
5 CLK Clock             23 GPIO 11 (SPI CLK)


ライブラリは以下のを使用させて頂きました。

https://github.com/rm-hull/luma.led_matrix




# git clone https://github.com/rm-hull/max7219.git
# cd max7219
# python3 setup.py install


[sample script]

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time
import argparse

from luma.led_matrix.device import max7219
from luma.core.interface.serial import spi, noop


from PIL import ImageFont
font  = ImageFont.truetype("/home/pi/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

_WIDTH=8

def horizontal_scroll(n, image, padding=True):

        image_list = list()
        width = image.size[0]
        w, hight = image.size

        # Scroll into the blank image.
        if padding:
            for x in range(n*_WIDTH):
                section = image.crop((0, 0, x, hight))
                display_section = create_blank_image(n, hight)
                display_section.paste(section, (_WIDTH*n - x, 0, _WIDTH*n, hight))
                image_list.append(display_section)

        #Scroll across the input image.
        for x in range(8*n, width + 1):
            section = image.crop((x - _WIDTH*n, 0, x, hight))
            display_section = create_blank_image(n, hight)
            display_section.paste(section, (0, 0, _WIDTH*n, hight))
            image_list.append(display_section)

        #Scroll out, leaving the blank image.
        if padding:
            for x in range(width - (_WIDTH*n-1), width + 1):
                section = image.crop((x, 0, width, hight))
                display_section = create_blank_image(n, hight)
                display_section.paste(section, (0, 0, ((8*n)-1) - (x - (width - ((8*n)-1))), hight))
                image_list.append(display_section)

        #Return the list of images created
        return image_list

def create_blank_image(n, hight):
      return Image.new("RGB", (_WIDTH*n, hight))


def main(n, block_orientation, rotate, inreverse):
    # create matrix device
    serial = spi(port=0, device=0, gpio=noop())
    device = max7219(serial, cascaded=n or 1, block_orientation=block_orientation,
                     rotate=rotate or 0, blocks_arranged_in_reverse_order=inreverse)


    text = "春はあけぼの やうやう白くなり行く、山ぎはすこしあかりて、むらさきだちたる雲のほそくたび きたる 夏は夜 夏は夜月のころはさらなり やみもなほ、ほたるの多く飛びちがひたる また、ただ一つ二つなど、ほのかにうち光りて行くもをかし 雨など降るもをかし"
    text_len = len(text)
    image = Image.new('1', (text_len*8, 8))
    draw  = ImageDraw.Draw(image)
    font  = ImageFont.truetype("/home/shin/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')
    draw.text((0,0), text, font=font, fill=255)

    image_list = horizontal_scroll(n, image)
    max_images = len(image_list)
    while True:
      for i in range(0, max_images):
      #   device.display(image_list[i].convert(device.mode))
         device.display(image_list[i].convert('1'))
#         time.sleep(0.1)
         time.sleep(0.5)


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='matrix_demo arguments',
        formatter_class=argparse.ArgumentDefaultsHelpFormatter)

    parser.add_argument('--cascaded', '-n', type=int, default=4, help='Number of cascaded MAX7219 LED matrices')
    parser.add_argument('--block-orientation', type=int, default=-90, choices=[0, 90, -90], help='Corrects block orientation when wired vertically')
    parser.add_argument('--rotate', type=int, default=0, choices=[0, 1, 2, 3], help='Rotate display 0=0°, 1=90°, 2=180°, 3=270°')
    parser.add_argument('--reverse-order', type=bool, default=False, help='Set to true if blocks are in reverse order')

    args = parser.parse_args()

    try:
        main(args.cascaded, args.block_orientation, args.rotate, args.reverse_order)
    except KeyboardInterrupt:
        pass

 

2020年2月17日月曜日

Controlling MAX7219 8x8 Matrix LED with Raspberry Pi

昔々 Arduinoで試して死蔵してたMAX7219 と8x8 Matrix LEDを
Raspberry Piに繋げてみました。

3.3Vで動きましたね

配線
MAX7219 Pin Name Remarks RPi Pin RPi Function
1 VCC +5V Power      1 3.3V
2 GND Ground             6 GND
3 DIN Data In            19 GPIO 10 (MOSI)
4 CS Chip Select        24 GPIO 8 (SPI CE0)
5 CLK Clock             23 GPIO 11 (SPI CLK)

circuitPythonでの動作確認です。

# apt install python3-pip
# pip3 install --upgrade setuptools
# pip3 install RPI.GPIO
# pip3 install adafruit-blinka

# apt install python3-pil
# pip3 install adafruit-circuitpython-max7219

sample code get
# git clone https://github.com/adafruit/Adafruit_CircuitPython_max7219.git

[max7219_heike.py]

#!/usr/bin/env python3

import time
##from board import TX, RX, A1
from board import CE0
import board
import busio
import digitalio
from adafruit_max7219 import matrices
#-----------------------------
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont


def horizontal_scroll(image, padding=True):

        image_list = list()
        width = image.size[0]
        # Scroll into the blank image.
        if padding:
            for x in range(8):
                section = image.crop((0, 0, x, 8))
                display_section = create_blank_image()
                display_section.paste(section, (8 - x, 0, 8, 8))
                image_list.append(display_section)

        #Scroll across the input image.
        for x in range(8, width + 1):
            section = image.crop((x - 8, 0, x, 8))
            display_section = create_blank_image()
            display_section.paste(section, (0, 0, 8, 8))
            image_list.append(display_section)

        #Scroll out, leaving the blank image.
        if padding:
            for x in range(width - 7, width + 1):
                section = image.crop((x, 0, width, 8))
                display_section = create_blank_image()
                display_section.paste(section, (0, 0, 7 - (x - (width - 7)), 8))
                image_list.append(display_section)

        #Return the list of images created
        return image_list

def create_blank_image():
      return Image.new("RGB", (8, 8))


def image_gen(img):
        """Set buffer to value of Python Imaging Library image.  The image should
        be in 1 bit mode and a size equal to the display size."""
        imwidth, imheight = img.size
        # Grab all the pixels from the image, faster than getpixel.
        pixels = img.convert('1').load()
        # Iterate through the pixels
        for x in range(8):       # yes this double loop is slow,
            for y in range(8):  #  but these displays are small!
                matrix.pixel(x, y, pixels[(x, y)])
            matrix.show()

text = "ぎおんしょうじゃのかねのこえ しょぎょうむじょうのひびきあり さらそうじゅのはなのいろ じょう しゃひっすいのことわりをあらわす おごれるひともひさしからず ただはるのよのゆめのごとし たけきもの もついにはほろびぬ ひとえにかぜのまえのちりにおなじ"


text_len = len(text)
image = Image.new('1', (text_len*8, 8))
draw  = ImageDraw.Draw(image)
font  = ImageFont.truetype("/home/pi/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')
draw.text((0,0), text, font=font, fill=255)

##mosi = TX
##clk = RX
##cs = digitalio.DigitalInOut(A1)
cs = digitalio.DigitalInOut(CE0)

##spi = busio.SPI(clk, MOSI=mosi)
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)

matrix = matrices.Matrix8x8(spi, cs)

matrix.fill(False)
#image_gen(matrix, image)

image_list = horizontal_scroll(image)

max_images = len(image_list)
while True:
    for i in range(0, max_images):
         image_gen(image_list[i])
#         time.sleep(0.5)



2020年2月8日土曜日

Controlling 16x8 Matrix LED x2 (32x8) with Raspberry Pi










https://make-muda.net/2015/01/2414/

さんのホームページを参考にして、

HT16K33を使用した、8x8 matrix led
4個でのスクロールを試してみた


[sample script]

#!/usr/bin/env python3

import time
import board
import busio

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

from adafruit_ht16k33 import matrix

# Referenced https://make-muda.net/2015/01/2414/
def horizontal_multi_scroll(matrix, image, total=1, number=0):
        padding=True
        image_list = list()
        width = image.size[0]

        for x in range(matrix.columns * number):
          display_section = create_blank_image(matrix)
          image_list.append(display_section)

        # Scroll into the blank image.
        if padding:
            for x in range(matrix.columns):
                section = image.crop((0, 0, x, matrix.rows))
                display_section = create_blank_image(matrix)
                display_section.paste(section, (matrix.columns - x, 0, matrix.columns, matrix.rows))
                image_list.append(display_section)

        #Scroll across the input image.
        for x in range(matrix.columns, width + 1):
            section = image.crop((x - matrix.columns, 0, x, matrix.rows))
            display_section = create_blank_image(matrix)
            display_section.paste(section, (0, 0, matrix.columns, matrix.rows))
            image_list.append(display_section)

        #Scroll out, leaving the blank image.
        if padding:
            for x in range(width - matrix.columns - 1, width + 1):
                section = image.crop((x, 0, width, matrix.rows))
                display_section = create_blank_image(matrix)
                display_section.paste(section, (0, 0, (matrix.columns - 1) - (x - (width - (matrix.columns - 1))), matrix.rows))
                image_list.append(display_section)

        for x in range(matrix.columns * (total - (number + 1))):
          display_section = create_blank_image(matrix)
          image_list.append(display_section)


        #Return the list of images created
        return image_list

def create_blank_image(matrix):
      return Image.new("RGB", (matrix.columns, matrix.rows))



# Create the I2C interface.
i2c = busio.I2C(board.SCL, board.SDA)

# Create the matrix class.
matrixx=[]
i2c_address=(0x71, 0x70,)
for addr in i2c_address:
  matrixx.append(matrix.Matrix16x8(i2c, address=addr))

text = "ぎおんしょうじゃのかねのこえ しょぎょうむじょうのひびきあり さらそうじゅのはなのいろ じょう しゃひっすいのことわりをあらわす おごれるひともひさしからず ただはるのよのゆめのごとし たけきもの もついにはほろびぬ ひとえにかぜのまえのちりにおなじ"

text_len = len(text)
image = Image.new('1', (text_len*8, 8))
draw  = ImageDraw.Draw(image)
font  = ImageFont.truetype("/home/pi/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')
draw.text((0,1), text, font=font, fill=255)
new_image = image.transpose(Image.FLIP_TOP_BOTTOM)

image_listx = []
max_addr=len(i2c_address)
for i in range(0, max_addr):
  image_listx.append( horizontal_multi_scroll(matrixx[0], new_image, max_addr, i))

max_images = len(image_listx[0])
while True:
    for i in range(0, max_images):
         for j, m in enumerate(matrixx, 0):
            m.image(image_listx[j][i])


i2c_address=(0x71, 0x70,)の部分を
i2c_address=(0x70,) とかにすると
16x8 で動きますね

2020年1月27日月曜日

Controlling 16x8 Matrix LED with Raspberry Pi






































Raspberry Piに8x8 Matrix LED 2個を繋げてみた


制御chip HT16K33





















matrix 8x8 led  788ASY  *2
(昔 aitendoで入手した奴かな?!)
ブレッドボードに横並びで16x8に見えるように配置
(pinは上下8pinづつになりますな)

配線

LED pin   HT16K33
16        C7    (左led, 右led 共通)
15        C6
11        C5
6         C4
10        C3
4         C2
3         C1
13        C0

5         A0, A8  (左led, 右led)
2         A1, A9
7         A2, A10
1         A3, A11
12        A4, A12
8         A5, A13
14        A6, A14
9         A7, A15


試しに、circuitpythonを使って動作確認

# apt install python3-pip
# pip3 install --upgrade setuptools
# pip3 install RPI.GPIO
# pip3 install adafruit-blinka

# apt install python3-pil
# pip3 install adafruit-circuitpython-ht16k33


ValueError: No I2C device at address: 70  となる
/boot/config.txt でi2c bus 追加してた場合

# 4 i2c add
### dtoverlay=i2c-gpio,i2c_gpio_sda=0,i2c_gpio_scl=1,i2c_gpio_delay_us=2,bus=3
で、OK!!(コメント化)
busの指定が無いのが問題だけどね。CircuitPythonだからね。


sample code get
# git clone https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git


動作確認 code
[matrix16x8_heike_scroll.py]

#!/usr/bin/env python3

import time
import board
import busio

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

from adafruit_ht16k33 import matrix

def horizontal_scroll(image, padding=True):

        image_list = list()
        width = image.size[0]
        # Scroll into the blank image.
        if padding:
            for x in range(16):
                section = image.crop((0, 0, x, 8))
                display_section = create_blank_image()
                display_section.paste(section, (16 - x, 0, 16, 8))
                image_list.append(display_section)

        #Scroll across the input image.
        for x in range(16, width + 1):
            section = image.crop((x - 16, 0, x, 8))
            display_section = create_blank_image()
            display_section.paste(section, (0, 0, 16, 8))
            image_list.append(display_section)

        #Scroll out, leaving the blank image.
        if padding:
            for x in range(width - 15, width + 1):
                section = image.crop((x, 0, width, 8))
                display_section = create_blank_image()
                display_section.paste(section, (0, 0, 15 - (x - (width - 15)), 8))
                image_list.append(display_section)

        #Return the list of images created
        return image_list

def create_blank_image():
      return Image.new("RGB", (16, 8))

# Create the I2C interface.
i2c = busio.I2C(board.SCL, board.SDA)

# Create the matrix class.
matrix = matrix.Matrix16x8(i2c, address=0x70)

text = "ぎおんしょうじゃのかねのこえ しょぎょうむじょうのひびきあり さらそうじゅのはなのいろ じょう しゃひっすいのことわりをあらわす おごれるひともひさしからず ただはるのよのゆめのごとし たけきもの もついにはほろびぬ ひとえにかぜのまえのちりにおなじ"

text_len = len(text)
image = Image.new('1', (text_len*8, 8))
draw  = ImageDraw.Draw(image)
font  = ImageFont.truetype("/home/pi/font/misakifont/misaki_gothic.ttf", 8, encoding='unic')
draw.text((0,1), text, font=font, fill=255)
new_image = image.transpose(Image.FLIP_TOP_BOTTOM)

image_list = horizontal_scroll(new_image)

max_images = len(image_list)
while True:
    for i in range(0, max_images):
         matrix.image(image_list[i])





2020年1月2日木曜日

enable I2C for CentOS on Raspberry Pi

i2c 7segを繋ごうと思ったら、CentOSが入ってた。
# uname -a
Linux rpi2 4.1.11-v7+ #822 SMP PREEMPT Fri Oct 23 16:22:18 BST 2015 armv7l armv7l armv7l GNU/Linux

# cat /etc/centos-release
CentOS Linux release 7.7.1908 (AltArch)

i2cの設定がされてなかった。。。
以下設定内容
/boot/config.txt
dtparam=i2c1=on
dtparam=i2c_arm=on

/etc/modules-load.d/i2c.conf
i2c-bcm2708
i2c-dev

# yum install -y i2c-tools

で、見えた
# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --

python script 動いた

# cat ./ht16k33_7seg_cpu-temp.py
#!/usr/bin/env python

import time

from Adafruit_LED_Backpack import SevenSegment

def get_cpu_temp():
    with open("/sys/class/thermal/thermal_zone0/temp", "r") as f:
        t=f.read()
    return int(t)/1000

segment = SevenSegment.SevenSegment(address=0x70)

segment.begin()

print "Press CTRL+Z to exit"

while(True):
  cpu_temp=get_cpu_temp()
#  print cpu_temp
  segment.clear()
  segment.set_digit(0, int(cpu_temp / 10))
  segment.set_digit(1, cpu_temp % 10, decimal=True)
  segment.set_digit(2, 'C')
  segment.set_digit(3, '-')
  segment.set_colon(0)

  segment.write_display()

  time.sleep(0.25)