lakinduakash / linux-wifi-hotspot

Feature-rich wifi hotspot creator for Linux which provides both GUI and command-line interface. It is also able to create a hotspot using the same wifi card which is connected to an AP already ( Similar to Windows 10).
BSD 2-Clause "Simplified" License
3.07k stars 283 forks source link

Unable to build on Manjaro #68

Closed alsoGAMER closed 3 years ago

alsoGAMER commented 3 years ago

Describe the bug I'm unable to build this tool from source

To Reproduce Steps to reproduce the behavior:

  1. Run 'yay -Sy linux-wifi-hotspot'
  2. Install all the required dependencies
  3. Wait for make to start
  4. See error

Expected behavior The program compiles fine

Desktop (please complete the following information):

Terminal output

==> Starting build()...
mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/ag/.cache/yay/linux-wifi-hotspot/src/linux-wifi-hotspot-3.0.0/src'
/usr/bin/glib-compile-resources ui/glade/wifih.gresource.xml --target=ui/resources.c --sourcedir=ui/glade --generate-source
gcc -c -o ../build/main.o ui/main.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/ui.o ui/ui.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/h_prop.o ui/h_prop.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/util.o ui/util.c `pkg-config --cflags gtk+-3.0`
g++ -c -o ../build/read_config.o ui/read_config.cpp
make[1]: *** No rule to make target '../build/resources.o', needed by '../build/wihotspot-gui'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/ag/.cache/yay/linux-wifi-hotspot/src/linux-wifi-hotspot-3.0.0/src'
make: *** [Makefile:5: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error making: linux-wifi-hotspot
lakinduakash commented 3 years ago

Can you check whether there is a generated file called resources.c in src/ui/ folder?

It seems like the corresponding object file build/resources.o is not generated. But in ubuntu there is no such issue. That's strange.

lakinduakash commented 3 years ago

Also can you try without using yay?

Use git clonehttps://github.com/lakinduakash/linux-wifi-hotspot and then

cd linux-wifi-hotspot && make && sudo make install

alsoGAMER commented 3 years ago

Can you check whether there is a generated file called resources.c in src/ui/ folder?

Yes, there is that file image

alsoGAMER commented 3 years ago

Also can you try without using yay?

Use git clonehttps://github.com/lakinduakash/linux-wifi-hotspot and then

cd linux-wifi-hotspot && make && sudo make install

Sure, wait a minute

alsoGAMER commented 3 years ago

Also can you try without using yay?

Use git clonehttps://github.com/lakinduakash/linux-wifi-hotspot and then

cd linux-wifi-hotspot && make && sudo make install

Doing this manually fixed the issue

Make output:

mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/ag/src/linux-wifi-hotspot/src'
/usr/bin/glib-compile-resources ui/glade/wifih.gresource.xml --target=ui/resources.c --sourcedir=ui/glade --generate-source
gcc -c -o ../build/main.o ui/main.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/ui.o ui/ui.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/h_prop.o ui/h_prop.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/util.o ui/util.c `pkg-config --cflags gtk+-3.0`
g++ -c -o ../build/read_config.o ui/read_config.cpp
gcc -c -o ../build/resources.o ui/resources.c `pkg-config --cflags gtk+-3.0`
gcc -o ../build/wihotspot-gui ../build/main.o ../build/ui.o ../build/h_prop.o ../build/util.o ../build/read_config.o ../build/resources.o `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0 --libs x11` -lstdc++
make[1]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src'

Make install output:

Installing...
cd src && make install
make[1]: Entering directory '/home/ag/src/linux-wifi-hotspot/src'
mkdir -p /usr/share/"wihotspot"
install -Dm644 desktop/hotspot.png /usr/share/"wihotspot"/hotspot.png
install -Dm644 desktop/wifihotspot.desktop /usr/share/"wihotspot"/"wihotspot".desktop
install -Dm644 desktop/wifihotspot.desktop /usr/share/applications/"wihotspot".desktop
install -Dm755 ../build/wihotspot-gui /usr/bin/"wihotspot-gui"
cd scripts && make install
make[2]: Entering directory '/home/ag/src/linux-wifi-hotspot/src/scripts'
install -CDm755 create_ap /usr/bin/create_ap
install -CDm644 create_ap.conf /etc/create_ap.conf
[ ! -d /lib/systemd/system ] || install -CDm644 create_ap.service /usr/lib/systemd/system/create_ap.service
install -CDm644 bash_completion /usr/share/bash-completion/completions/create_ap
install -CDm644 README.md /usr/share/doc/create_ap/README.md
install -CDm755 wihotspot /usr/bin/wihotspot
make[2]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src/scripts'
make[1]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src'
lakinduakash commented 3 years ago

Also can you try without using yay? Use git clonehttps://github.com/lakinduakash/linux-wifi-hotspot and then cd linux-wifi-hotspot && make && sudo make install

Doing this manually fixed the issue

Make output:

mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/ag/src/linux-wifi-hotspot/src'
/usr/bin/glib-compile-resources ui/glade/wifih.gresource.xml --target=ui/resources.c --sourcedir=ui/glade --generate-source
gcc -c -o ../build/main.o ui/main.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/ui.o ui/ui.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/h_prop.o ui/h_prop.c `pkg-config --cflags gtk+-3.0`
gcc -c -o ../build/util.o ui/util.c `pkg-config --cflags gtk+-3.0`
g++ -c -o ../build/read_config.o ui/read_config.cpp
gcc -c -o ../build/resources.o ui/resources.c `pkg-config --cflags gtk+-3.0`
gcc -o ../build/wihotspot-gui ../build/main.o ../build/ui.o ../build/h_prop.o ../build/util.o ../build/read_config.o ../build/resources.o `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0 --libs x11` -lstdc++
make[1]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src'

Make install output:

Installing...
cd src && make install
make[1]: Entering directory '/home/ag/src/linux-wifi-hotspot/src'
mkdir -p /usr/share/"wihotspot"
install -Dm644 desktop/hotspot.png /usr/share/"wihotspot"/hotspot.png
install -Dm644 desktop/wifihotspot.desktop /usr/share/"wihotspot"/"wihotspot".desktop
install -Dm644 desktop/wifihotspot.desktop /usr/share/applications/"wihotspot".desktop
install -Dm755 ../build/wihotspot-gui /usr/bin/"wihotspot-gui"
cd scripts && make install
make[2]: Entering directory '/home/ag/src/linux-wifi-hotspot/src/scripts'
install -CDm755 create_ap /usr/bin/create_ap
install -CDm644 create_ap.conf /etc/create_ap.conf
[ ! -d /lib/systemd/system ] || install -CDm644 create_ap.service /usr/lib/systemd/system/create_ap.service
install -CDm644 bash_completion /usr/share/bash-completion/completions/create_ap
install -CDm644 README.md /usr/share/doc/create_ap/README.md
install -CDm755 wihotspot /usr/bin/wihotspot
make[2]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src/scripts'
make[1]: Leaving directory '/home/ag/src/linux-wifi-hotspot/src'

Great! I exactly don't know what does happen with yay command with the above flags. Need to investigate more about this.

alsoGAMER commented 3 years ago

Update: after compiling this program, I've noted 2 minor (pretty graphical) issues and one major issue:

First: The hotspot doesn't start, even after I gave the program root privileges (as it requested them while starting up). Edit: By running from the terminal, this error comes out: ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time, so it a limitation of my wireless card I think. For your knowledge, I have a Ralink wifi card, more specifically, this one: RT3290

Second: The window name is pretty bad image

Third: There isn't any icon in the taskbar/dock, so my DE defaults to the Xorg fallback icon image

lakinduakash commented 3 years ago

I think your either wifi adapter or wifi driver does not support the ap mode. If wifi-adapter supports ( check from windows 10 if you have) that's a limitation of the driver. I don't know any alternative driver for that. But you can try it by searching.

Second: The window name is pretty bad

Yes!. I know that. I will change that. :+1:

Third: There isn't any icon in the taskbar/dock, so my DE defaults to the Xorg fallback icon

This is also needed to be fixed. I'm currently not having manjaro distro. So it is pretty hard to test that. If you are willing to contribute, you are welcome. :)

alsoGAMER commented 3 years ago

I think your either wifi adapter or wifi driver does not support the ap mode. If wifi-adapter supports ( check from windows 10 if you have) that's a limitation of the driver. I don't know any alternative driver for that. But you can try it by searching.

I'll search on the arch wiki, but no, I don't use windows cause it sucks

Second: The window name is pretty bad

Yes!. I know that. I will change that. +1

Great!

Third: There isn't any icon in the taskbar/dock, so my DE defaults to the Xorg fallback icon

This is also needed to be fixed. I'm currently not having manjaro distro. So it is pretty hard to test that. If you are willing to contribute, you are welcome. :)

Sadly I'm not a C/C++ dev, so I don't know how to help you... But you can check here to see how you can probably do this.

lakinduakash commented 3 years ago

Thanks!

are you a GAMER with arch-linux? wonderful. Just kidding.

Have a nice day anyway :)

