0

Question: I'm attempting to create a software-based Wi-Fi hotspot on my Windows laptop without relying on a hosted network, as my laptop doesn't support it. I've explored various options, including Python libraries like pywifi, ctypes, os, and subprocess, but none seem to fulfill the requirement.

Problem: My laptop doesn't support hosted network, which is commonly used for creating Wi-Fi hotspots. However, I've noticed that software like Connectify Hotspot is able to create Wi-Fi hotspots even on laptops without hosted network support.

Objective: I'm looking for a solution or software that can enable hotspot functionality on my Windows laptop without requiring a hosted network. The solution should be able to utilize my laptop's existing internet connection to create a Wi-Fi hotspot.

I've tried the following Python libraries:

1- pywifi:

import pywifi
from pywifi import const

wifi = pywifi.PyWiFi()
iface = wifi.interfaces()[0]

iface.disconnect()
profile = pywifi.Profile()
profile.ssid = "MyHotspot"
profile.auth = const.AUTH_ALG_OPEN
profile.akm.append(const.AKM_TYPE_NONE)

iface.remove_all_network_profiles()
tmp_profile = iface.add_network_profile(profile)
iface.connect(tmp_profile)

2- ctypes:

import ctypes
import subprocess

subprocess.run(["netsh", "wlan", "set", "hostednetwork", "mode=allow", "ssid=MyHotspot", "key=MyPassword"], shell=True)
subprocess.run(["netsh", "wlan", "start", "hostednetwork"], shell=True)

3- os:

import os

os.system("netsh wlan set hostednetwork mode=allow ssid=MyHotspot key=MyPassword")
os.system("netsh wlan start hostednetwork")

4- subprocess:

import subprocess

subprocess.run(["netsh", "wlan", "set", "hostednetwork", "mode=allow", "ssid=MyHotspot", "key=MyPassword"], shell=True)
subprocess.run(["netsh", "wlan", "start", "hostednetwork"], shell=True)

and they give me the same issue in termenal :

The hosted network mode has been set to allow. 
The SSID of the hosted network has been successfully changed. 
The user key passphrase of the hosted network has been successfully changed. 

The hosted network couldn't be started. 
The group or resource is not in the correct state to perform the requested operation.

Observation: Despite my laptop showing that it doesn't support hosted network, Connectify Hotspot is able to create a Wi-Fi hotspot successfully.

Requirements:

The solution should not rely on hosted network support. It should provide clear instructions for installation and usage. It should explain how the software works and its limitations compared to a hosted network-based solution. Example Solutions: I've looked into software like Connectify and MyPublicWiFi, but I'm open to any other suggestions or custom scripts that can achieve the same functionality.

My Laptop Information:

Hosted network supported: No Question Summary: How can I create a software-based Wi-Fi hotspot on my Windows laptop without hosted network support, similar to what Connectify Hotspot does?

Any insights, suggestions, or solutions would be greatly appreciated! Thank you.

User this is the error for ctypes The hosted network mode has been set to allow. The SSID of the hosted network has been successfully changed. The user key passphrase of the hosted network has been successfully changed.

The hosted network couldn't be started. The group or resource is not in the correct state to perform the requested operation.

1

0

Browse other questions tagged or ask your own question.