AP+STA Help Please SOLVED

rcpaul
 
Posts: 39
Joined: Sun Nov 09, 2014 4:20 am

Re: AP+STA Help Please

Sun Dec 18, 2016 5:05 pm

noblepepper, thank you very much for all your help! I will have some time today to troubleshoot it. Also, I am a little bit familiar with vi and editing in Openwrt so I can try it that way as well.

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: AP+STA Help Please

Sun Dec 18, 2016 5:28 pm

uci is really just a script friendly interface to the files in /etc/config, if you edit /etc/config/wireless, /etc/config/network and /etc/rc.local with vim the end result is the same as using the uci commands and echo/cat as long as the files end up looking like in my last post. This is the way I do it but not everyone knows vim...

cw5301
 
Posts: 3
Joined: Sun Mar 13, 2016 7:37 pm

Re: AP+STA Help Please

Sun Dec 18, 2016 8:17 pm

Hi:

I have been trying to accomplish the same thing... I can bring up the STA interface and connect it to the internet and the AP indicates the correct ssid and ip address, but I cannot connect to the AP. The AP ssid does not appear as available on any of my other wireless devices.

I cut-and-pasted the configurations exactly from the earlier posts in this thread... It appears UCI does not reliably read the files in /etc/config... I can change them and reload the network ("/etc/init.d/network restart") and wifi ("wifi") but changes to /etc/config/wireless and /etc/config/network are not accepted/do not appear.

This seems to have been a problem with every OpenWrt device since they implemented UCI... it just doesn't seem to work.

The Vocore2 worked correctly "out of the box" but changes to the config files were not accepted. Trying to use LuCI to configure the device didn't work at all. When I put in a non-working ssid in the wifi-iface sta section, then the ap section does not work either and it shows the ssid as "OpenWrt", but I cannot connect to it as "OpenWrt".

I can only connect to the Vocore2 via the USB serial interface - wifi AP has not worked at all since I tried to configure AP+STA. I cannot even turn of STA and get AP to work, at all. It has become very frustrating... I went through the same problems with Vocore 1 before giving up and waiting for Vocore2.

I badly want to use the Vocore (or Vocore2) for IOT applications but UCI has prevented them from being usable at all, so far.

rcpaul
 
Posts: 39
Joined: Sun Nov 09, 2014 4:20 am

Re: AP+STA Help Please

Sun Dec 18, 2016 11:31 pm

OK I tried everything you suggested, unfortunately pinging google still doesn't work :-(

root@OpenWrt:~# cat /etc/rc.local
uci set wireless.sta.disabled=0
uci commit
/etc/init.d/network restart
sleep 10
uci set wireless.sta.disabled=1
uci commit
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

exit 0
root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
option type 'ralink'
option variant 'mt7628'
option country 'CN'
option hwmode '11g'
option htmode 'HT40'
option channel 'auto'
option disabled '0'

config wifi-iface 'ap'
option device 'radio0'
option mode 'ap'
option network 'lan'
option ifname 'ra0'
option ssid 'VoCore2'
option encryption 'none'

config wifi-iface 'sta'
option device 'radio0'
option mode 'sta'
option network 'wwan'
option ifname 'apcli0'
option led 'mediatek:orange:wifi'
option encryption 'psk'
option key 'NNZQX9CPQCYHWBSC'
option ssid 'GXS4N'
option disabled '1'

root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fd47:f447:6340::/48'

config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option macaddr '00:0c:43:e1:76:28'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0.2'
option force_link '1'
option macaddr '00:0c:43:e1:76:29'
option proto 'dhcp'

config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 6t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'

config interface 'wwan'
option proto 'dhcp'

root@OpenWrt:~# iwinfo
apcli0 ESSID: "GXS4N"
Access Point: 18:1B:EB:C3:4C:81
Mode: Client Channel: 1 (2.412 GHz)
Tx-Power: 17 dBm Link Quality: unknown/100
Signal: unknown Noise: unknown
Bit Rate: 150.0 MBit/s
Encryption: unknown
Type: wext HW Mode(s): 802.11bg
Hardware: unknown [Generic WEXT]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: apcli0

