Wifi disconnects when I run my python script

Hello, I have simple python script to control a servo motor using ros pub/sub . Whenever I run the file, the wifi disconnects. As a result I loose my connection to the ssh. The script itself is not having anything that would interfere with the network settings.
We are using RPi 4 with Ubiquity Image.

Please tell me the main MCB board revision printed on left edge. Then if it is a rev 5.3 tell me if you see written on the right side in the white strip something like MOD5V or ANY writing with black sharpie.

What I suspect is your Pi4 or the servo is doing a current surge then the Pi4 reboots… We have bumpted up the power to the Pi4 to 5.1V but only if above ‘MOD5V’ is written on the board and it has to be a Magni from the last few months for that to be the case.

Also explain to me how you are powering up that servo (what power supply from MCB?).

Lastly tell me what GPIO lines may be involved in your code. Thanks

Kinda confused what you mean by MCB.
One thing is that Pi doesn’t reboot. We connected a display and tested the code. Only wifi disconnects.
We are driving the servo using external batteries. We are using Pin 6,12,13 and 9 in BCM mode as signals for servos.

Sorry about that. On our product the large blue board right in the front is the ‘MCB’. This stands for Main Control Board but sometimes it gets called Motor Control Board. This is the board the Raspberry Pi plugs into and it has a bunch of leds on it. What we call the ‘Switch Board’ is the small board with 2 switches on it that plugs into the MCB.

But what I am trying to say is if your MCB still supplies 5V to the Raspberry Pi that is one possible reason. The other reason is we have seen in the past from time to time WiFi failures on Raspberry Pi units. Not real common but it has been seen.

As far as GPIO lines, can you please look at GPIO Lines | Learn Ubiquity Robots and ROS ?
This page is where I try to list all the lines we do use and I also explain some ways to turn off usage of some of the lines. A couple of the lines are WiFi related but I don’t have an exact reason to know why your software is impacting them. Most of the time it is best for users to NOT use the Sonar board and disable it and in this way, quite a few lines are available for their usage but of course no Sonar board can be used in that case.

Pay attention to the middle of that page where we show usage of GPIO 6 and GPIO 13. Because I also list the Raspberry Pi connector pins you should be able to determine between the two schemes used for GPIO pins and verify the BCM mode pins you use by using raspberry Pi pin numbers I give.

We are not using Ubiqulity board. We have flashed the image in sd card and used it on RPi.
Anyways, the problem was solved when we used pigpio to control the servo motors. We used the same pins as before just used pigpio.

If you are not using a Magni this page is something I wrote up for that very reason: