Connect to iphone hotspot from raspberry pi - iphone

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

Related

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

Raspberry PI 4 + Huawei E3372 - Send AT commands

I'm trying to send AT commands to a Huawei E3372 USB Dongle but I haven't figured out how to mount correctly.
If I do lsusb, I get the following:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 001 Device 003: ID 03f0:034a HP, Inc Elite Keyboard
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The dongle is listed, I can also access it's configuration screen on 192.168.1.1 and I can access internet.
I have tried creating the config file:
sudo nano /etc/usb_modeswitch.d/12d1:14db
and entered the following configuration
TargetVendor=0x12d1
TargetProduct=0x14db
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NoDriverLoading=1
I have tried various configurations found on the web but none seems to work.
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyAMA0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyprintk
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
No more luck with dmesg | grep ttyUSB that returns nothing (same for USB0, USB1,...)
It's probably something wrong in the config file but I don't see exactly what needs to be done.
Any idea ?
Thanks!
You attach wrong lsusb output. The dongle is not listed.
Perhaps the device code 14db and accessible 192.168.1.1 looks like your modem is switched to newest mode where the dongle looks like router. If you would like to send AT command then you must change mode to serial. First of all try it through:
/etc/usb_modeswitch.conf
The last part of the file contain your desired option:
HuaweiAltModeGlobal=0
Notice the comment above this option:
...you can globally set an alternative method here which provides a
different mode: either plain serial PPP...
Just try to change number. There should be around 6 modes and one of them will switch your dongle to serial mode.
Best luck.

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

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.

Connect Beaglebone black to Internet via Fona and a Sim needing APN authentication

