Jump to content

Wireless Access Point SUCCESS


OldBikerPete

Recommended Posts

I have been searching the net trying to find out how to set up the WiFi interface on an Orange Pi or a Raspberry Pi 3B as an access point.  I have to have an access point for a project I have in hand.

I found the instructions by Lim Han Yang but they just failed entirely on two out of three candidate boards with the third, an Orange Pi PC Plus, producing a point that is visible to an Android tablet but refused to authenticate. I tried the create_ap procedure from github but that crashed on all three boards when dnsmasq hung. I tried ‘armbian_config’ on the Orange Pi PC Plus which was running the appropriate Armbian image. That didn’t do anything usable.

Reasoning that the distributed software assumes that the board will always be used as a WiFi client and that a lot of the setup and software aimed at that would interfere with setting WiFi up to be an access point, I decided to strip away all of the networking software and rebuild it using related versions of programs that have worked for me on desktop linux machines.

I tried this on the Orange Pi PC plus first  -   AND IT WORKED.  I tried it again on an Orange Pi Zero, which is the platform I want to use for my project – AND IT WORKED. Here is how I did it. My aim in doing this is to have just a WiFi access point without connection to anywhere else for a project that may be solar-powered a few hundred klicks into the outback and just as far from an internet connection.  The boards I am looking at also have a CAT5 connection but my only interest in that is maintenance and software updates, so any possibility of bridging between the two is viciously suppressed. If I were trying to set up a bridged connection, I would use ‘iptables’ to create the appropriate routing. The Wifi is set up with a static IP and a dhcp server to provide connecting clients with an IP address and the hostapd binary to manage connection and WPA2 authentication. The CAT5 point is set up as a dhcp client, although that could have been given a static address also and may get one if remote-area maintenance with a laptop requires it.

Install an Armbian image on your platform of choice. Other distros may work but I haven’t used them as I want a simple CLI linux. Assuming that your board automatically connects to the internet, do ‘apt upgrade’ to bring everything up to date. If your board’s internet connection and console access is through WiFi then things may get sticky for you. I used either an SSH connection through CAT5 wiring or the Orange Pi boards debug serial interface at 115200 baud via a 3.3Volt (5Volt WILL destroy the board!) TTL serial to USB interface for console access during these modifications.

Login as the default user and if it is not root, do ‘sudo passwd root’  and create a password for root. This will enable you to log in as root and remove the need to use sudo (which I forget to do half the time – annoying).

 Either delete or ‘chmod a-x’    the wpa_supplicant, dhclient and dnsmasq (if installed) binaries. The scripts which invoke these will still be active and will fail – an untidy situation but I don’t care. Use whereis to find them.

Do ‘apt install dhcpcd5 udhcpd hostapd’ (apt-get may work too). You may want to ‘apt install’ a text editor at this point, ‘nano’ is a good choice but I prefer ‘joe’ as I’ve been using it for years. ‘vi’ is long overdue for relegation to the deepest pits of hell.

cd to ‘/etc/default’ and

edit ‘hostapd’ to add DAEMON_CONF="/etc/hostapd/hostapd.conf"

edit ‘udhcpcd’ to read:   DHCPD_ENABLED="yes"

DHCPD_OPTS="-S"

                             remove dnsmasq if it exists.

cd to ‘/etc/network’ and make ‘interfaces’ , ‘interfaces.hostapd’, ‘ interfaces.r1’, ‘interfaces.r1router’ and ‘interfaces.r1switch’ as in the attachments. Bear in mind that IP numbers, net masks etc. in these files are chosen to suit my preferences, your mileage may differ.

cd to ‘/etc’  , do ‘rm –r dnsmasq.d’ and ‘rm –r dhcp’ and create or modify dhcpcd.conf and udhcpd.conf to be as in the attachments. Once again, IP numbers etc. are my preferences. This might be a good time to edit ‘hostname’ to be something you want it to be.

cd to ‘/etc/hostapd’ and create ‘hostapd.conf’ as in the attachments.

You may want to add telnet capabilities, in which case do ‘apt install inetd telnet’ then

‘update-inetd –-enable telnet’ then if you want to login as ‘root’ over telnet, edit ‘/etc/securetty’ to include ‘pts/0’ and ‘pts/1’ etc. .  NOTE THAT TELNET IS AN INSECURE COMMUNICATION METHOD but it suits my purposes.

 

The above setup has been running reliably for a couple of months now and (touch wood) I see no reason other than hardware failure that would change that.

 

ConfigurationFiles.zip

Link to comment
Share on other sites

4 hours ago, OldBikerPete said:

I tried ‘armbian_config’ on the Orange Pi PC Plus which was running the appropriate Armbian image. That didn’t do anything usable.


Our method should(must) work - if not, please supply link from:

armbianmonitor -u

and explain if and how you change default image. 

https://www.youtube.com/watch?v=__BJtInOQFY

Link to comment
Share on other sites

The image I used was "Armbian_5.30_Orangepipcplus_Ubuntu_xenial_default_3.4.113.7z"  on the OrangePi PC Plus.

