Giter Club home page Giter Club logo

lakinduakash / linux-wifi-hotspot Goto Github PK

View Code? Open in Web Editor NEW
3.1K 41.0 283.0 1.32 MB

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).

License: BSD 2-Clause "Simplified" License

Makefile 3.68% Shell 41.82% CMake 2.02% C 45.17% C++ 6.77% CSS 0.21% Dockerfile 0.34%
wifi-hotspot linux ubuntu gtk3 shell-script network wifi wifi-adapter linux-wifi-hotspot internet

linux-wifi-hotspot's Introduction

Linux Wifi Hotspot

Build Gitter FOSSA Status

What's new

  • Use aa-complain instead of complain to fix the permission issue for dnsmasq
  • Fix some 5Ghz band not working issue
  • Compatible with iw 6.7

Thank you for all the contributions made while I was not active on this repository.

Features

  • Share your wifi like in Windows - Use wifi and enable hotspot at the same time.
  • Share a wifi access point from any network interface
  • Create a hotspot with VPN - The hotspot has the traffic tunnelled through VPN. Useful for devices with no VPN app support like TV or gaming consoles.
  • Share wifi via QR code
  • MAC filter
  • View connected devices
  • Includes Both command line and GUI.
  • Support both 2.4GHz and 5GHz (Need to be compatible with your wifi adapter). Ex: You have connected to the 5GHz network and share a connection with 2.4GHz.
  • Customise wifi Channel, Change MAC address, etc.
  • Hide SSID
  • customize gateway IP address
  • Enable IEEE 80211n, IEEE 80211ac and IEEE 80211ax modes

screenshot

Command line help and documentation

Read Command line help and documentation here.

If you only need the command line without GUI run make install-cli-only as the root user.

Notes

  • Sometimes there are troubles with 5Ghz bands due to some vendor restrictions. If you cannot start the hotspot while you are connected to the 5Ghz band, Unselect Auto and select 2.4Ghz in frequency selection.

  • If any problems with RealTeK Wifi Adapters see this

  • Unable to allocate IP: firewalld issue: Please check for potential fixes: #209 #166

Installation

Debian/Ubuntu

Download the Debian package from the latest release

OR Good news! I was able to restore keys, new versions will be available via the PPA

sudo add-apt-repository ppa:lakinduakash/lwh
sudo apt update
sudo apt install linux-wifi-hotspot

Arch based distributions

Linux Wifi Hotspot is available as an AUR package. You can install it manually or with your favorite AUR helper. For example, if you use yay you can do: yay -S linux-wifi-hotspot

Dependencies

General

  • bash
  • util-linux (for getopt)
  • procps or procps-ng
  • hostapd
  • iproute2
  • iw
  • iwconfig (you only need this if 'iw' can not recognize your adapter)
  • haveged (optional)

Make sure you have those dependencies by typing them in terminal. If any of dependencies fail install it using your distro's package manager

For 'NATed' or 'None' Internet sharing method

  • dnsmasq
  • iptables

To build from source

  • make
  • gcc and g++
  • build-essential
  • pkg-config
  • gtk
  • libgtk-3-dev
  • libqrencode-dev (for qr code generation)
  • libpng-dev (for qr code generation)

On Ubuntu or Debian install dependencies by,

sudo apt install -y libgtk-3-dev build-essential gcc g++ pkg-config make hostapd libqrencode-dev libpng-dev

On Fedora/CentOS/Red Hat Enterprise Linux/Rocky Linux/Oracle Linux

sudo dnf install -y gtk3-devel gcc gcc-c++ kernel-devel pkg-config make hostapd qrencode-devel libpng-devel

Installation

git clone https://github.com/lakinduakash/linux-wifi-hotspot
cd linux-wifi-hotspot

#build binaries
make

#install
sudo make install

Uninstallation

sudo make uninstall

Running

You can launch the GUI by searching for "Wifi Hotspot" in the Application Menu or using the terminal with:

wihotspot

Create VPN Hotspot

After connecting to VPN, Open wihotspot GUI. Select the virtual interface created by the VPN. In this case it is tun0

image

Run on Startup