I have a BBB, a Fona from Adafruit and a LycaMobile 3G Sim card and I wanted to connect BBB to internet using this 3G sim. I followed : this tutorial from adafruit to do so.
But to connect to my APN I need to set username and password. SO I did this :
in my /etc/ppp/peers/fona :
Instead of
noauth
I put :
auth
user lmfr
name lycamobile
and in my /etc/ppp/chap-secrets as well as in my etc/ppp/pap-secrets I put :
"lmfr" * "plus"
But I have the following error when i do this :
sudo pon fona
/usr/sbin/pppd: The remote system is required to authenticate itself
/usr/sbin/pppd: but I couldn't find any suitable secret (password) for it to use to do so
/usr/sbin/pppd: (None of the available passwords would let it use an IP address)
Does anyone knows how to fix this or another way to connect to Fona with APN authentication ?
Struggling with authentication using FONA on either Raspberry Pi 2 and 3 even while strictly following the Adafruit FONA setup instructions, the following steps helped me to get it work on both Pi's - based on a freshly installed raspbian/debian stretch OS. Adopt the following to your BBB:
update OS:
sudo apt-get update
sudo apt-get dist-upgrade
install neccessary packages:
sudo apt-get install ppp screen
connect FONA board to Pi/BBB as described within Adafruit FONA setup instructions
ensure you disabled kernel's use of hardware serial connection!
Pi2: follow Adafruit description
Pi3: "sudo raspi-config" > "Interfacing Options" > "Serial"
> "...login shell... over serial?" NO
> "...serial port hardware enabled?" YES
exit/finish raspi config and
check
sudo nano /boot/config.txt
if line enable_uart=1 is included. If not, add this as new line and save
[Ctrl]+[x], [y], [Enter] > reboot!
find the correct serial port for your Pi/BBB. This command might help - it shows all available ports:
ls /dev
Examples:
Pi2: "/dev/ttyAMA0"
Pi3: "/dev/serial0"
BBB: "/dev/tty04" (as stated at Adafruit)
Ensure that the FONA is answering on the corresponding serial port - in this example on Pi3:
screen /dev/serial0 115200
A black screen (terminal window) should occur. Write
AT [Enter]
and you should get OK as response. If you don't get the "OK", just disconnect the battery, reconnect it afterwards and give it another try! You can exit the terminal window at any time through
[Ctrl]+[A]
:quit [Enter]
As soon as the FONA board is answering over serial connection, the cellular connection (especially authentication) is the target.
Changing noauth to auth within "fona" did not help me, neither editing "chap-secrets" and/or "pap-secrets". Have the 3 APN values included within the "fona" file:
sudo -i
cd /etc/ppp/peers
nano fona
Enter the correct APN name within the "connect" line, like Adafruit mentioned:
connect "/usr/sbin/chat ... -T T-Mobile"
and replace "T-Mobile" with your APN name. Ensure to uncomment only one line within the next block, having the exact same serial port included as above when successfully testing the serial connection (in this example again the Pi3 port)
/dev/serial0
Now add the following section at the end of the file for fona-file authentication:
#Authentication
user abcd#efgh.dom << here goes the providers APN user name
password 1a2b3d4e << here goes the providers APN password
Save and exit the file and exit the superuser mode
[Ctrl]+[x], [Y], [Enter]
exit [Enter]
At least give it a try, as stated at Adafruit
sudo pon fona
If the red LED starts blinking twice every second you're done! If not, please follow the Adafruit troubleshooting section, which should solve the missing bits and pieces.
The essential parts are propper serial connection and - as soon as that works - the authentication within the "fona" file!
Especially the cellular connection and authentication should be adoptable to BBB, once the serial connection is established.
Here is what I did :
I made sure that I could see /dev/ttyO4 after adding capemgr.enable_partno=BB-UART4 to uEnv.txt
I installed ppp, screen, elinks, jdk1.8-linux-arm and librxtx-java
I used the fona library from angryelectron. So I downloaded the library on my PC and build it via "ant jar" and it generated some jar files.
I created a Main.java file in which I put this :
public class Main {
//Make sure You can see /dev/ttyO4 on your Beagle Bone Black or /dev/ttyAMA0 on raspberryPi
private static final String PORT = "/dev/ttyO4";
private static final Integer BAUD = 115200;
//Credentials for Lycamobile Wireless required for testing GPRS.
private static final String APN = "data.lycamobile.fr";
private static final String USER = "lmfr";
private static final String PWD = "plus";
private static final String SMTP = "smtp.lycamobile.fr";
public static void main(String[] args)
{
try
{
fona.open(PORT, BAUD);
testGprsHttpGet();
fona.close();
}
catch(Exception e)
{
System.out.println("exception " + e);
}
}
public static void testGprsHttpGet() throws FonaException {
System.out.println("gprsHttpGet");
fona.gprsEnable(APN, USER, PWD);
String response = fona.gprsHttpGet("http://httpbin.org/user-agent");
if (!response.contains("SIMCOM_MODULE")) {
System.out.println("Fails");
}
else{
System.out.println(response);
}
}
}
Also created a simple exec.sh file :
JAVA_OPT="-Djava.library.path=/usr/lib/jni -Dgnu.io.rxtx.SerialPorts=/dev/ttyO4"
javac -cp .:fona-0.92.jar:fona.jar:RXTXcomm-2.2pre2.jar:fona-0.92-sources.jar Main.java
java $JAVA_OPT -cp .:fona-0.92.jar:fona.jar:RXTXcomm-2.2pre2.jar:fona-0.92-sources.jar Main
I put all those files in a folder :
fona-0.92.jar fona.jar RXTXcomm-2.2pre2.jar fona-0.92-sources.jar Main.java and copied the folder on BBB
launched my script exec.sh and thats it. In the output I can see :
{
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36"
}
And the NET led blinks like twice a second.
Hope this helps someone else.

Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

