It is a bit unclear how do you want to connect the Laptop to the Raspberry Pi. I will assume that there is no other wifi router as access point running for example to connect to the internet so you want to connect to the RasPi direct by wifi. You tagged a bridge so it is possible to bridge the wired interface eth0 to wifi interface wlan0. If you setup the RasPi as an access point then the Laptop can connect to it as station and with the bridge it should be able to access the Micron optics sm130 device.
Here is a diagram of the setup:
RPi
wifi ┌──────bridge──────┐ wired
laptop <.~.~.~> │(wlan0) br0 (eth0)│ <-------> sensor
\ / /
10.0.0.12 10.0.0.13 10.0.0.126
For reference I use Raspbian Stretch Lite 2019-04-08 updated with sudo apt update && sudo apt full-upgrade && sudo reboot
on 2019-04-14. I use systemd-networkd to configure this so we have first switch over to it.
♦ Switch over to systemd-networkd
For detailed information look at (1). Here only in short. Execute these commands:
# disable classic networking
rpi ~$ sudo -Es
rpi ~# systemctl mask networking.service
rpi ~# systemctl mask dhcpcd.service
rpi ~# mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf
# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service
rpi ~# systemctl enable systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
♦ Configure wpa_supplicant as access point
To configure wpa_supplicant as access point create this file with your settings for country=
, ssid=
, psk=
and maybe frequency=
You can just copy and paste this in one block to your command line beginning with cat
and including EOF (delimiter EOF will not get part of the file):
rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="RPiNet"
mode=2
key_mgmt=WPA-PSK
proto=RSN WPA
psk="password"
frequency=2437
}
EOF
rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl enable [email protected]
♦ Setting up an access point with a bridge
Create the following three files to configure eth0 and br0.
rpi ~# cat > /etc/systemd/network/02-br0.netdev <<EOF
[NetDev]
Name=br0
Kind=bridge
EOF
rpi ~# cat > /etc/systemd/network/04-br0_add-eth0.network <<EOF
[Match]
Name=eth0
[Network]
Bridge=br0
EOF
rpi ~# cat > /etc/systemd/network/12-br0_up.network <<EOF
[Match]
Name=br0
[Network]
Address=10.0.0.13/24
EOF
Now we have to tell wpa_supplicant to use a bridge by adding the option -bbr0
when invoking it. We do it by modifying its service with:
rpi ~# systemctl edit [email protected]
In the empty editor insert these statements, save them and quit the editor. The empty ExecStart=
is important. This will clear the original call so we can set it new:
[Service]
ExecStartPre=/sbin/iw dev wlan0 set type __ap
ExecStartPre=/bin/ip link set wlan0 master br0
ExecStart=
ExecStart=/sbin/wpa_supplicant -bbr0 -c/etc/wpa_supplicant/wpa_supplicant-%I.conf -Dnl80211,wext -i%I
ExecStopPost=-/bin/ip link set wlan0 nomaster
ExecStopPost=-/sbin/iw dev wlan0 set type managed
Reboot.
That's it.
This is a specific and simplified subset for you from (2).
references:
[1] Howto migrate from networking to systemd-networkd with dynamic failover
[2] Setting up a Raspberry Pi as an access point - the easy way
10.0.0.x
IP on it?