jokob-sk / NetAlertX

🖧🔍 WIFI / LAN intruder detector. Scans for devices connected to your network and alerts you if new and unknown devices are found.
GNU General Public License v3.0
3.13k stars 187 forks source link

ERROR: Failed building wheel for aiohttp (baremetal on pizeroW Bookworm) #877

Closed smithbill17 closed 1 week ago

smithbill17 commented 2 weeks ago

Is there an existing issue for this?

The issue occurs in the following browsers. Select at least 2.

Current Behavior

Downloaded a fresh image of Raspberry Pi OS Lite (port of Debian Bookworm 32bit) for Raspberry Pi Zero W.

Ran the wget installation script & after sometime it fails "building wheel for aiohttp"

Fatal error: Python.h: no such file or directory

Expected Behavior

Installation should complete without errors

Steps To Reproduce

Re-running the install process generates the same fatal error.

app.conf

No response

docker-compose.yml

No response

What branch are you running?

Production

app.log

No response

Debug enabled

smithbill17 commented 2 weeks ago

It may be that 32bit port of Bookworm on Pi Zero W simply isn't supported, but I thought I would try as I had the Pi Zero W doing nothing.

Google seems to suggest the issue might be to do with versions of Python & aiohttp, but I didn't know how to resolve that.

If the issue isn't fixable or it's an unsupported environment, then feel free to close this issue.

(sorry, I wasn't able to capture logs or other data)

jokob-sk commented 2 weeks ago

Hi @smithbill17 ,

I don't own a PiZero W so I unfortunately can't reproduce the issue. The HW install is experimental and I'm relying on the community to help me support it.

I sporadically test the install on a virtual debian machine, where the installation seems to succeed.

I'll keep the issue open for a week and see if someone can help out. Feel free to submit a PR fixing the issue as well.

Thanks, j

smithbill17 commented 2 weeks ago

Sorry I wasn't able to get any logs. The attached screen capture is the best I could do.

I might try again with a fresh install of Raspberry OS Buster, but I'm not sure if I'll just hit the same issue as it's to do with package versions & the fact Pi Zero W is 32bit?

I'm assuming Pi Zero W is too 'feeble' to run the Docker version? IMG_20241105_150121~2

jokob-sk commented 2 weeks ago

Humm, this is what I got from ChatGPT:

This issue likely stems from missing development headers for Python on your Raspberry Pi OS Lite, as the absence of Python.h typically indicates that the Python development package isn’t installed. Here’s how you can try to resolve it:

Install Python Development Headers
Run the following to install the Python development headers, which are often required for compiling packages like aiohttp:

sudo apt update
sudo apt install python3-dev

Ensure Required Build Tools Are Installed You might also need build tools like gcc and build-essential if they aren’t already installed:


    sudo apt install build-essential
Retry the Installation
With these dependencies installed, try running the installation script again.

If you still encounter compatibility issues, it could indeed be due to the limitations of the 32-bit Bookworm port on the Pi Zero W. While Bookworm should generally support Python packages, certain modules or dependencies might not fully work on this setup due to the hardware and OS combination.

smithbill17 commented 2 weeks ago

I tried again with a fresh install of Raspberry Pi OS Lite (port of Debian Bookworm 32bit) for Raspberry Pi Zero W and before trying to install NetAlertX I executed the following commands:

sudo apt update
sudo apt upgrade -y

sudo reboot

sudo apt install python3-dev
sudo apt install build-essential

sudo reboot

I then started the install/build with

wget https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/install/install.debian.sh -O install.debian.sh && sudo chmod +x install.debian.sh && sudo ./install.debian.sh

which after some time 'froze' with the output from systemd as shown in the attached screen capture. I could not terminate the process or SSH or login from the console. I had to pull the power plug on the Raspberry Pi.

Once rebooted I began the install/build process again, which this time seemed to eventually complete and appeared to go straight into running avahi & nslookup scans. However, I got nothing when trying to browse to http://ipaddress:20211 although nginx did appear to be running on http://ipaddress okay.

Eventually I terminated the running avahi/nslookup process and rebooted the Raspberry Pi Zero. After restarting the Pi, I was able to browse to http://ipaddress:20211 successfully.

So I went to NetAlertX > Settings & updated the 'Networks to scan' and TimeZone and clicked Save and then it seemed to become 'stuck' again (top-right indicates 'Process: Wait') and I could not re-load the Settings page - once again I had to reboot the Raspberry Pi.

On restarting again, everything seems to be working, but NetAlertX doesn't discover any devices and quite often reports 'Process: Wait' for lengthy periods, but I'm assuming this is due to the Raspberry Pi Zero W being somewhat underpowered for the task. I'll see if I can figure out why none of my devices are discovered.

As NetAlertX installed okay after installing the python3-dev & build-essential packages, I think this issue can be closed.

IMG_20241106_072407~2

smithbill17 commented 2 weeks ago

Incidentally, if I run

/app/install/start.debian.sh

as mentioned on the Hardware install under 'Limitations' it seems to restart installing and always reports:

E: Unable to locate package php-openssl E: Unable to locate package avahi E: Unable to locate package avahi-tools

If i try apt installing these packages, they aren't found. But this doesn't seem to prevent NetAlertX running.

jokob-sk commented 2 weeks ago

Hi @smithbill17 ,

Glad to hear there is progress.

The avahi packages are used for the AVAHISCAN, which can be disabled if needed. Is used for name discovery, but there are other name discovery plugins available as well.

The php-openssl is used in the sync plugin in case you want to synchronize multiple NetAlertX instances, but again, it's not necessary for core functionality if you keep it disabled.

Lastly, I'm surprised it's running on a PiZero even in this state. You can then increase the intervals between scans, disable (and unload) unused plugins, limit the amount of retained data to keep the performance in check. You can find more pointers here:

https://github.com/jokob-sk/NetAlertX/blob/main/docs/PERFORMANCE.md

Hope the above helps, j

jokob-sk commented 1 week ago

Closing as resolved