Connect Retroflag GPi (Raspberry Pi Zero W) to WPA2 Enterprise - raspberry-pi

I just got my retroflag gpi case working and set up. I have one small problem though. I can't connect my Pi to my WPA2-Enterprise network. I've tried a bunch of settings in wpa_supplicant.conf but can't get it to work.
Pi Model or other hardware: Raspberry Pi Zero W & Retroflag GPi Case
Power Supply used: Retroflag GPi's inbuilt.
RetroPie Version Used: 4.6.1
Built From: https://github.com/RetroPie/RetroPie-Setup/releases/download/4.6/retropie-buster-4.6-rpi1_zero.img.gz
USB Devices connected: Retroflag GPi
Controller used: Retroflag GPi
Error messages received:
Can't see any error messages. Don't know where they appear. It just says IP-address Unkown in show ip.
Guide used: Several on Google. This one among others: https://gist.github.com/elec3647/1e223c02ef2a9a3f836db7984011b53b.
This one for documentation: https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf
File: /etc/wpa_supplicant/wpa_supplicant.conf
Attachment of config files: (wpa_supplicant.conf)
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=SE
ap_scan=1
network={
ssid="Wifi-Name"
scan_ssid=1
identity="myusername"
password="mypassword"
key_mgmt=WPA-EAP
eap=TTLS
phase1="peapver=0 peaplabel=1"
phase2="autheap=MSCHAPV2"
}

I actually solved it just now.
For anyone wondering I managed to connect to the network on another machine (Ubuntu) and used Network Manager. I then checked the log (according to this link) with the command:
journalctl -u NetworkManager
This gave me this config for wpa_supplicant.conf:
country=SE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ap_scan=1
network={
ssid="Wifi-Name"
scan_ssid=1
bgscan="simple:30:-65:300"
key_mgmt=WPA-EAP WPA-EAP-SHA256
password="password"
eap=PEAP
fragment_size=1266
phase2="auth=MSCHAPV2"
identity="username"
proactive_key_caching=1
}
This might not work for everyone else since the configs are always different for every network. So be sure to do the same steps as I did if you can't get it to work.
So glad I finally got this, haha.

Related

Successfully initialized wpa_supplicant but does’t work

I'm going mad with a stupid issue I can't solve.
During the testing of my Yocto project I always used connmactl in order to connect my board to the internet.
Now I am going to release the product but before releasing I am working on an “internet connection manager”
I guess I can’t use connmanctl anymore since it consist in an interactive command (isn’t it?) so I’m going to use directly wpa_supplicant.
In my script I edit wpa_supplicant.conf as follow:
root#localhost:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
bgscan=""
network={
ssid="Obi_Lan_Kenobi"
psk="TheForceIsStrongWithThisOne"
}
After that I try to start wpa_supplicant with this command:
wpa_supplicant -B -i mlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf wext
as result of this command I get:
Successfully initialized wpa_supplicant
But if I try to ping google.com (or any other website) i seet that the network doesn’t work, In particular I get this message: ping: sendto: Network is unreachable
Everything is working under connmanctl, but not under wpa_supplicant.
The strange thing is that running iw command everything seems to be configurated in the right way:
root#localhost:~# iw dev mlan0 link
Connected to 56:0c:ff:37:1a:69 (on mlan0)
SSID: Obi_Lan_Kenobi
freq: 2412
RX: 32154 bytes (310 packets)
TX: 19436 bytes (128 packets)
signal: -38 dBm
rx bitrate: 1.0 MBit/s
tx bitrate: 72.2 MBit/s MCS 7 short GI
bss flags: short-preamble short-slot-time
dtim period: 2
beacon int: 100
I honestly can’t understand why.
Does anybody have a suggestion about that?

Bond0 - cannot set the right LB algorithm to 802.3ad