The wihotspot GUI uses create_ap to create and manage access points. This service and core logic were originally created by @oblique, and are now maintained in this repository.

Start the hotspot service on startup (using your saved configuration) with:

systemctl enable create_ap

Contributing

If you found a bug or you have an idea about improving this make an issue. Even a small contribution makes the open source world more beautiful. Please read CONTRIBUTING.md for more info.

Disclaimer

Icons made by Freepik from www.flaticon.com

Stargazers over time

Stargazers over time

License

FreeBSD

Copyright (c) 2013, oblique

Copyright (c) 2024, lakinduakash

FOSSA Status

linux-wifi-hotspot's People

Contributors

aluyas avatar catty2014 avatar cnjhb avatar ctjlewis avatar fossabot avatar freddii avatar haoyun avatar joanbm avatar kaovilai avatar kevinhikaruevans avatar lakinduakash avatar llyram avatar luciogi avatar mathiassmichno avatar miepee avatar nexround avatar nhellfire avatar oddlama avatar p00chie avatar ryuuzaki42 avatar safocl avatar shrirajhegde avatar sigmasd avatar simonbru avatar snhardin avatar souhaib100 avatar tipex360 avatar yochananmarqos avatar zacktamondo avatar zedeldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-wifi-hotspot's Issues

ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time

Please help me
A clear and concise description of what the bug is.
nizam@Nizam:~$ sudo wihotspot
[sudo] password for nizam:
create_ap wlp2s0 wlp2s0 COMXIPAD jenengmu --mkconfig /home/nizam/.wh.config --mac aa:aa:aa:aa:aa:aa
Config options written to '/home/nizam/.wh.config'
ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time
Command not found or exited with error status

Issues running the GUI with root

Describe the bug
The desktop file attempts to use pkexec and sudo at the same time and fails.

To Reproduce
Use the desktop shortcut / command

Expected behavior
...

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Version: GNOME 3.36.2

Additional context

$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY sudo /usr/bin/wihotspot
create_ap wlan0 wlan0 test  --mkconfig /root/.wh.config -c 1 
Config options written to '/root/.wh.config'
$ wihotspot 
Couldn't open config file for reading.
You must run it as root.
Command not found or exited with error status
create_ap wlan0 wlan0 test  --mkconfig /home/yochanan/.wh.config 

This is the issue with running a GUI as root. What are you doing using pkexec and sudo in the same command?

The config file was not written at all. Config files should be something like, /etc/wihotspot/wh.conf or ~/.config/wihotspot/wh.conf.

It also cannot create a hotspot, but I'm not going to troubleshoot further as I'm stopping right here and won't attempt to use this program until the original issue is fixed.

Hidden checkbox does not seem to hide the network

Describe the bug
create_ap should be called with the --hidden flag when the Hidden checkbox of the GUI is checked.

To Reproduce
Steps to reproduce the behavior:

  1. configure a network in the GUI
  2. check the Hidden checkbox
  3. Create the hotspot
  4. check on other device if the network is visible or hidden : yes
  5. check options used to launch create_ap : not --hidden

Expected behavior

create_ap should be called with the --hidden flag.

Manually calling sudo create_ap --config /etc/wh.config --hidden does the job.

Desktop :

  • OS: Ubuntu 18.04
  • Version: linux-wifi-hotspot 3.0.0

Changing WiFi interface

Feature: Add wlan1 to WiFi interface.
I would like to use my USB WiFi adapter (wlan1) to create a WiFi hotspot while still being connected via wlan0. (for my raspberry pi 4 model B)

create_ap script stuck in unmanaged verification

Bug description
When I executed the command create_ap wlan0 wlan0 'wifiSSID' 'passworD' the script stuck in the unmanaged verification.

# Debug with "bash -x"
[...]
+ networkmanager_iface_is_unmanaged ap0
+ is_interface ap0
+ [[ -z ap0 ]]
+ [[ -d /sys/class/net/ap0 ]]
+ networkmanager_knows_iface ap0
+ nmcli -t -f DEVICE d
+ grep -Fxq ap0
+ nmcli -t -f DEVICE,STATE d
+ grep -E '^ap0:unmanaged$'
+ return 1
+ RES=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 2 ]]
+ sleep 1
[...]

