![]() |
[HOWTO] N900 WiFi Hotspot (shell script version)
1 Attachment(s)
1 Background
The advantage of using this script to build WiFi Hotspot over the packages mobilehotspot and joikuspot is that it's simple and consume less power. The original script is written by jebba, modified slightly by me for easy customization, DNS and process initialization; therefore credit still goes to him. The reason I post this script is for those who are having technical problems with mobilehotspot or joikuspot, and for those who'd want to run a WiFi hotspot with minimum power usage. 2 Installation The script is pretty self explanatory therefore I'll let you explore it yourself. It can be run as root or triggered by Queen Beecon Widget. Tell me if you need help on this. The SSID is honeypot and the password is 0000000000000. You can customize them for your own use. Note that the length of the password must be 13. It needs packages wireless-tools and iptables, and iptables depends on kernel power. Therefore, you must be well-aware of the risk running kernel power so use it at your own risk. Code:
You can turn it off by using any WiFi switching applet/widget, or you could use this script (again, run as root): Code:
#!/bin/sh 4. Troubleshooting 4.1 Q: Password rejected. A: The length of the password must be 13. 4.2 Q:Tell me how to setup Queen Beecon Widget A: 1) Add new Widget 2) Choose Queen BeeCon Widget 3) Edit the Widget you've created on your desktop 4) Add Cmd 5) Enter Title: WiFi HotSpot 6) Enter Command: echo <path_to_script>/<name of the script> | root e.g. if the path to the script is /home/user/script/ and the name of the script is open_wifi_hotspot.sh, then the line would be: echo /home/user/script/open_wifi_hotspot.sh | root (you need rootsh installed, but I'm sure you do) 7) Save 8) If you don't need to change the outlook of your QBW icon, you can just accept all the default and save. 9) Done Similarly for wifi.sh: echo /home/user/script/wifi.sh | root wifi.sh uses exit code (2 and 0) to tell you the status of the wifi. Therefore, you'd like to config different color for different exit code. I use the following: 0 - Green, WiFi is enabled 2 - Red, WiFi is disabled Or you could just use the default. The script would give you popup message anyway. 4.3 The module ipt_MASQUERADE isn't loaded after upgrading to kernel-power v47 The module works fine in v46. Downgrade your kernel-power. (at your own risk) (Please reply here if you've any question. Then I'll update this section.) EDIT: wireless-tools provides iwconfig. Revised. EDIT: Report has it that ipt_MASQUERADE isn't loaded in kernel-power v47. Troubleshooting updated. |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
I could need some help here. My Laptop is only getting a private IP so DHCP doesn't seem to work properly.
Here's my output. Code:
IroN900:/usr/bin# wlapon Greetz, J4ZZ |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Thanks, I just have a question:
If I would only want to connect to my N900 with wifi but without using it as a hot-spot (so, without gprs0), I guess I would just need to take out these lines: HOSTIDEV="gprs0" modprobe ipt_MASQUERADE iptables -t nat -A POSTROUTING -o $HOSTIDEV -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward would I need to keep: iptables -t nat -F I would say that I don't need iptables at all, is that right? i. |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Bows in gratitude _O_
|
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
So this script is executable via QBW? :) I sure hope this works, seems complicated though!
I hope I don't ask too much of you, but since i am no expert of QBW could you please import the script to a QBW-instance and upload it to post #1? (export buffer to file) That would be just great :D |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Quote:
1) The password. Note that that the length of password must be exactly 13 words. 2) You've made change to the network and the DHCP network, that would cause routing problem as the routing on your own private networking may not be able to route the wifi traffic when you get them all into the same network, unless you tells the routing table how to diffentiate different traffic. That's why you got connection problem. Unless you're very familiar with TCP/IP routing, I'd suggest you stick to the original settings first. Make the change by trial and error later after you've successfully got the initial connection work. |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Quote:
And you don't need that modprobe ipt_MASQUERADE as well. However, one thing you must note that if you're using Windows PC to connect to any WiFi, it always tries to make it as the default route, i.e. all internet traffice request would go to WiFi. Unless you made change to this default behaviour, you might not be able to go to internet via your private network of your PC when you're connecting to WiFi. |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Quote:
However, setting up QBW for this script is very simple: 1) Add new Widget 2) Choose Queen BeeCon Widget 3) Edit the Widget you've created on your desktop 4) Add Cmd 5) Enter Title: WiFi HotSpot 6) Enter Command: echo <path_to_script>/<name of the script> | root e.g. if the path to the script is /home/user/script/ and the name of the script is open_wifi_hotspot.sh, then the line would be: echo /home/user/script/open_wifi_hotspot.sh | root (you need rootsh installed, but I'm sure you do) 7) Save 8) If you don't need to change the outlook of your QBW icon, you can just accept all the default and save. 9) Done Hope this helps. |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Thanks for replying, I got it working now.
Now I have another request, is there a way to just start and stop Hotspot with a script and keep WiFi running. What I want is to have a QBW Button to just toggle Hotspot on/off if needed, but keep my WiFi or GPRS connection running afterwards. Thx in advance, Greetz, J4ZZ |
Re: [HOWTO] N900 WiFi Hotspot (shell script version)
Quote:
Or you may just run that particular line that changes the wifi back to managed. |
All times are GMT. The time now is 07:14. |
vBulletin® Version 3.8.8