xwalter Posted May 15, 2016 Share Posted May 15, 2016 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 More sharing options...
Igor Posted May 16, 2016 Share Posted May 16, 2016 https://github.com/igorpecovnik/lib/blob/master/documentation/user-faq.md#how-to-set-wireless-access-point https://github.com/igorpecovnik/lib/blob/master/documentation/user-faq.md#how-to-change-network-configuration But don't expect too much from this on board wireless chip. Link to comment Share on other sites More sharing options...
xwalter Posted May 16, 2016 Author Share Posted May 16, 2016 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 More sharing options...
tkaiser Posted May 17, 2016 Share Posted May 17, 2016 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 More sharing options...
xwalter Posted May 17, 2016 Author Share Posted May 17, 2016 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 More sharing options...
tkaiser Posted May 17, 2016 Share Posted May 17, 2016 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 More sharing options...
xwalter Posted May 17, 2016 Author Share Posted May 17, 2016 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 ? Link to comment Share on other sites More sharing options...
tkaiser Posted May 17, 2016 Share Posted May 17, 2016 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 More sharing options...
xwalter Posted May 17, 2016 Author Share Posted May 17, 2016 you're right but I am already searching and testing tutorial and books about raspberry , beaglebone and else about wifi ...but not result 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 More sharing options...
xwalter Posted May 17, 2016 Author Share Posted May 17, 2016 I will try with this dongles .... http://it.aliexpress.com/wholesale?catId=0&initiative_id=SB_20160517135551&SearchText=RTL8188EUS I hope some of them support AP What do you think about ? Link to comment Share on other sites More sharing options...
Igor Posted May 18, 2016 Share Posted May 18, 2016 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 More sharing options...
xwalter Posted May 18, 2016 Author Share Posted May 18, 2016 ok thank you . You're right , I'm watching about DHCP to install and configure into my orange pi ... Link to comment Share on other sites More sharing options...
rodolfo Posted May 19, 2016 Share Posted May 19, 2016 @xwalter X-mas is early with a special gift for you : http://forum.armbian.com/index.php/topic/1237-tutorial-opi-one-wireless-success/ Link to comment Share on other sites More sharing options...
xwalter Posted May 19, 2016 Author Share Posted May 19, 2016 Nice !!! Thanks!!! 1 Link to comment Share on other sites More sharing options...
AJS Posted June 7, 2016 Share Posted June 7, 2016 Anybody got this working on BPI m2 plus ? have tried what Igor pointed to: https://github.com/i...ss-access-point https://github.com/i...k-configuration didnt work for me. Link to comment Share on other sites More sharing options...
Igor Posted June 7, 2016 Share Posted June 7, 2016 Anybody got this working on BPI m2 plus ? have tried what Igor pointed to: https://github.com/i...ss-access-point https://github.com/i...k-configuration didnt work for me. This driver needs a parameter op_mode=2 when loading module that it works in AP mode. Link to comment Share on other sites More sharing options...
AJS Posted June 7, 2016 Share Posted June 7, 2016 worked ,You guys are doing a great job by the way, thank you. 1 Link to comment Share on other sites More sharing options...
xwalter Posted June 7, 2016 Author Share Posted June 7, 2016 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 .... Link to comment Share on other sites More sharing options...
xwalter Posted June 7, 2016 Author Share Posted June 7, 2016 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 More sharing options...
AJS Posted June 7, 2016 Share Posted June 7, 2016 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 More sharing options...
AJS Posted June 7, 2016 Share Posted June 7, 2016 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 More sharing options...
xwalter Posted June 7, 2016 Author Share Posted June 7, 2016 ok guys 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 1 Link to comment Share on other sites More sharing options...
xwalter Posted June 7, 2016 Author Share Posted June 7, 2016 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 More sharing options...
xwalter Posted June 7, 2016 Author Share Posted June 7, 2016 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 More sharing options...
xwalter Posted June 8, 2016 Author Share Posted June 8, 2016 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 More sharing options...
xwalter Posted June 8, 2016 Author Share Posted June 8, 2016 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 More sharing options...
xwalter Posted June 9, 2016 Author Share Posted June 9, 2016 guys , how to setup eth0 and br0 to be AP indipendent from DHCP assignments ? Link to comment Share on other sites More sharing options...
xwalter Posted June 9, 2016 Author Share Posted June 9, 2016 ok guys !!! I have solved in this way .... Follow this https://github.com/igorpecovnik/hostapd 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 Link /etc/network/interfaces.hostapd to /etc/network/interfaces Reboot Choose your WiFI AP name and password in /etc/hostapd.conf 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 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 br0iface lo inet loopbackauto eth0iface eth0 inet manualauto wlan0iface wlan0 inet staticaddress 192.168.1.50netmask 255.255.255.0network 192.168.1.0iface br0 inet dhcpbridge_ports eth0#wlan0#hwaddress ether # will be added at first boot#op_mode=2 ********************************************************* *** The script file for the tcp server *** import sockethost = '192.168.1.50'port = 5560myDatas = "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 More sharing options...
xwalter Posted January 2, 2017 Author Share Posted January 2, 2017 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 More sharing options...
Igor Posted January 2, 2017 Share Posted January 2, 2017 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 More sharing options...
Recommended Posts