I immediately ran 'apt update' followed by 'apt upgrade' and then started trying to get an access point started.
I tried Lim Han Yang's instructions then create_ap and finally ‘armbian_config’.
It's probably not surprising that armbian_config didn't produce a result after those two prior attempts messed with settings.
In any case at that point I decided to do it my way rather than search through config files and learn about unfamiliar drivers to find where I needed to make changes.

 

I used "Armbian_5.35_Orangepizero_Ubuntu_xenial_default_3.4.113.7z" on the OpiZ.

 

My SD card writer is terribly slow (hours to write an image) so I don't plan to install a fresh image and produce a link for you at this time.

Link to comment
Share on other sites

7 hours ago, OldBikerPete said:

My SD card writer is terribly slow (hours to write an image) so I don't plan to install a fresh image and produce a link for you at this time.

Or you do use a Class 2 Card or a USB 1.1 Port? 

Link to comment
Share on other sites

On 20. 12. 2017 at 12:05 AM, OldBikerPete said:

In any case at that point I decided to do it my way rather than search through config files and learn about unfamiliar drivers to find where I needed to make changes.


Few tips if you are going to manual approach since I found out there is a problem with this driver/kernel and autodetection. It should work if you just use default config which comes with hostapd from our repository, which is by default. Make sure that you are running a normal and not special Realtek hostapd (package name is hostapd-realtek while normal one is just hostapd).

 

1 hour ago, OldBikerPete said:

The card is a SanDisk Ultra SD, sadly the SD writer is USB 2.0 and a slow one at that (1MB/sec flat out).


That is really extremely slow. Your SD writer could be detected as USB 1.0 so try changing port, reboot host. Card name usually tells little to nothing, this tells.

Link to comment
Share on other sites

2 hours ago, OldBikerPete said:

The card is a SanDisk Ultra SD, sadly the SD writer is USB 2.0 and a slow one at that (1MB/sec flat out).
Recommendations for a fast writer gratefully received.

Maybe its a fake SanDisk Ultra Card? You could check your card for correct size with

h2testw: https://www.heise.de/download/product/h2testw-50539

Or its "only" a Speed-Fake Card?
As Reader/Writer I can recommend the Transcend RDF5 - its a USB 3.0 device but works fine at USB 2.0 Speed :)
https://www.transcend-info.com/Products/No-396
 

RDF5
Engineered to deliver super fast data transfer speeds, the RDF5 USB 3.0 card reader 
features a SuperSpeed USB 3.0 interface and support for next-generation 
Ultra High Speed SDHC/SDXC and microSDHC/SDXC cards. 
Capable of being plugged directly into the USB port on any desktop or 
notebook computer, the ultra compact RDF5 offers effortless file sharing 
in any situation.

 

Transcend_RDF5_white.jpg

Link to comment
Share on other sites

22 hours ago, Igor said:


Few tips if you are going to manual approach since I found out there is a problem with this driver/kernel and autodetection. It should work if you just use default config which comes with hostapd from our repository, which is by default. Make sure that you are running a normal and not special Realtek hostapd (package name is hostapd-realtek while normal one is just hostapd).

 


That is really extremely slow. Your SD writer could be detected as USB 1.0 so try changing port, reboot host. Card name usually tells little to nothing, this tells.

Thank you for the tip Igor - even if I've settled on a config now - maybe I'll implement it in a lter project.
Thank you also for the pointer to SD card performance. Useful.
Since the card writer is plugged into an Intel I7 CPU system running at 4GHz, I might even be able to go a little faster than those benchmarks.

Link to comment
Share on other sites

21 hours ago, guidol said:

Maybe its a fake SanDisk Ultra Card? You could check your card for correct size with

h2testw: https://www.heise.de/download/product/h2testw-50539

Or its "only" a Speed-Fake Card?
As Reader/Writer I can recommend the Transcend RDF5 - its a USB 3.0 device but works fine at USB 2.0 Speed :)
https://www.transcend-info.com/Products/No-396
 


RDF5
Engineered to deliver super fast data transfer speeds, the RDF5 USB 3.0 card reader 
features a SuperSpeed USB 3.0 interface and support for next-generation 
Ultra High Speed SDHC/SDXC and microSDHC/SDXC cards. 
Capable of being plugged directly into the USB port on any desktop or 
notebook computer, the ultra compact RDF5 offers effortless file sharing 
in any situation.

 

Transcend_RDF5_white.jpg

Thank you for this pointer. I'll find one and buy it.

 

Link to comment
Share on other sites

On 12/18/2017 at 7:08 AM, Igor said:

Is this only for an old version of Armbian?

I am using 5.38 on an OPi Lite and I don't see the same options when I fire up armbianconfig and select the Network option.

All I get is a frame asking me to select a default network interface

and a second one (no matter whether I choose an Ethernet or Wlan interface) does NOT have the Create WiFi access point option. Is there something that the video has forgotten to say about packages that need to be loaded for this option to appear?

Link to comment
Share on other sites

4 minutes ago, pete_l said:

Is there something that the video has forgotten to say about packages that need to be loaded for this option to appear?


This tool is beta and second, AP config done this way might work or not. It depends on your wifi adapter drivers (which we don't support in any case) and possible bugs .. since it's a beta tool. It has been tested with many adaptors ... but still, it can break.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines