Jump to content

Wifi Access Point


xwalter

Recommended Posts

hello guys ! 

I have a big problem which I'm not able to solve .

It makes me crazy .... :(

I have an orange pi plus 2 and I have changed the antenna , more powerfull.

I'm new with linux and armbian .

At the moment I can connect my orange to my router via lan cable and connect it over internet to update and upgrade Armbian and else.

Using graphical wicd I can connect it to my home wifi network after put the psw .In this case orange pi is a client.

Pratically the wifi on board is working , I mean , because it scans and it lists all of the wifi network reacheables around .

But my target is to create an access point with my orange pi . After some weeks I'm watching several tutorials, books , youtube and more , I'm not able to do this job .

My questions are  :

- Is the on board  wifi realtek of orange pi plus 2 able to be an AP ? 

- If not , which kind of dongle do you suggest me ?  

- Is there some tutorial to help me to set several files such as interfaces , dhcp , hostapd ? 

Could someone please help me , I 'm  very destroyed  .... :(

If I reach this target I will continue my tutorial about WSystem home domotik system which is now running over Bluetooth with Arduino due . 

I want to port all the WSystem project in orange pi over the wifi ......but without AP I can't do it .

If I had the AP I can create a tcp server in c++ or java and connect to it by an android ad-hoc app and then make many things.

I want to use orange pi instead of Arduino due because I have Linux which offers a lots of services, programs ,network and more .

Thank you !!!!

Walter

Link to comment
Share on other sites

ok Igor thank you ! 

I will try to do this as soon.

What do you mean .... 

 

 

But don't expect too much from this on board wireless chip. 

Is the power and distance covered not so much ? 

For me will be better if distance is about 40-50 Mt ....

Otherwise if you can suggest me an USB dongle with antenna I will buy and test , no problem

ciao

Walter 

Link to comment
Share on other sites

What do you mean .... 

 

The simple conclusion when you start playing around with any of these cheap onboard SDIO or USB RealTek WiFi solutions is: it's crap and not worth a look.

 

The fact that a manufacturer soldered a WiFi chip on an SBC does not necessarily mean that whis will serve any reasonable function later (especially when you try to setup an access point or use monitoring mode). If you get a connection in client mode 1m away from your router you can already be happy.

 

You always get what you pay for. And since my time is not worthless I won't spend hours and hours with such crappy solutions but spend a bit more money on something that works instead (separating the AP running OpenWRT from general purpose ARM devices running Linux or using a device like Solid-Run's Clearfog or Omnis Turria).

Link to comment
Share on other sites

Ok....

So to create an Access Point Embedded , by using orange pi plus 2 , what I have to do ?  

To use an USB dongle ?  Which is the better one ?  

To use a ESP8266 wifi module connected over the serial port and send/receive AT commands? 

What else ....My project is based on wifi and embedded system such as orange pi ....

Do I have any chances ? 

Link to comment
Share on other sites

So to create an Access Point Embedded , by using orange pi plus 2 , what I have to do ?

 

First I would try it out as Igor suggested (he pointed already to the relevant documentation section). But in case you get stuck don't waste too much time since you're still dealing with cheap crap known to not work reliably.

 

And no, at least I can not recommend any good USB dongle to be used as AP but others mights jump in (I searched the net for something like this last year when I played with the most laughable of all onboard-WiFi implementation: RTL8192CU used on Lamobo R1 but we simply replaced the whole device then)

Link to comment
Share on other sites

ok ...I try to do what Igor wrote above .

At the end I will try with 1 undreads usb dongle and then I will fail my project , is this the target ?

 

No idea, what you're planning. At least doing a web search for 'Orange Pi Access point' is not reading through success stories (more questions without answers and your thread over at the orphaned OPi forum). Googling for Raspberry Pi Access point' might give an idea which USB dongles are worth a look if you crawl through older search results or exclude RPi 3 (slow onboard WiFi) from search results.

 

I just wanted you to warn that any expectations beyond 'works in client mode 1m away from real access point' are somewhat problematic when we're talking about cheap/crappy RealTek WiFi. But maybe you're lucky trying out the stuff Igor already provides (no idea, never tried crappy onboard WiFi again after wasting way too much time with such stuff last year)

Link to comment
Share on other sites

you're right but I am already searching and testing tutorial and books about raspberry , beaglebone and else about wifi ...but not result   :D

The orange pi is still young , I know the OS is similarly but not the same 

