LoginSignup
0
3

More than 3 years have passed since last update.

UIFlow で固定IPアドレスを使う

Posted at

はじめに

UIFlow からWi-FiのIPアドレスを表示,変更する方法です。
V1.64現在,公式ブロックに無いためTipsとして残します。

開発環境

・M5Stick-C
・UIFlow(Bata1.63) Micropython v1.11
 2020/10/14 確認
 M5Stack シリーズは特に問わないと思います。

Flow

標準では IPアドレスに関するブロックは見つかりませんでした。
SSIDとPASSを使いWi-Fiに接続します。
A/Bボタン イベントにてIPアドレスを変更しています。
ip, subnet, gateway, dns の順に指定できます。

image.png

sample.py
# IP アドレスを変更
# AbstractNIC.ifconfig([(ip, subnet, gateway, dns)])

# 192.168.1.91
  wifiCfg.wlan_sta.ifconfig(('192.168.1.91', '255.255.255.0', '192.168.1.1', '192.168.1.1'))
# 192.168.1.92
  wifiCfg.wlan_sta.ifconfig(('192.168.1.92', '255.255.255.0', '192.168.1.1', '192.168.1.1'))

まとめ

IPアドレスの変更,私の環境では一瞬で切り替えできました。
UIFlow で出来ないと感じた時はMicroPython のライブラリを調べましょう。

参考資料

https://docs.micropython.org/en/latest/index.html
https://docs.micropython.org/en/latest/library/network.html

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3