This happens both in the CLI and in the GUI.

Steps to reproduce the behavior:

  1. Execute the script: create_ap wlan0 wlan0 'wifiSSID' 'passworD'
  2. See information: Creating a virtual WiFi interface... and never ends.

Thus, the hotspot is not created.

Evidences
Executing script
image01

Results of debug and Possible fix
When the script is stuck (in red) I executed the command nmcli device set ap0 managed no in another terminal (in blue) and the script continue the execution and create the hotspot as expected.

So I do not know if it was the best solution but I changed the script to add the command (In yellow) [[ $RES -eq 1 ]] && nmcli device set ${1} managed no in the line 618 and worked. This command temporarily configure a device as unmanaged in NetworkManager

image02

Desktop:

  • OS:

               +                OS: Arch Linux x86_64
               #                Hostname: hidden
              ###               Kernel Release: 5.8.14-arch1-1
             #####              Uptime: 1:25
             ######             WM: DWM
            ; #####;            DE: None
           +##.#####            Packages: 1709
          +##########           RAM: 2506 MB / 15906 MB
         #############;         Processor Type: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
        ###############+        $EDITOR: vim
       #######   #######        Root: 95G / 109G (87%) (ext4)
     .######;     ;###;`".      
    .#######;     ;#####.       
    #########.   .########`     
   ######'           '######    
  ;####                 ####;   
  ##'                     '##   
 #'                         `#  
  • networkmanager: 1.26.4-1

make fail on Xubuntu 16.04

Below is the verbose, please have a look ~


