I was searching answer from over a week and still don't find it. I'm fresh user of raspi and linux and network config so be patient for my stupid questions :) I describe my problem.
I used raspi to made bridge eth0 wlan0 for make wireless communication with special device connected to this eth raspi port. Raspi has lite ssh version of system bullseye.
For configuration I used that solve from link: https://forums.raspberrypi.com/viewtopic.php?t=193770&sid=f66d660554e65dd9da34e49a61cd0bad&start=25
Additional info, raspi is not power up all time, I power up it only when I need to communicate with eth device, for example once per day.
Everything run properly, but not for 100%. Problem is on start raspi, someway I can't to connect by special program for diagnostic to my device. If I connect to raspi wlan by PC, I can see using
arp -a command ip of my device, I can ping it well, but when I try to connect that IP by my app is some communication problem.
Solve of this is just unplug ethernet cable and plug it again, then raspi again assign ip do device (static ip) and I can connect to my device normaly.
I made script for manual reset function for eth port in raspi. Script run after wifi net from raspi start (
/etc/network/if-up.d/my_script.sh). Script has permission by chmod command.
This way works 50/50, scripts always run correct (I can see it by 2 led on eth port),but it's not working always.
sudo ip link set eth0 down && sudo ip link set eth0 up
So I want, but don't know how, to make script which is running by event for connect some device to raspi wlan network.
- Raspi power up
- XYZ Wifi network appear
- PC connect to XYZ network
- Raspi run script for reset ethernet connection
- After estabilish connection PC -><- Raspi user connect to by app to device
Also maybe it's important, Raspi and that specific device is power up at the same time, because is wired to the same step-down converter from 13V to 5V.
So is someone knows some way to config/ some app for event how to monitor wifi connections to raspi. Second idea is some way for delay script run for a few seconds which is start after wlan start. Maybe that's help...
I'll grateful for any answer which could help! Have a nice day!