alsoGAMER commented 3 years ago

Thanks!

are you a GAMER with arch-Linux? wonderful. Just kidding.

Lmao, not quite tho, sadly I haven't good hardware in my laptop so I can't play games that are very resource-intensive, but yes, sometimes I play games with Arch.

Have a nice day anyway :)

Same for you :)

marchingon12 commented 3 years ago

I came accross the same issue but since I couldn't build it natively using pamac, I cloned the repo and built it myself. However, it doesn't seem to work...

  1. Frequency band set to Auto did not work. Loaded for a bit then went back to 'Not running'. image
    
    pkexec --user root create_ap wlp3s0 lo 'lolipop123' 'loliboi123' --mkconfig /etc/wh.config 
    Config options written to '/etc/wh.config'

ERROR: Your adapter can not transmit to channel 1, frequency band 5GHz.

2. Frequency band set to 2.4Ghz. Loaded, but SSID can't be seen on any devices.
![image](https://user-images.githubusercontent.com/41235480/95028140-a72f9180-068d-11eb-9d08-382c27eceda1.png)
```bash
pkexec --user root create_ap wlp3s0 lo 'lolipop123' 'loliboi123' --mkconfig /etc/wh.config --freq-band 2.4 
Config options written to '/etc/wh.config'
Trying to kill create_ap instance associated with 38678...
  1. Frequency band set to 5Ghz. 'Not running expected since my wifi card probably does not support 5Ghz. image
    pkexec --user root create_ap wlp3s0 lo 'lolipop123' 'loliboi123' --mkconfig /etc/wh.config --freq-band 5 
    Config options written to '/etc/wh.config'
    ERROR: Your adapter can not transmit to channel 36, frequency band 5GHz.

    All scenarios are the same with or without password (open).

image

lakinduakash commented 3 years ago

@marchingon12

You have set the internet interface as the loopback device. Change it to your same wifi adapter or ethernet device.

Also, can you try executing these commands and check whether AP appears on other devices. (In following commands second wlp3s0 is the internet interface)

sudo create_ap --ieee80211n --ht_capab '[HT40+]' --freq-band 2.4 wlp3s0 wlp3s0 YourSSID MyPassPhrase

And

sudo create_ap --ieee80211ac --freq-band 2.4 wlp3s0 wlp3s0 YourSSID MyPassPhrase

Any of these works?

marchingon12 commented 3 years ago

You have set the internet interface as the loopback device. Change it to your same wifi adapter or ethernet device.

That indeed I did, but I also tried wl3sp0 first, but it didn't work either.

Both commands work flawlessly, there is stable internet connection and devices can connect. But it still doesn't work on GUI, from previous steps.

lakinduakash commented 3 years ago

@marchingon12 The reason for not working from GUI is it does not include ieee80211n or ieee80211ac options. For a temporary fix, you can modify line https://github.com/lakinduakash/linux-wifi-hotspot/blob/5599e6fb824dd63a6cd94a914ae32d6f20503dc6/src/ui/h_prop.c#L101 as snprintf(cmd_mkconfig, BUFSIZE, "%s %s %s %s '%s' '%s' %s %s --ieee80211ac",SUDO, CREATE_AP, cv->iface_wifi, cv->iface_inet, cv->ssid, cv->pass,MKCONFIG,a);

Uninstall the current program and rebuild it and then install it.

I will add GUI option to select ieee80211n or ieee80211ac

lakinduakash commented 3 years ago

Icon issue and including ieee80211n options are fixed.