At the moment my project is based on arduino due + bluetooth + android app . i 'd like to port it over orange pi by using wifi , services etc .

Pratically the wifi AP is the first point I have to solve ....I cannot start any project based over wifi if I'm not able to start an AP ....

Link to comment
Share on other sites

AP should work with this chip ... Just remember some chips needs special treatment -> hostapd-rt instead of hostapd and the config is also slightly changed. I put working examples to /etc/hostapd.conf and /etc/hostapd.conf-rt

 

Onboard chip should work but the quality was never seriously tested so I can't comment more. Just stick to manuals - remember to change network configuration to make use of your router DHCP otherwise you will need to configure additional DHCP server for your AP clients. 

Link to comment
Share on other sites

Igor ...here you wrote 

2-Link /etc/network/interfaces.hostapd to /etc/network/interfaces

What does it mean, what to write and where ?  

I'm compiling the go.sh .....

But where to add  " op_mode=2 " .....inside hostapd.conf which is packed in your hpstapd project , and then go.sh again ?

Link to comment
Share on other sites

does it work in armbian ? 

I wanto to try with on board wifi of orange pi plus 2 .....the wifi dongles are not coming yet ....

yes it works with onboard wifi of bananapi m2 plus

Link to comment
Share on other sites

Igor ...here you wrote 

2-Link /etc/network/interfaces.hostapd to /etc/network/interfaces

What does it mean, what to write and where ?  

I'm compiling the go.sh .....

But where to add  " op_mode=2 " .....inside hostapd.conf which is packed in your hpstapd project , and then go.sh again ?

it means create a symblink or you can just copy content of /etc/network/interfaces.hostapd to /etc/network/interfaces and requarding  op_mode=2

for me i had to execute the following command to get it to work modprobe bcmdhd op_mode=2  before starting hostapd, for you may be igor can assist you. and armbian comes with hostapd that worked like a charm for me so i don't think you have to compile yourself

Link to comment
Share on other sites

ok guys   :thumbup:

I did as you told me and follow the Igor post ....

I start my scanner on android phone and I see the wifi net , and also I'm able to connect it 

The info are ....

Access Point  :  MySystemWifi
MAC Address   :  the MAC of the wlan0
Device        : FN-LINK TECHNOLOGY LIMITED
Safety        : [WPA2-PSK COMP] [ESS]
Channel       : 5                              (as in the hostapd.conf)
Signal        : -26 dBm                        ( not so bad for the moment)
Connection time : 72 Mbps

TCP/IP Informations
MAC ADDRESS  : **********
IP           : 192.168.1.5
Netmask      : 255.255.255.0
Gateway      : 192.168.1.1
DNS 1        : 192.168.1.1
DNS 2        : 0.0.0.0
Server DHCP  : 192.168.1.1

What to say guys , first of all  BIG THANKS TO ALL ;)

The eth0 is connected and internet is running ,

Now I have to test the connections . Into the orange pi I will write a tcp server and in android or desktop I will write a client .

If the data exchange well I have resolved a lot of troubles .

ciao 

Walter

Link to comment
Share on other sites

ok guys some troubles ....

the orange pi is connected to my asus router in dhcp mode . My router assigns two address to the pi 

192.168.1.4 
192.168.1.5   (used by the Access Point on orange pi)

Pratically in orange pi I have 

192.168.1.1        nameserver from /etc/resolv.conf
192.168.1.3        connected to the wired network (dhcp) and I use also for apache2
192.168.1.5        ip address assigned to the AP 

127.0.0.1          localhost from ping localhost 

When I disconnect the plug of the lan of my orange pi , of course , I loose all beacause there are not IP address assigned (in dhcp) 

First of all I would like to setup manual addresses into the 

/etc/network/interfaces.hostapd 
and 
/etc/network/interfaces

to be able to use AP without any lan or router connected .

The second thing is that I'm starting a tcp server into orange pi , written in python in this way 

import socket

host = ''
port = 5560

Pratically I don't assign any statis IP address but I get the localhost , maybe .....

Do you have any idea ? 

The server connect and bind without any problems but doesn't accept the client 

By using my android phone I'm able to ping with success all of them 

ping 192.168.1.1        30-40 ms     , 0% packet loss
ping 192.168.1.3        33 ms        , 0% packet loss
ping 192.168.1.5        0.18-0.40 ms , 0% packet loss
ping 127.0.0.1          0.211 ms     , 0% packet loss

ciao 

Walter

Link to comment
Share on other sites