I'm a new user on RTnet and try to make Rtnet work on Freescale Sabre Lite iMX6Q board. But I got an issue, RTnet can't use rt_fec.ko module driver to register rt_eth0 even though non real time driver is disable.
I'm using:
Linux kernel 3.0.43 download from Xenomai git://git.xenomai.org/ipipe-gch.git/?h=ipipe-3.0-imx6q
Xenomai 2.6 download from git.xenomai.org/xenomai-2.6.git/
RTnet 0.9.13 download from rtnet.org/download.html
Please see my kernel configuration and boot log in attached link.
Xenomai is loaded:
"*I-pipe: Domain Xenomai registered.
Xenomai: hal/arm started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.
Xenomai: debug mode enabled.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.* "
And FEC ethernet driver (non real-time driver) is loaded when kernel is booting
*"FEC Ethernet Driver
fec_enet_mii_bus: probed "*
Xenomai is built following install guideline for ARM platform from Xenomai:
http://xenomai.org/installing-xenomai-2-x/
RTnet is built by below command, because SABRE Lite use FEC ethernet card with Micrel KSZ9021 Gigabit chip so I put "--enable-fec" in configure command to build real-time driver for FEC ethernet card:
"./configure --host=armv7l-timesys-linux-gnueabi --with-rtext-config=/home/sonnguyen/rtnet-xenomai-rootfs/usr/xenomai/bin/xeno-config --with-linux=/home/sonnguyen/build/rtnet-xenomai-ipipe-imx6q --enable-rtcfg-dbg --enable-rtwlan --enable-net-routing --enable-router --enable-nomac --enable-rtcap --enable-proxy --enable-checks --enable-fec "
Then
"make DESTDIR=/home/sonnguyen/rtnet-xenomai-rootfs install"
I also changed RT_DRIVER from default value to "rt_fec" in rtnet.conf.
After kernel is booted, I ran "./rtnet start" and got this:
"RTnet: initialising real-time networking
RT FEC Ethernet Driver
./rtnet: line 385: can't create /sys/bus/pci/drivers/rt_fec/bind: nonexistent directory
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device "
Then I tried:
"# lspci
lspci: /sys/bus/pci/devices: No such file or directory
ls /sys/bus/
ac97 hid mdio_bus platform sdio spi
event_source i2c mmc scsi serio usb "
No pci directory under /sys/bus/. Then I thought because the script can't find the ethernet physical bus, it can't register rteth0.
Then I looked into rtnet script and did some minor change. In the script it requires physical ethernet device ID (mentioned in REBIND_RT_NICS), so I tried to find out what it is and got this when make eth0 up with non real-time driver:
"eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=1:06, irq=-1)
PHY: 1:06 - Link is Up - 1000/Full "
I think 1:06 is my physical bus ID, then I change the code in rtnet from:
for dev in $REBIND_RT_NICS; do
if [ -d /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
echo $dev > /sys/bus/pci/drivers/$RT_DRIVER/bind
done
To
echo 1:06 > /sys/bus/mdio_bus/drivers/Micrel\ KSZ9021\ Gigabit\ PHY/unbind
echo 1:06 > /sys/bus/platform/drivers/rt_fec/bind
And I tried again with "./rtnet start", this time I got this:
RTnet: initialising real-time networking
RT FEC Ethernet Driver
sh: write error: No such device
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device
But it still said "No such device"
This is lsmod after I ran ./rtnet start
lsmod
Module Size Used by Not tainted
tdma 25691 0
rtmac 9724 1 tdma
rtcfg 58071 0
rtcap 7151 0
rt_loopback 1279 2
rtpacket 6365 0
rtudp 10738 0
rt_fec 12742 0
rtipv4 29987 2 rtcfg,rtudp
rtnet 40746 9 tdma,rtmac,rtcfg,rtcap,rt_loopback,rtpacket,rtudp,rt_fec,rtipv4
./rtifconfig
rtlo Medium: Local Loopback
IP address: 127.0.0.1
UP LOOPBACK RUNNING MTU: 1500
Only rtlo is registered.
I also tried with kernel linux without non real-time FEC driver (please refer in another config file in attached Skydrive link), but still the same issue happened.
Do you have any idea how to solve this issue? I did many search but still can not figure out how to fix it.
Because I can't attach the files to my post, so I put all of my configuration files in the link below:
https://onedrive.live.com/redir?resid=162EDF85AEBD2EFE!717&authkey=!AJ1Fjd_XiohUwes&ithint=file%2czip
Best Regards,
Nguyen Hung Son