Skip to content
Andreas Kugel edited this page Jul 21, 2023 · 26 revisions

Prototype for OK LAB Karlsruhe

M5StickV

Docs, 50€ Modell mit Display

M5Stack UnitV2

Docs , 75€ Modell mit Linux

unitv2# cat /proc/cpuinfo 
processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 16.71
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 1
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 16.71
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: SStar Soc (Flattened Device Tree)
Revision	: 0000
Serial		: 0000000000000000
unitv2# 


nitv2# lscpu 
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              2
On-line CPU(s) list: 0,1
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           1
Vendor ID:           ARM
Model:               5
Model name:          Cortex-A7
Stepping:            r0p5
CPU max MHz:         1400.0000
CPU min MHz:         400.0000
BogoMIPS:            16.71
Flags:               half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm


Current frequency:

sudo watch -n 1 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

Factory reset

unitv2# uname -a

Linux unitv2 4.9.84 #196 SMP PREEMPT Wed Apr 7 02:40:43 CST 2021 armv7l GNU/Linux

unitv2# cat /etc/os-release

NAME=Buildroot

VERSION=2020.02.8

ID=buildroot

VERSION_ID=2020.02.8

PRETTY_NAME="Buildroot 2020.02.8"

unitv2#

unitv2# python --version

Python 3.8.6

Settings after resh install

Filesystem

unitv2# mount
ubi:rootfs on / type ubifs (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=57344k,nr_inodes=14336,mode=755)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
sysfs on /sys type sysfs (rw,relatime)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,relatime,net_cls)
/dev/mmcblk0p1 on /media/sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
unitv2# 

Network

ssh access failes (from Fedora 37) with:

[kugel@tux2 nanodet]$ ssh [email protected]

Received disconnect from 10.254.239.1 port 22:2: Too many authentication failures

Disconnected from 10.254.239.1 port 22

Solution:

  • edit /etc/ssh/sshd_config and set "MaxAuthRetries" to some larger value (defaults to commented out)
  • Stop sshd

/sbin/start-stop-daemon -n sshd -K

  • Start sshd

/sbin/start-stop-daemon -S /usr/sbin/sshd

# ifconfig
br0       Link encap:Ethernet  HWaddr 00:30:1B:BA:02:DB
          inet addr:10.254.239.1  Bcast:10.254.239.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6460 errors:0 dropped:37 overruns:0 frame:0
          TX packets:2312 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:427624 (417.6 KiB)  TX bytes:18883931 (18.0 MiB)

eth0      Link encap:Ethernet  HWaddr 00:30:1B:BA:02:DB
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6460 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14310 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:518064 (505.9 KiB)  TX bytes:19675684 (18.7 MiB)
          Interrupt:35

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1309 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1309 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:80340 (78.4 KiB)  TX bytes:80340 (78.4 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:E0:99:D2:DA:76
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan1     Link encap:Ethernet  HWaddr 02:E0:99:D2:DA:76
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:129 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

#
# cat  /etc/hostapd.conf

interface=wlan1
bridge=br0

driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
hw_mode=g
channel=6
beacon_int=100

wme_enabled=1

ieee80211n=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+][HT40-][DSSS_CCK-40]

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=M5UV2_ae9f
# cat  /etc/network/interfaces
# interface file auto-generated by buildroot

auto lo
iface lo inet loopback
#

ML stuff: models and related

Directory /home/m5stack/payload

unitv2# ls data 
classifier_online_features.dat  classifier_online_info.json
unitv2# ls images 
0Caocao_1.png   2ZhouYu_1.png   4ZhaoYun_1.png  test.jpg
1Zhuge_1.png    3Ruozhi_1.png   5JunShi_1.png
unitv2# ls models 
angle_op.bin
angle_op.param
crnn_lite_op.bin
crnn_lite_op.param
dbnet_op.bin
dbnet_op.param
mnet.25-opt.bin
mnet.25-opt.param
mobilefacenet.bin
mobilefacenet.param
mobilenet_ssd_code_detector_ncnn.bin
mobilenet_ssd_code_detector_ncnn.param
nanodet_m.bin
nanodet_m.param
shufflenet_v2_x0.5-opt.bin
shufflenet_v2_x0.5-opt.param
srnet.bin
srnet.param
yolo-fastest.bin
yolo-fastest.param
unitv2# 
unitv2# ls -R uploads/models/
uploads/models/:
nanodet_80class  yolo_20class

uploads/models/nanodet_80class:
model.json       nanodet_m.bin    nanodet_m.param

uploads/models/yolo_20class:
model.json          yolo-fastest.bin    yolo-fastest.param
unitv2# 

Problems

Wifi client in parallel to LAN host

Edit /etc/wpa_supplicant to add SSID, e.g.

unitv2# cat /etc/wpa_supplicant.conf 
ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

# new
network={
    ssid="karlsruhe.freifunk.net"
    key_mgmt=NONE
}

stop daemon:

start-stop-daemon -n wpa_supplicant -K

restart daemon:

wpa_supplicant -B -Dnl80211 -i wlan0 -c /etc/wpa_supplicant.conf

start dhcp client:

dhcpcd wlan0

check:

wlan0     Link encap:Ethernet  HWaddr 00:E0:99:D2:DA:76  
          inet addr:192.168.4.10  Bcast:192.168.4.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2650 (2.5 KiB)  TX bytes:2247 (2.1 KiB)

unitv2# ping cern.ch
PING cern.ch (188.184.37.219): 56 data bytes
64 bytes from 188.184.37.219: seq=0 ttl=46 time=25.955 ms
64 bytes from 188.184.37.219: seq=1 ttl=46 time=23.856 ms