Ubuntu 16.04.4
I'm trying to setup a 4 interface bond0. I setup the following:
10-bond0.netdev
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=802.3ad
TransmitHashPolicy=layer3+4
MIIMonitorSec=1s
LACPTransmitRate=fast
10-bond0.network
[Match]
Name=bond0
[Network]
Address=10.38.63.1/24
20-enx00145ee890e0.network
[Match]
Name=enx00145ee890e0
[Network]
Bond=bond0
20-enx00145ee890e1.network
[Match]
Name=enx00145ee890e1
[Network]
Bond=bond0
20-enx00145ee890e2.network
[Match]
Name=enx00145ee890e2
[Network]
Bond=bond0
20-enx00145ee890e3.network
[Match]
Name=enx00145ee890e3
[Network]
Bond=bond0
Once up
root#server#cat /sys/class/net/bond0/bonding/mode
balance-rr 0
If I redefine bond0 into bond1 (I move bond0 files into bond1 ones and then adjust the info inside them) then
root#server#cat /sys/class/net/bond1/bonding/mode
802.3ad 4
Also when introducing bond1 I still get bond0 among the interfaces displayed by "ip link show" so bond0 must be defined somewhere but I don't know where.
I have to say that I have a mixed system nased on the networking and systemd-networkd service.
/etc/network/interface doesn't have any reference to bond0
I do want to get rid if networking in favour of systemd-networks but since I don't have access to the server I have to prepare things carefully and accurately.
I don't know from where the system may get that "balance-rr" and not honouring the 802.3ad in the bond0-related files.
Where can I check further?
TIA
I think I found the problem
root#brunas:/etc/systemd/network$ systemctl --version
systemd 229
I'm hitting this bug
https://github.com/systemd/systemd/issues/7025
https://github.com/systemd/systemd/issues/5971
the workaround as reported in the second link is to create
/etc/modprobe.d/bonding.conf and set
options bonding max_bonds=0

Hypriot OS on Raspberry PI: user-data for cloud-init is ignored

I try to configure a Raspberry PI 3b+ using HypriotOS 1.9 with Cloud init. To do so, I put a user-data file into the root of the boot volume. According to the docs, this should be picked up automatically and execute the changes described in the file (eg. change hostname).
However, none of these changes happens and looking at the log output of cloud-init does not seem to indicate that the file is even being picked up correctly.
I am using the hypriot flash utility to copy files to the target OS. when i mount the SD card and check if user-data is copied and valid yaml - then indeed it is.
Has somebody experienced something similar or have a good clue on what is happening?
More information is:
user-data (template, actual values get interpolated):
# vim: set ts=2 sw=2 filetype=yaml:
---
hostname: $TEMPLATE_HOSTNAME
manage_etc_hosts: true
users:
- name: r9s
gecos: "Raspbernetes User"
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
groups: users,docker,video,input
plain_text_passwd: r9spwd
lock_passwd: true
ssh_pwauth: false
locale: "de_DE.UTF-8"
timezone: "Europe/Berlin"
write_files:
- content: |
allow-hotplug: wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
path: /etc/network/interfaces.d/wlan0
- content: |
country=de
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="$TEMPLATE_SSID"
psk="$TEMPLATE_PSK"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
path: /etc/wpa_supplicant/wpa_supplicant.conf
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSkvewNpUkKQp/uXNEAMkqQyEjZeLQmcVje9XStvn92cNq3NO2Ij6S+pBtGcB4IYxYjjT8Nv5GxUDS51gZYg/F2Blr4jnOKXkpSyRZwRFiZ05dNaU6DRjK9ETujAdTYa7jmsrbZEejuG8YcVlfJkOvQeRxI+Y6pgAw+hl9ZwcQ8oHwcZbPFJgCbDgOUv6IssLNbKvLgt/vKHcd74oHVN9y+NtpLk4+mdWCzLv/STjshZVxP/Xz896irIBuKEnPhNO1qvTctTVJpEBvwGjA/RgFVjLpY8gSwLHlr5vTcLtKgyMZ7+xr6iKFlSPQovfugokJ5eBYG5Zn4oAy99KuVJbB matthias#rusty-nail
runcmd:
- 'systemctl restart avahi-daemon'
- 'ifup wlan0'
output of cloud-init.log on pastebin (because of verbosity)
the answer was, that user-data files need to start with a line containing exactly this sequence:
#cloud-config
if not present, the file is ignored and skipped as if it were not there. This is actually documented in the cloud init docs. Nevertheless it's very hard to find when just scanning through the documentation.
the hypriot tutorials i found didn't mention it and the line was not present in the examples there.
Changing the hostname after flashing on hypriot on the raspberry.
raspi-config worked for me.
This persists after reboot.
sudo raspi-config
Then go to
network options-> hostname
change the hostname.
Change hostname with hostnamectl set-hostname mycoolname
Edit /etc/cloud/cloud.cfg
Replace preserve_hostname: true by preserve_hostname: false
Reboot