rpdzkj@rpdzkj:~$ sudo apt install -y libgtk-3-dev build-essential gcc g++ pkg-config make hostapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
g++ is already the newest version (4:5.3.1-1ubuntu1).
gcc is already the newest version (4:5.3.1-1ubuntu1).
make is already the newest version (4.1-6).
pkg-config is already the newest version (0.29.1-0ubuntu1).
libgtk-3-dev is already the newest version (3.18.9-1ubuntu3.3).
hostapd is already the newest version (1:2.4-0ubuntu6.6).
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
rpdzkj@rpdzkj:~$ git clone https://github.com/lakinduakash/linux-wifi-hotspot
Cloning into 'linux-wifi-hotspot'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 1026 (delta 11), reused 13 (delta 6), pack-reused 1001
Receiving objects: 100% (1026/1026), 456.68 KiB | 10.00 KiB/s, done.
Resolving deltas: 100% (626/626), done.
Checking connectivity... done.
rpdzkj@rpdzkj:~$ cd linux-wifi-hotspot
rpdzkj@rpdzkj:~/linux-wifi-hotspot$ make
mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/rpdzkj/linux-wifi-hotspot/src'
/usr/lib/aarch64-linux-gnu/glib-2.0/glib-compile-resources ui/glade/wifih.gresource.xml --target=ui/resources.c --sourcedir=ui/glade --generate-source
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
make[2]: Entering directory '/home/rpdzkj/linux-wifi-hotspot/src'
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`
ui/ui.c: In function 'entry_ssid_warn':
ui/ui.c:211:22: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
         size_t len = strlen(ssid);
                      ^
ui/ui.c:211:22: warning: incompatible implicit declaration of built-in function 'strlen'
ui/ui.c:211:22: note: include '<string.h>' or provide a declaration of 'strlen'
ui/ui.c: In function 'entry_pass_warn':
ui/ui.c:243:22: warning: incompatible implicit declaration of built-in function 'strlen'
         size_t len = strlen(pass);
                      ^
ui/ui.c:243:22: note: include '<string.h>' or provide a declaration of 'strlen'
ui/ui.c: In function 'entry_channel_warn':
ui/ui.c:274:19: warning: implicit declaration of function 'strdup' [-Wimplicit-function-declaration]
         char *c = strdup(channel);
                   ^
ui/ui.c:274:19: warning: incompatible implicit declaration of built-in function 'strdup'
ui/ui.c:294:20: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
         } else if (strcmp(configValues.freq, "2.4") == 0) {
                    ^
ui/ui.c: In function 'run_create_hp_shell':
ui/ui.c:620:15: warning: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
         cmd = strcat( cmd, " --freq-band ");
               ^
ui/ui.c:620:15: warning: incompatible implicit declaration of built-in function 'strcat'
ui/ui.c:620:15: note: include '<string.h>' or provide a declaration of 'strcat'
ui/ui.c:640:13: warning: implicit declaration of function 'strcspn' [-Wimplicit-function-declaration]
         buf[strcspn(buf, "\n")] = 0;
             ^
ui/ui.c:640:13: warning: incompatible implicit declaration of built-in function 'strcspn'
ui/ui.c:640:13: note: include '<string.h>' or provide a declaration of 'strcspn'
ui/ui.c:643:13: warning: implicit declaration of function 'strstr' [-Wimplicit-function-declaration]
         if (strstr(buf, AP_ENABLED) != NULL) {
             ^
ui/ui.c:643:13: warning: incompatible implicit declaration of built-in function 'strstr'
ui/ui.c:643:13: note: include '<string.h>' or provide a declaration of 'strstr'
ui/ui.c: In function 'validator':
ui/ui.c:665:22: warning: incompatible implicit declaration of built-in function 'strlen'
         size_t len = strlen(cv->pass);
                      ^
ui/ui.c:665:22: note: include '<string.h>' or provide a declaration of 'strlen'
ui/ui.c:675:22: warning: incompatible implicit declaration of built-in function 'strlen'
         size_t len = strlen(cv->ssid);
                      ^
ui/ui.c:675:22: note: include '<string.h>' or provide a declaration of 'strlen'
ui/ui.c:704:17: warning: incompatible implicit declaration of built-in function 'strdup'
         char *c=strdup(cv->channel);
                 ^
ui/ui.c: In function 'init_config_val_input':
ui/ui.c:744:14: warning: incompatible implicit declaration of built-in function 'strcspn'
         wifi[strcspn(wifi, "\n")] = 0;
              ^
ui/ui.c:744:14: note: include '<string.h>' or provide a declaration of 'strcspn'
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
ui/read_config.cpp: In function 'int read_config_file()':
ui/read_config.cpp:64:18: error: 'delimiterPos' does not name a type
             auto delimiterPos = line.find('=');
                  ^
ui/read_config.cpp:65:18: error: 'name' does not name a type
             auto name = line.substr(0, delimiterPos);
                  ^
ui/read_config.cpp:66:18: error: 'value' does not name a type
             auto value = line.substr(delimiterPos + 1);
                  ^
ui/read_config.cpp:68:31: error: 'value' was not declared in this scope
             strcpy(configs[i],value.c_str());
                               ^
ui/read_config.cpp:69:29: error: 'name' was not declared in this scope
             setConfigValues(name.c_str(),configs[i]);
                             ^
Makefile:39: recipe for target '../build/read_config.o' failed
make[2]: *** [../build/read_config.o] Error 1
make[2]: Leaving directory '/home/rpdzkj/linux-wifi-hotspot/src'
Makefile:32: recipe for target 'resources.c' failed
make[1]: *** [resources.c] Error 2
make[1]: Leaving directory '/home/rpdzkj/linux-wifi-hotspot/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2

Why restricts 5Ghz channels to <=36.

Is your feature request related to a problem? Please describe.
There are more 5 GHz channels available, which are not only legal but also supported by network adapters. For example, my card support

                        * 5745 MHz [149] (22.0 dBm)
                        * 5765 MHz [153] (22.0 dBm)
                        * 5785 MHz [157] (22.0 dBm)
                        * 5805 MHz [161] (22.0 dBm)
                        * 5825 MHz [165] (22.0 dBm)

But

if (!(li <= 36 && li > 0)) {
requires the channel number to be no more than 36.

Describe the solution you'd like
change 36 to a large number, e.g, 173, or make it region dependent.

unable to on hotspot

ERROR: Failed to initialize lock
Command not found or exited with error status

when i press create hotspot this is what i get as output on my terminal

No internet connection

Describe the bug
I have 2 wireless adapters, wlan0 is connected to an AP. I want wlan1 to make a hotspot, forwarding the internet connection of wlan0. The hotspot AP is being created fine, and is visible from my phone, however when I connect to it, there is no internet connection.

To Reproduce
Steps to reproduce the behavior:

  1. Have 2 wireless adapters
  2. Connect wlan0 to an AP
  3. type wihotspot
  4. Set an SSID and Password.
  5. Set Wifi Interface to "wlan1"
  6. Set Internet Interface to "wlan0"
  7. Click "Create hotspot"
  8. No error appears. If I connect my mobile phone to the hotspot AP, I get "Connected, no internet". I tried it on a Windows laptop as well.
  9. I also tried it with only one interface, and without a password, and with 2.4Ghz option.

Expected behavior
My mobile phone that is connected to the hotspot AP should be able to connect to the internet.

Desktop (please complete the following information):

  • OS: Kali Linux 2020.2

Smartphone (please complete the following information):

  • Device: Google Pixel 2 XL
  • OS: Android 10

Add mac filter

It is better if we can add list of MAC address to whitelist or blacklist when creating a hotspot.

Appimage

This software is using create_ap as backend , so it should be easy to provide an Appimage.
Please release Appimage too.
Will be great.

Can't run 'sudo make install'

Hi, I just git clone the repo and when I run "sudo make install" I got this error :

No rule to make target '../build/wihotspot-gui', needed by 'install'. Stop

And the build folder is indeed empty, can you help me with that ?
Thank you
S.

Unable to build on Manjaro

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):

  • OS: Manjaro
  • Version 20.1.1

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

add more wi-fi secerity options for older WIIFI cards

I been trying to play Nintendo DS online and the Nintendo DS can only connect to wep 40/128 WIFI... and open.
and yeah yeah blah blah i can get hacked blah blah but i only use it every now and then anyway and i live in a old people area
so I dont care but it would be nice to have more options like that in this app.

all so I cant do it in windows 10 at all cuz they lock you down to only using WPA2, cant even just have it open like your app can
so thats why i been looking for alternatives like this and I dont wanna just open it witch the DS can connect to but still... i dont want open even tho wep basically is open just for hackers.

Transfer build system from Cmake to Make

Since this project is only intended to run and build in Linux environment, Cmake is unnecessary which adds an additional dependency for building the project. Much simpler Makefile is sufficient.

Port Forwarding(?)

Hi! sorry, i'm new here and using linux, there's a way to open ports of the wifi AP? cause for some programs seems to be port block when i use the create_ap only trough WPA, but when using bridging i don't have this issue

Restore a normal situation when stopping hotspot

When stopping the hotspot all connection type are lost to the PC or RPi. I need to connect a kbd and a display to take control on the PC or board.
It would be nice to only cut the bridge between internet connection and hotspot connection but keep the access to the PC or RPi board via wifi or RJ45 wire.
Thanks for your answer

multiple definition of `accepted_macs'