apcli1 ESSID: unknown
Access Point: 00:00:00:00:00:00
Mode: Client Channel: 1 (2.412 GHz)
Tx-Power: 17 dBm Link Quality: unknown/100
Signal: unknown Noise: unknown
Bit Rate: 150.0 MBit/s
Encryption: unknown
Type: wext HW Mode(s): 802.11bg
Hardware: unknown [Generic WEXT]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: apcli1

ra0 ESSID: "VoCore2"
Access Point: 00:0C:43:E1:76:28
Mode: Client Channel: 1 (2.412 GHz)
Tx-Power: 17 dBm Link Quality: 10/100
Signal: -256 dBm Noise: -78 dBm
Bit Rate: 150.0 MBit/s
Encryption: unknown
Type: wext HW Mode(s): 802.11bg
Hardware: unknown [Generic WEXT]
TX power offset: unknown
Frequency offset: unknown
Supports VAPs: no PHY name: ra0

root@OpenWrt:~# ifconfig |grep -C5 apcli
apcli0 Link encap:Ethernet HWaddr 02:0C:43:01:76:28
inet addr:192.168.1.17 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::c:43ff:fe01:7628/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
root@OpenWrt:~# ping -c3 google.com
ping: bad address 'google.com'
root@OpenWrt:~#

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: AP+STA Help Please

Mon Dec 19, 2016 12:49 am

The VoCore2 is connected to the GXS4N AP, it gave you IP 192.168.1.17

If you disconnect your phone, laptop, whatever you are on from the VoCore2 AP and connect it to GXS4N you should be able to ssh into 192.168.1.17 and access the vocore2 luci web interface at that address.

You say you don't have an usb uart converter, are you on the bare board version of VoCore2? (not ultimate or airplay)

Try pinging google's dns server:
Code: Select all
# ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=46 time=23.710 ms
64 bytes from 8.8.8.8: seq=1 ttl=46 time=24.350 ms
64 bytes from 8.8.8.8: seq=2 ttl=46 time=62.459 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 23.710/36.839/62.459 ms


The best guess I have at this point is GXS4N isn't allowing you to access the internet, is there something you need to do there?

Post the contents of your /etc/config/firewall, I haven't changed mine but I'm still on a beta unit maybe the production units have different firewall settings.

Please stop posting output of iwinfo it means nothing to me and is just noise to filter out.

rcpaul
 
Posts: 39
Joined: Sun Nov 09, 2014 4:20 am

Re: AP+STA Help Please

Mon Dec 19, 2016 1:54 am

sorry about the iwinfo, heres the /etc/config/firewall

root@OpenWrt:~# cat /etc/config/firewall
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1

config zone
option name lan
list network 'lan'
option input ACCEPT
option output ACCEPT
option forward ACCEPT

config zone
option name wan
list network 'wan'
list network 'wan6'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1

config forwarding
option src lan
option dest wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4

# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT

config rule
option name Allow-IGMP
option src wan
option proto igmp
option family ipv4
option target ACCEPT

# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT

config rule
option name Allow-MLD
option src wan
option proto icmp
option src_ip fe80::/10
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family ipv6
option target ACCEPT

# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT

# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT

# include a file with users custom iptables rules
config include
option path /etc/firewall.user


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
# option src lan
# option src_ip 192.168.45.2
# option dest wan
# option proto tcp
# option target REJECT

# block a specific mac on wan
#config rule
# option dest wan
# option src_mac 00:11:22:33:44:66
# option target REJECT

# block incoming ICMP traffic on a zone
#config rule
# option src lan
# option proto ICMP
# option target DROP

# port redirect port coming in on wan to lan
#config redirect
# option src wan
# option src_dport 80
# option dest lan
# option dest_ip 192.168.16.235
# option dest_port 80
# option proto tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
# option src wan
# option src_dport 22001
# option dest lan
# option dest_port 22
# option proto tcp

# allow IPsec/ESP and ISAKMP passthrough
config rule
option src wan
option dest lan
option proto esp
option target ACCEPT

config rule
option src wan
option dest lan
option dest_port 500
option proto udp
option target ACCEPT

### FULL CONFIG SECTIONS
#config rule
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 80
# option dest wan
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp
# option target REJECT

#config redirect
# option src lan
# option src_ip 192.168.45.2
# option src_mac 00:11:22:33:44:55
# option src_port 1024
# option src_dport 80
# option dest_ip 194.25.2.129
# option dest_port 120
# option proto tcp
root@OpenWrt:~#