now I change the localhost from 127.0.0.1 to 192.168.1.20  from the /etc/hosts 

but nothing ....

I try also to do this

auto lo br0
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 192.168.1.5
	netmask 255.255.255.0
	network 192.168.1.0
	
auto wlan0
iface wlan0 inet static
    address 192.168.4.20
	netmask 255.255.255.0
	network 192.168.4.0
	
iface br0 inet dhcp
bridge_ports eth0 #wlan0
#hwaddress ether # will be added at first boot
#op_mode=2

in interfaces and interfaces.hostapd but nothing .....the internet connection is ok because the bridge get 192.168.1.3 , the access point is ok , if I type  ifconfig I can see the address for the wlan0 is 192.168.4.20  but it doens't accept any client , I have also changed several client in android but nothing .

 

From my android phone if I type 192.168.1.3 in firefox I can see the page of  apache2 which runs in orange pi and if I type 192.168.1.3/info.php  I can see the informations .

This means that Access Point is working , but I have to understand how to allow it independent from the lan and how to accept external clients ....

Ok this is not so bad ,,,,

Link to comment
Share on other sites

ok guys ....

in the python script the host='' and the port=5560 

The client app for android connect to 192.168.1.3 (is the address of the brigde and localhost as I wrote above) and the connection is ok , also exchange some datas .The python script shows me the android device connected at 192.168.1.5 (dhcp) .

But anyway , I have to set static address because dhcp changes the assignments .

Ok I go to sleep , better 

Link to comment
Share on other sites

ok ...the access point is working well and stable. Some modifications to the java android client and to the python server code. 

Simple string trasferring of strings is running. 

Before to implement the server in C++ I'd like to setup hostapd to have static bridge , eth0 and wlan0 

My target is to create an Hotspot between orange pi as server and android as client over tcp with AP.

Link to comment
Share on other sites

ok guys !!!  I have solved in this way ....

 

      Follow this     https://github.com/igorpecovnik/hostapd

  1. Edit /etc/init.d/hostapd and add/alter location of your conf file DAEMON_CONF=/etc/hostapd.conf and binary DAEMON_SBIN=/usr/sbin/hostapd
  2. Link /etc/network/interfaces.hostapd to /etc/network/interfaces
  3. Reboot
  4. Choose your WiFI AP name  and password in /etc/hostapd.conf
  5. Type this command modprobe bcmdhd op_mode=2  if not add  op_mode=2 inside both the /etc/network/interfaces.hostapd  and  /etc/network/interfaces
  6. To have an Access Point independent by tha assigned DHCP  setup both the files /etc/network/interfaces.hostapd  and  /etc/network/interfaces  in this way

auto lo br0
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto wlan0
iface wlan0 inet static
address 192.168.1.50
netmask 255.255.255.0
network 192.168.1.0

iface br0 inet dhcp
bridge_ports eth0
#wlan0
#hwaddress ether # will be added at first boot
#op_mode=2

 

*********************************************************

 

*** The script file for the tcp server ***

 

import socket

host = '192.168.1.50'
port = 5560

myDatas = "Some datas stored into the server"

def setupServer():
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print("Creating socket ok ....")
try:
mysock.bind((host, port))
except socket.error as msg:
print(msg)
print("Binding socket complete....")
return mysock
 

The TCP server socket binds the host which is the IP address of the wlan0 and starts lo listen

The TCP client connect to the server by using this IP address and the same port .

The internet connection is working for the orange pi . If I disconnect the lan of the orange pi , the server-client continously work .

This is what I need. Now I have to write a TCP server in C++

Link to comment
Share on other sites

I have installed armbian 5_20 and I'm following the same procedures as above but the file hostapd.conf  doesn't exist any more ....I don't know what to do ....

Is armbian 5_20 modified and that file is somewhere ?  

I have installed also the igor patch as I explain in the previous post but nothing .... 

Link to comment
Share on other sites

I have installed armbian 5_20 and I'm following the same procedures as above but the file hostapd.conf  doesn't exist any more ....I don't know what to do ....

Is armbian 5_20 modified and that file is somewhere ?  

I have installed also the igor patch as I explain in the previous post but nothing .... 

 

It looks like our packaging is forgetting to include config files. They are here:

https://github.com/igorpecovnik/lib/blob/master/extras-buildpkgs/hostapd/debian/config/hostapd.conf

or here:

https://github.com/igorpecovnik/lib/tree/next/config

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