Posts: 14,009
Threads: 319
Joined: Mar 2018
Reputation:
571
(10-27-2023, 07:24 PM)TheOldPresbyope Wrote: Switching horses for a bit, I'm wondering how much longer we'll use hostapd.
True, hostapd is available in the RPiOS Bookworm distro but nmcli also can bring up the WiFi interface in AP mode and provide open, WEP, and WPA-PSK authentication.
nmcli is a bit of a Swiss Army knife when it comes to networking; an advantage to using it is all the configuration-related stuff is kept under one roof. nmcli can switch among the defined connections with a single command.
Case in point:
At the moment, my pi400 has two WiFi connections defined: blitch, which is my LAN AP SSID, and blonch, which is the SSID I defined for the pi400 in AP mode (SSIDs changed to protect the innocent).
With the pi400 WiFi interface in infrastructure mode and connected to the LAN AP, I can switch the interface to AP mode simply by entering
Code: sudo nmcli connection up blonch
and similarly to switch back to bletch in infrastructure mode.
If an Ethernet connection happens to be present, it remains up.
Cool beans.
Regards,
Kent
Can you post blonch.nmconnection file?
I'd like to see what key/value pairs are present for an AP mode configuration.
Thx.
Posts: 6,213
Threads: 184
Joined: Apr 2018
Reputation:
250
Code: kreed@pi400:/ $ sudo cat /etc/NetworkManager/system-connections/Hotspot.nmconnection
[connection]
id=Hotspot
uuid=f44b5ca4-de86-491d-ba5b-bff82edc64a3
type=wifi
autoconnect=false
interface-name=wlan0
[wifi]
mode=ap
ssid=blonch
[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=<plaintext blonch password elided>
[ipv4]
method=shared
[ipv6]
addr-gen-mode=default
method=ignore
[proxy]
Posts: 14,009
Threads: 319
Joined: Mar 2018
Reputation:
571
(11-08-2023, 02:25 PM)TheOldPresbyope Wrote: Code: kreed@pi400:/ $ sudo cat /etc/NetworkManager/system-connections/Hotspot.nmconnection
[connection]
id=Hotspot
uuid=f44b5ca4-de86-491d-ba5b-bff82edc64a3
type=wifi
autoconnect=false
interface-name=wlan0
[wifi]
mode=ap
ssid=blonch
[wifi-security]
group=ccmp;
key-mgmt=wpa-psk
pairwise=ccmp;
proto=rsn;
psk=<plaintext blonch password elided>
[ipv4]
method=shared
[ipv6]
addr-gen-mode=default
method=ignore
[proxy]
What IP address, mask, gateway, dns and domain is assigned?
Posts: 6,213
Threads: 184
Joined: Apr 2018
Reputation:
250
There is no local DNS resolver running on my ISP-provided router. (The ISP is Comcast).
The LAN is 10.0.0.x, the router gateway is 10.0.0.1, and the router is running DHCP.
Here we see the hotspot has grabbed 10.42.0.x for its LAN. I imagine the subnet is user-definable but I haven't explored this.
Code: kreed@pi400:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.253 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 xxxx:xxx:xxxx::faa4 prefixlen 128 scopeid 0x0<global>
inet6 fe80::6655:9a1c:2c4e:76d6 prefixlen 64 scopeid 0x20<link>
inet6 xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:e569 prefixlen 64 scopeid 0x0<global>
ether e4:5f:01:29:07:f7 txqueuelen 1000 (Ethernet)
RX packets 155 bytes 52781 (51.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 189 bytes 26374 (25.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10287 bytes 898671 (877.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10287 bytes 898671 (877.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.42.0.1 netmask 255.255.255.0 broadcast 10.42.0.255
ether e4:5f:01:29:07:f8 txqueuelen 1000 (Ethernet)
RX packets 5869518 bytes 6426459127 (5.9 GiB)
RX errors 0 dropped 127 overruns 0 frame 0
TX packets 1724949 bytes 197714515 (188.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code: kreed@pi400:~ $ cat /etc/resolv.conf
# Generated by NetworkManager
search hsd1.md.comcast.net
nameserver 75.75.75.75
nameserver 75.75.76.76
nameserver xxxx:xxx:xxxx::1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver xxxx:xxx:xxxx::2
nameserver xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:74b8
Note that I have full IPv6 service from my ISP and I obscure IPv6 global addresses out of (what may be) an over-abundance of caution. Someday I need to get more familiar with IPv6 security. techniques Someday.
Regards,
Kent
Posts: 6,213
Threads: 184
Joined: Apr 2018
Reputation:
250
Quick update. I was futzing around with the Pi5B and Bookworm this morning.
Somehow I managed to get Chromium started in Wayland mode and displaying http://moodeaudio.org in full screen mode ala our moOde settings. I'll post more later when I've had a chance to document my steps and test that it also works on a Pi4B (no reason it shouldn't, but you know how that goes).
The one oddity is that it took approximately forever after the Wayland compositor started displaying a blank screen until the Chromium window opened. I'm not sure what the long delay is all about (seemed like 30s but I wasn't counting).
That's one step toward a moOde localUI. No idea yet whether the virtual keyboard code will work.
Regards,
Kent
Posts: 1,396
Threads: 24
Joined: Jun 2022
Reputation:
49
(11-08-2023, 04:57 PM)TheOldPresbyope Wrote: That's one step toward a moOde localUI. No idea yet whether the virtual keyboard code will work.
I see no reason why it shouldn't, it just uses onclick events on div elements, and manipulates the text property of an input field.
Posts: 6,213
Threads: 184
Joined: Apr 2018
Reputation:
250
(11-08-2023, 05:03 PM)Nutul Wrote: (11-08-2023, 04:57 PM)TheOldPresbyope Wrote: That's one step toward a moOde localUI. No idea yet whether the virtual keyboard code will work.
I see no reason why it shouldn't, it just uses onclick events on div elements, and manipulates the text property of an input field.
That's my thoughts too but I don't have a touchscreen I can use on the Pi5B at the moment to prove all the bits work together. "Trust but verify."
Regards,
Kent
Posts: 1,396
Threads: 24
Joined: Jun 2022
Reputation:
49
(11-08-2023, 05:20 PM)TheOldPresbyope Wrote: That's my thoughts too but I don't have a touchscreen I can use on the Pi5B at the moment to prove all the bits work together. "Trust but verify."
I see. Alternatively, to check the local UI, also connecting to an HDMI TV/Monitor and using a mouse should do; question is if everything related already works on the Pi5 + Bookworm + moOde... ;-)
Posts: 14,009
Threads: 319
Joined: Mar 2018
Reputation:
571
(11-08-2023, 03:56 PM)TheOldPresbyope Wrote: There is no local DNS resolver running on my ISP-provided router. (The ISP is Comcast).
The LAN is 10.0.0.x, the router gateway is 10.0.0.1, and the router is running DHCP.
Here we see the hotspot has grabbed 10.42.0.x for its LAN. I imagine the subnet is user-definable but I haven't explored this.
Code: kreed@pi400:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.253 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 xxxx:xxx:xxxx::faa4 prefixlen 128 scopeid 0x0<global>
inet6 fe80::6655:9a1c:2c4e:76d6 prefixlen 64 scopeid 0x20<link>
inet6 xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:e569 prefixlen 64 scopeid 0x0<global>
ether e4:5f:01:29:07:f7 txqueuelen 1000 (Ethernet)
RX packets 155 bytes 52781 (51.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 189 bytes 26374 (25.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10287 bytes 898671 (877.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10287 bytes 898671 (877.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.42.0.1 netmask 255.255.255.0 broadcast 10.42.0.255
ether e4:5f:01:29:07:f8 txqueuelen 1000 (Ethernet)
RX packets 5869518 bytes 6426459127 (5.9 GiB)
RX errors 0 dropped 127 overruns 0 frame 0
TX packets 1724949 bytes 197714515 (188.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code: kreed@pi400:~ $ cat /etc/resolv.conf
# Generated by NetworkManager
search hsd1.md.comcast.net
nameserver 75.75.75.75
nameserver 75.75.76.76
nameserver xxxx:xxx:xxxx::1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver xxxx:xxx:xxxx::2
nameserver xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:74b8
Note that I have full IPv6 service from my ISP and I obscure IPv6 global addresses out of (what may be) an over-abundance of caution. Someday I need to get more familiar with IPv6 security. techniques Someday.
Regards,
Kent
Interesting. My network uses the 192.168.1 address space. I'll have to see what network the AP assigns.
Also prolly need to investigate how to assign a static address space for example 172.42.1.x if needed. I'm thinking it might not since lately it seems that pretty much everything supports mDNS or some sort of auto discovery.
Posts: 14,009
Threads: 319
Joined: Mar 2018
Reputation:
571
(11-08-2023, 06:31 PM)Tim Curtis Wrote: (11-08-2023, 03:56 PM)TheOldPresbyope Wrote: There is no local DNS resolver running on my ISP-provided router. (The ISP is Comcast).
The LAN is 10.0.0.x, the router gateway is 10.0.0.1, and the router is running DHCP.
Here we see the hotspot has grabbed 10.42.0.x for its LAN. I imagine the subnet is user-definable but I haven't explored this.
Code: kreed@pi400:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.253 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 xxxx:xxx:xxxx::faa4 prefixlen 128 scopeid 0x0<global>
inet6 fe80::6655:9a1c:2c4e:76d6 prefixlen 64 scopeid 0x20<link>
inet6 xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:e569 prefixlen 64 scopeid 0x0<global>
ether e4:5f:01:29:07:f7 txqueuelen 1000 (Ethernet)
RX packets 155 bytes 52781 (51.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 189 bytes 26374 (25.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10287 bytes 898671 (877.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10287 bytes 898671 (877.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.42.0.1 netmask 255.255.255.0 broadcast 10.42.0.255
ether e4:5f:01:29:07:f8 txqueuelen 1000 (Ethernet)
RX packets 5869518 bytes 6426459127 (5.9 GiB)
RX errors 0 dropped 127 overruns 0 frame 0
TX packets 1724949 bytes 197714515 (188.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code: kreed@pi400:~ $ cat /etc/resolv.conf
# Generated by NetworkManager
search hsd1.md.comcast.net
nameserver 75.75.75.75
nameserver 75.75.76.76
nameserver xxxx:xxx:xxxx::1
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver xxxx:xxx:xxxx::2
nameserver xxxx:xxx:xxxx:xxxx:xxxx:xxxx:xxxx:74b8
Note that I have full IPv6 service from my ISP and I obscure IPv6 global addresses out of (what may be) an over-abundance of caution. Someday I need to get more familiar with IPv6 security. techniques Someday.
Regards,
Kent
Interesting. My network uses the 192.168.1 address space. I'll have to see what network the AP assigns.
Also prolly need to investigate how to assign a static address space for example 172.42.1.x if needed. I'm thinking it might not since lately it seems that pretty much everything supports mDNS or some sort of auto discovery.
Looks like it always assigns the same 10.42.0 network so no need for any static addressing.
inet 10.42.0.1 netmask 255.255.255.0 broadcast 10.42.0.255
- Connection hot switching works fine as long as you are first ssh'd in to the Ethernet address
- AP mode is fully bridged to the Ethernet side forming a true Hotspot.
It's a super nice simplification of networking. Things like dhcpcd, hostapd, bunch of config files etc don't appear to be needed anymore :-)
Btw, you can use PSK's generated by wpa_passphrase instead of plaintext passwords for the psk= param. Also to generate UUID's just cat /proc/sys/kernel/random/uuid
|