rcpaul
 
Posts: 39
Joined: Sun Nov 09, 2014 4:20 am

Re: AP+STA Help Please

Mon Dec 19, 2016 1:56 am

And sorry pinging the server seems to work:

root@OpenWrt:~# ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=58 time=36.435 ms
64 bytes from 8.8.8.8: seq=1 ttl=58 time=46.336 ms
64 bytes from 8.8.8.8: seq=2 ttl=58 time=35.531 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 35.531/39.434/46.336 ms

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: AP+STA Help Please

Mon Dec 19, 2016 9:30 am

Ok, you are CONNECTED TO THE INTERNET :-)

But you can't resolve domain names, this is almost definitely a problem at GXS4N.

Demonstration:
If you don't get a response from-
Code: Select all
# ping -c1 google.com
PING google.com (216.58.216.78): 56 data bytes
64 bytes from 216.58.216.78: seq=0 ttl=54 time=70.111 ms

--- google.com ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 70.111/70.111/70.111 ms

I think you will get a response using the IP my VoCore2 got from the DNS server:
Code: Select all
# ping -c3 216.58.216.78
PING 216.58.216.78 (216.58.216.78): 56 data bytes
64 bytes from 216.58.216.78: seq=0 ttl=54 time=64.268 ms
64 bytes from 216.58.216.78: seq=1 ttl=54 time=71.393 ms
64 bytes from 216.58.216.78: seq=2 ttl=54 time=54.904 ms

--- 216.58.216.78 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 54.904/63.521/71.393 ms



HORRIBLE HACK WARNING- THIS IS STUPID, YOU SHOULDN'T NEED TO DO THIS, THE PROBLEM IS SOMEWHERE ELSE!!!
If this works add google's DNS servers to the wan section in /etc/config/network
Before-
Code: Select all
config interface 'wan'
   option ifname 'eth0.2'
   option force_link '1'
   option macaddr 'b2:8d:65:22:54:f2'
   option proto 'dhcp'

After-
Code: Select all
config interface 'wan'
   option ifname 'eth0.2'
   option force_link '1'
   option macaddr 'b2:8d:65:22:54:f2'
   option proto 'dhcp'
   option peerdns '0'
   option dns '8.8.8.8 8.8.4.4'

rcpaul
 
Posts: 39
Joined: Sun Nov 09, 2014 4:20 am

Re: AP+STA Help Please

Tue Dec 20, 2016 3:38 am

noblepepper, so far so good! I was able to opkg update and install python-light, now I need to figure out how to stream video from a usb camera, I think its something like this?:

opkg install kmod-video-core_3.10.49-1_ramips_24kec.ipk

opkg install kmod-video-videobuf2_3.10.49-1_ramips_24kec.ipk

opkg install kmod-input-core_3.10.49-1_ramips_24kec.ipk

opkg install libjpeg_6b-1_ramips_24kec.ipk

opkg install libpthread_0.9.33.2-1_ramips_24kec.ipk

opkg install librt_0.9.33.2-1_ramips_24kec.ipk

opkg install libv4l_1.2.1-2_ramips_24kec.ipk

opkg install mjpg-streamer_r182-1_ramips_24kec.ipk

noblepepper
 
Posts: 240
Joined: Sat Nov 29, 2014 3:22 pm

Re: AP+STA Help Please

Tue Dec 20, 2016 11:09 am

If you think this solved your original problem please edit your first post in this thread to put "SOLVED" in the subject. THANKS!

Please start another thread about video if you need help. Changing subjects in a thread makes it hard for others to find things in the future.

@cw5301 - It is considered rude to crash into a thread with your problem. It is likely your post will not be noticed (I just now saw your post) and it is less likely to be answered since you just aggravated someone. If the solution in a thread doesn't work for YOU, start another thread, if you think a thread is relevant to your problem reference it in your NEW thread.

@rcpaul - To summarize the the solution to your problem:

1. I believe you missed setting up the rc.local script

2. There is some issue in the upstream network configuration that prevents resolving domain names, the addition of google's dns servers to /etc/config/network should not be needed by anyone else (or you if you connect to another network)

Previous
Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 47 guests