1

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.

Solve v2: 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.

Script:

#!/bin/sh
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.

Example

  1. Raspi power up
  2. XYZ Wifi network appear
  3. PC connect to XYZ network
  4. Raspi run script for reset ethernet connection
  5. 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!

Marek

1 Answer 1

0

Ok, I found a solution for my problem in services. It's not working after connection to wifi but after full boot system complete.

I built script which turn off and on eth0 and run it by service, which I wrote after properly boot system and run all of services.

Services you can find in /lib/systemd/system folder and you choose by after which service you want to run your service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.