PyQt application getting stuck on Raspberry pi while running multiple threads - multithreading

I have created a PyQt based application running on raspberry pi which takes input from sensors. The application was running perfectly before adding threads, but now while running the application it gets stuck at different interfaces. I am using QThreads. Can anybody help?
Thanks.

Related

What would be the recommended way to exchange data from a WebGL application running on a Raspberry Pi to write to the Pi's serial interface?

Here's the full problem:
I have a WebGL build of a Unity project running on a Pi, and I need the data from this process written to the Pi's serial interface (and vice versa). The best possible solution I can think of is hosting the WebGL server using Express, and utilizing nodejs for the backend process of somehow running some python code that works the serial interface. Problem is, I'm super inexperienced with these platforms and I don't have enough familiarity with how they all work together to intuitively feel out what to do. Hoping I can get some guidance on any recommended paths.
Pre answered questions:
Unity project on a Pi?: I have a simulation running in Unity, and I need it running on a lightweight computing platform. The only way to run this on a Pi is in a WebGL build.
What are you trying to achieve?: I'm trying to achieve a communication pipeline with this WebGL process and an Arduino, specifically over serial.
What I've tried:
I've tried running the WebGL process utilizing systems like Banyan, which would allow communication with a server, but it seems the WebGL build does not allow sockets.
I've tried hosting the server using Express through nodejs, and the app does actually work, I just need help understanding how this system works such that I can exchange data from the WebGL app and a python script that is running the serial comms. As stated above, I'm very new to the nodejs system so I may not even be using the nomenclature properly.

Can i run a second web server?

So i own a raspberry pi server which runs a python web server i want to run a second web server on the pi but im not sure if it can handle it.
Raspberry pi 2 model B,
Python 3,
Ubuntu Software,
Short answer: Yes, you can.
Long answer: It depends on what your web servers will be doing and how good your internet is. I have a RasPi 4 running OctoPrint, a few bots and some other misc. stuff. Also, you may run into problems along the lines of your web servers trying to listen for connections on the same port, which is another problem outside the scope of your initial question.

Raspberry Pi Zero W going to sleep

I have a small project using a Raspberry Pi Zero W. This is just a small Node.js server that I would like to be running at all times. I am using Raspberry Pi OS Lite (no desktop)
The whole thing works perfectly fine but after some time, let's say one night of no use, it stops working, until the Pi is rebooted.
I am thinking if there is any sleep mode that I am not aware of and, if that is the case, how to disable it. If not the case, I would like to hear about other possible root causes.
On the RPi Zero-W, go to Raspi Configuration --> Display option. Then disable screen blanking.

Python3 - Some of threads stop suddenly without any logs/messages

I am working on a python project on Raspberry Pi. After the last release, some of our devices have a problem. Project includes two parts, camera and BLE. At first, these two parts were in seperate projects, they were running under different systemd services. In the latest release, I combined these two into one project. I am creating two processes using the multiprocess module and create threads under these processes. In the previous version, I was just creating threads and starting them. But now, some of the threads from the BLE part stuck at a point and stop working-without any error logs/messages. Especially BLE scan thread from the BLE process doing this. These two projects were running under two systemd services without a problem for a month. I could not figure out what is causing the problem.
I tried increasing the stack sizes of threads, cancelling the multiprocess part and using only threads as in the previous version but none of them was a solution. There is no major differences between versions, functions, modules, pip package versions are all the same. In the previous situation, one of the service running a 5-thread project and the other one running 10-thread project. Now I have one service running a python program includes 15-threads.
Platform: Raspbian Stretch -Raspbian Buster (both)
Python version: 3.5 (Stretch) - 3.7 (Buster) (both)
Important modules used in camera part: opencv-contrib-python(3.4.3.18), picamera(1.13)
Important modules used in BLE part: bluepy(1.3.0)
Feel free to ask further questions.

Raspberry Pi: start pyqt application without LXDE

I made a fullscreen GUI application using PYQT4. It is the only thing Raspberry Pi is going to be used for. Is there a way of starting it after boot, without starting unnecessary Raspbian GUI? It uses gpio signals and uinput so it should be run as root.

Resources