Describe the bug

mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.2.0/src'
/usr/bin/glib-compile-resources ui/glade/wifih.gresource.xml --target=ui/resources.c --sourcedir=ui/glade --generate-source
make[2]: Entering directory '/home/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.2.0/src'
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++
/usr/sbin/ld: ../build/h_prop.o:(.bss+0x2000): multiple definition of `accepted_macs'; ../build/ui.o:(.bss+0x128): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:42: wihotspot-gui] Error 1
make[2]: Leaving directory '/home/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.2.0/src'
make[1]: *** [Makefile:33: resources.c] Error 2
make[1]: Leaving directory '/home/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.2.0/src'
make: *** [Makefile:5: all] Error 2

To Reproduce
Build 3.2.0 via AUR PKGBUILD

Desktop

  • Manjaro GNOME 3.38.1

Hotspot cannot be discovered despite the application is running

I'm on Fedora 32.

I could create a hotspot on 2.4 frequency brand and the application said the hotspot was running. However, I couldn't find my hotspot at all on the network setting. I tried both on WPA & WPA2 Enterprise and WPA & WPA2 Personal network and the results were the same. Here is the screenshot of my settings:
image

Here is the command line output:
pkexec --user root create_ap wlp0s20f3 wlp0s20f3 'whatisahotspot' '' --mkconfig /etc/wh.config --freq-band 2.4
Config options written to '/etc/wh.config

Did I do anything wrong in the hotspot settings? Is there anyway to fix this? Thank you!

SSID with blank spaces not allowed

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Ubuntu]
  • Version [e.g. 18.04]

Additional context
Add any other context about the problem here.

Hotspot creation with Blancke spaced in SSID is not allowed , Say like WIFI PC -> we need to add SSID name as WIFIPC

Suggest an logo

Anyone welcome to suggest a logo for this project.
The logo should be unique and simple. Add a SVG file to docs/logo folder.
PS: Don't suggest logos from the internet

Secondary WiFi interface.

Feature: Adding a secondary WiFi interface (external WiFi antenna/USB adapter) for hotspot.

The USB adapter shows up as wlan1 when typing ip a in terminal. It also shows up when selecting Internet Interface in wihotspot, but doesn't show up in WiFi interface.

The USB adapter works as an AP when I follow the Official Raspberry Pi guide.

Screenshot 2019-12-25 at 10 10 37wlan1 doesn't show up in WiFi interface.

Screenshot 2019-12-25 at 10 11 04wlan1 shows up in Internet Interface.

Not running on both frequency band

I'm on Manjaro KDE.

Here is my settings:
image

The app shows "not running" regardless which frequency band I tries to connect.

Here is the command console output If I connect to 5Ghz frequency:
pkexec --user root create_ap wlp0s20f3 wlp0s20f3 Hotspot --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.

Command not found or exited with error status

Here is the command console output If I connect to 2.4Ghz frequency:
pkexec --user root create_ap wlp0s20f3 wlp0s20f3 Hotspot --mkconfig /etc/wh.config --freq-band 2.4
Config options written to '/etc/wh.config'

dnsmasq: cannot read /tmp/create_ap.wlp0s20f3.conf.rt3jez23/dnsmasq.conf: Permission denied
Command not found or exited with error status

Is there any workaround to solve this? Thank you!

Problem with wifi hotspot with BCM43142A driver

Describe the bug
Can't create ap hotspot .
Lock error.
And my driver doesn't support ap (proprietary driver)
Iw list shows only ibss and managed mode.
Where can I contact you other than here

Nice project btw. Used connectify in windows when mobile hotspot feature was not available.

It's Pretty much similar to this

Ubuntu
20.04

Not running

When I try to start the hotspot, it always says not running
image

`ls -x /sys/class/net` not get parsed correctly.

Describe the bug
In the internet interface list, I got

docker0
enp0s31f6
lo  wlp0s20f3

To Reproduce
once it is started.

Expected behavior
it should be

docker0
enp0s31f6
lo
wlp0s20f3

Desktop (please complete the following information):

  • OS: Fedora 30
$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:c5:f1:ba:7a  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.16  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f50d:da9e:3978:670f  prefixlen 64  scopeid 0x20<link>
        ether 48:2a:e3:26:ff:df  txqueuelen 1000  (Ethernet)
        RX packets 1709831  bytes 2469485152 (2.2 GiB)
        RX errors 14  dropped 0  overruns 0  frame 7
        TX packets 919255  bytes 81183904 (77.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xa5600000-a5620000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2427  bytes 193846 (189.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2427  bytes 193846 (189.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp0s20f3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.17  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::4e0f:24b8:a162:6b5f  prefixlen 64  scopeid 0x20<link>
        ether fc:77:74:9c:a2:2a  txqueuelen 1000  (Ethernet)
        RX packets 71439  bytes 71721511 (68.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 53842  bytes 9687724 (9.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

$ ls -x /sys/class/net
docker0  enp0s31f6  lo  wlp0s20f3

I think there may be some problem with

char** get_interface_list(int *length){
if(init_get_interface_list()==0){
char *a=strdup(interface_list);
char *b=strdup(interface_list);
char * pch;
pch = strtok (a," ");
int i=0;
while (pch != NULL)
{
pch = strtok (NULL, " ");
i++;
}
static char** arr;
arr =malloc(i * sizeof(char*));
free(a);
pch = strtok (b," ");
i=0;
while (pch != NULL)
{
arr[i]=strdup(pch);
pch = strtok (NULL, " \n");
i++;
}
*length= i;
return arr;
}
return NULL;
}

But I cannot figure out why.

Connected Devices

It works great on Ubuntu 20.04 so far, many thanks !!
this is more of a feature request. Can we see who is connected to the hotspot. Also, is it possible to have this as an extension, that can be enabled or disabled from the top bar from the desktop.

Again, many thanks !

How to see which devices are connected through the hotspot?

It would be great if this important feature can be integrated into the application and connected devices can be shown on the tray on status bar, and to get an alert when a new device gets connected or disconnected. It is always a good idea to check for connected devices to avoid security flaws.

No rule to make target '../build/resources.o', needed by '../build/wihotspot-gui'

Describe the bug
Same build failure as reported in Issue #68:

mkdir -p build
Run 'sudo make install' for installation.
Run 'sudo make uninstall' for uninstallation.
cd src && make
make[1]: Entering directory '/home/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.1.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/yochanan/Documents/AUR/linux-wifi-hotspot/src/linux-wifi-hotspot-3.1.0/src'
make: *** [Makefile:5: all] Error 2

To Reproduce
Steps to reproduce the behavior:
Build AUR package using makepkg -si

Desktop (please complete the following information):

  • OS: Manjaro
  • Version: GNOME 3.38.1

Additional context
When I updated the AUR package to 3.0.0, it built fine. Now that I'm attempting to update to 3.1.0, I encountered this issue.

Not running...

Describe the bug
Hi, I am trying to use your program because I want to share school teacher's wifi with students in my classrooom (students doesn 't have wifi connection).
I'm working with Pentium core 2 duo, network wifi interface wpl8s0, system bunsenlab linux (debian 9).
Every time I tried to start connection the gui show some fast messages (I can't read them...) but every time the final conclusion is
"Not running".

Can I've made some errors? Could be my pc too old?

Thank for your efforts!

Not working on newest arch linux.

Describe the bug
All seem like working, but, can not find hot spots on my android cell phone.

image

Desktop (please complete the following information):

  • OS: [e.g. Arch]
  • Version [HEAD]

Additional context
It's is not working when i run it use desktop file from gnome app search.
so, i have to run it manually in terminal.

5GHz channels

This is actually a problem with create_ap, but not with linux-wifi-hotspot.

create_ap only support to set up AP on the same channel as the WiFi connection is on. So if the Wifi connection is 5GHz, then the AP has to be on 5GHz, on the same channel. Then people usually got errors like

Your adapter can not transmit to channel 36, frequency band 5GHz.

However there are some different cases when this happens.

  1. The user's adapter or driver does not support to set up AP on 5GHz. In this case, I believe that we can do nothing to make things work, other than ask the user to switch to a 2.4GHz WiFi.
  2. The user's adapter and driver support 5GHz AP, but can only transmit to channels different from the one that the adapter is already associated to.
    2.1. the adapter or driver does not support multiple channels. We can no nothing.
    2.2. the adapter and the driver support multiple channels, e.g., when #channels <= 2 instead of #channels <= 1 in the following output
$ iw list
----------------------------------------------------------------------------------------------------
...

        valid interface combinations:
                 * #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
                   total <= 3, #channels <= 2

...

In this case, a hack to create_ap can also make things work, see oblique/create_ap#75 (comment).

So I think there are some work to be done so that we can make this app work better.

  • parse iw list to see if multiple channels is supported. (I am not sure if there are any chipset supporting more than 2 channels)
if iw list | grep "#channels <= 2" -q 
then
   echo "DUAL-CHANNEL SUPPORTED";
else
   echo "DUAL-CHANNEL NOT SUPPORTED";
fi
--------------------------------------------------------------------------------
DUAL-CHANNEL SUPPORTED

  • parse iw list to get a list of supported channels. This one has its own importance so that users can select a channel from a list in the UI, rather than fill in a number.
iw list | grep "\* [0-9]* MHz \[[0-9]*\]" | while read l; do [[ $l != *disabled* ]] && [[ $l != *no\ IR* ]] && echo "$l"; done
--------------------------------------------------------------------------------
* 2412 MHz [1] (22.0 dBm)
* 2417 MHz [2] (22.0 dBm)
* 2422 MHz [3] (22.0 dBm)
* 2427 MHz [4] (22.0 dBm)
* 2432 MHz [5] (22.0 dBm)
* 2437 MHz [6] (22.0 dBm)
* 2442 MHz [7] (22.0 dBm)
* 2447 MHz [8] (22.0 dBm)
* 2452 MHz [9] (22.0 dBm)
* 2457 MHz [10] (22.0 dBm)
* 2462 MHz [11] (22.0 dBm)
* 2467 MHz [12] (22.0 dBm)
* 2472 MHz [13] (22.0 dBm)
* 5745 MHz [149] (22.0 dBm)
* 5765 MHz [153] (22.0 dBm)
* 5785 MHz [157] (22.0 dBm)
* 5805 MHz [161] (22.0 dBm)
* 5825 MHz [165] (22.0 dBm)

create_ap has functions to test if wifi is connected, and if so, the frequency of the connection. Combined with the above info, one can decide easily which channel to use.

After stopping the wifi hotspot from GUI it does not properly set the running status

Describe the bug
After stopping the wifi hotspot from GUI it does not properly set the running status as stopped without restarting the GUI.

To Reproduce

  1. Start the wifi hotspot
  2. Stop hotspot
  3. GUI does not show it is stopped even creat_ap is actually stopped.

Expected behavior
GUI should

Desktop (please complete the following information):

  • OS: Ubunu
  • 20.04

Additional context
After restarting the GUI it shows correctly.

Linking error due to multiple definitions of running_info

/usr/bin/ld: CMakeFiles/wihotspot.dir/ui/ui.c.o:(.bss+0x10): multiple definition of `running_info'; CMakeFiles/wihotspot.dir/ui/h_prop.c.o:(.bss+0x420): first defined here
collect2: error: ld returned 1 exit status

install.log

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo
  2. cd into linux-wifi-hotspot
  3. run make && sudo make install

Desktop:

  • OS: Arch Linux 4.20
  • gcc version 10.1.0
  • ld version 2.34
  • cmake 3.17.2

Cmake is installed but linux-wifi-hotspot is not able to detect it.

Describe the bug
Cmake is installed but linux-wifi-hotspot is not able to detect it.
To Reproduce
Steps to reproduce the behavior:

  1. When trying to install linux-wifi-hotspot it fails with the error message "cmake: not found". See the terminal output below...
    (base) tarun@tarun-vostro-3480:~/linux-wifi-hotspot$ sudo make install
    [sudo] password for tarun:
    Installing
    cd build && cmake -DCMAKE_INSTALL_PREFIX= -G "CodeBlocks - Unix Makefiles" ../src
    /bin/sh: 1: cmake: not found
    Makefile:8: recipe for target 'install' failed
    make: *** [install] Error 127

  2. Verified that cmake is installed. See the terminal output below...
    (base) tarun@tarun-vostro-3480:~/linux-wifi-hotspot$ cmake --version
    cmake version 3.13.4

  3. $PATH is also updated accordingly. See the terminal output below...
    (base) tarun@tarun-vostro-3480:~/linux-wifi-hotspot$ echo $PATH
    /home/tarun/.local/bin:/home/tarun/anaconda3/bin:/home/tarun/anaconda3/condabin:/home/tarun/.local/bin:/opt/devkitpro/tools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/tarun/cmake-3.13.4-Linux-x86_64/bin

  4. Also, verified that I can check cmake version from any other directory as well, like root
    (base) tarun@tarun-vostro-3480:~/linux-wifi-hotspot$ cd /
    (base) tarun@tarun-vostro-3480:/$ pwd
    /
    (base) tarun@tarun-vostro-3480:/$ cmake --version
    cmake version 3.13.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Expected behavior
linux-wifi-hotspot should be able to detect cmake properly

Desktop (please complete the following information):

  • OS & Version

(base) tarun@tarun-vostro-3480:/$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

Additional context
I am also not able to launch the program using wihotspot
(base) tarun@tarun-vostro-3480:~/linux-wifi-hotspot$ wihotspot
wihotspot: command not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.