Cannot send command IR with HotPI

I bought a HotPi a while ago, and decided to use it. So I followed the procedure to configure the IR and after a few hours I was able to IR signals on my Raspberry 1.
But my purpose here is to send IR signals, which I tried, without any luck.
So this is the command I try to do (just for test):
irsend SEND_START devinput KEY_POWER ; sleep 3
And this is what lircd tells me:
lircd-0.9.4c[907]: Notice: accepted new client on /var/run/lirc/lircd
lircd-0.9.4c[907]: Info: Cannot configure the rc device for /dev/lirc0
lircd-0.9.4c[907]: Error: invalid send buffer
lircd-0.9.4c[907]: Error: this remote configuration cannot be used to transmit
lircd-0.9.4c[907]: Error: error processing command: SEND_START devinput KEY_POWER
lircd-0.9.4c[907]: Error: transmission failed
lircd-0.9.4c[907]: Info: removed client
Edit:
It seems I'm not using the good drivers. According to the HotPi documentation, I'm suppose to use lirc-rpi, which I'm suppos to install with
sudo modprobe lirc-rpi
Which, at least, doesn't return an error. But trying to configure the interface tells me that the driver doesn't exist:
pi#raspberrypi:~ $ mode2 --driver lirc-rpi --device /dev/lirc0
Driver `lirc-rpi' not found. (Missing -U/--plugins option?)
Available drivers:
accent
alsa_usb
asusdh
atilibusb
atwf83
audio
audio_alsa
awlibusb
bte
bw6130
commandir
creative
creative_infracd
default
devinput
dfclibusb
dsp
dvico
ea65
file
ftdi
ftdi-exp
ftdix
girs
i2cuser
irlink
irtoy
livedrive_midi
livedrive_seq
logitech
macmini
mouseremote
mouseremote_ps2
mp3anywhere
mplay
mplay2
pcmak
pinsys
pixelview
samsung
sb0540
silitek
slinke
sonyir
srm7500libusb
tira
tira_raw
udp
uirt2
uirt2_raw
usb_uirt_raw
usbx
zotac
Here is no info what lirc version you are using. There are vast differences between the legacy 0.9.0 still used in some distros and modern lirc.
That said, the logs seems pretty clear. You are using the devinput driver, right? This driver does not support sending data, reflecting the fact that also the kernel doesn't.
You then need to use another driver - first stop might be the default one. If/when using this other driver, you need another lircd.conf.
Please refer to http://lirc.org/html/configuration-guide.html
EDIT: Ah, lirc-0.9.4c says the log. Sorry, my bad. The reply should still be valid, though.
When you record the remote, use:
irrecord -d /dev/lirc0 -f name.conf
The -f uses raw mode. This then worked for me on the transmit side, before I got same error as you.

Connect to iphone hotspot from raspberry pi

Currently, i can connect from the raspberry (raspbian) to my home wifi but when i try to connect to iphone (4s) hotspot i can't. Iphone is WPA2 Personal while my home network is WPA/WPA2 Personal. I suspect there's something wrong with my config but i really can't find what. Here's the relevant part in /etc/wpa_supplicant/wpa_supplicant.conf.
network={
ssid="iPhone"
psk="pass"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
For reference here's the config (working) for my home network (in the same file):
network={
ssid="wifi name"
psk="pass"
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)
proto=WPA
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)
key_mgmt=WPA-PSK
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)
pairwise=TKIP
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)
auth_alg=OPEN
}
I think your network has not the same configuration as you set (for proto / pairwise). You might configure your network this way:
network={
ssid="iPhone"
psk="pass"
key_mgmt=WPA-PSK
}
The wpa_supplicant will find the correct configuration by itself.
Remove inverted commas & spaces from your iphone’s Name this will solve the problem