How Activate wifi AP on mangOH red


#1

Hello,

I use a MangOH Red with WP7702.
I want to activate the AP wifi using the wifiwebAP interface.
But that does not work. When I click on “start”, nothing happens.

Is there a tutorial to explain how to activate the AP?

Best regards


#2

I test now with a wp8548.
I did what indicated in the topic https://github.com/mangOH/mangOH/wiki/mangOH-Red-mt7697-wifi

But when I do ifup wlan1 I have the error :
insmod: can’t insert ‘/legato/systems/current/modules/mt7697wifi_core.ko’: No such file or directory


#3

You need to wait for WP8548 release 16 which will be available soon


#4

HI,

Now the wifiwebAP work on WP7702.
I can activate an AP. I can see the AP on my laptop

Now I want activate the AP in a consol on mangHO.
I enter this instructions:

wifi ap setssid “GARGAMEL”
wifi ap setmaxclients 5
wifi ap setsecurityproto 1
wifi ap setpassphrase “my_pass”
wifi ap setdiscoverable 1
wifi ap setchannel 1
wifi ap start wlan1
ifconfig wlan1 192.168.20.1 netmask 255.255.255.0 up

The ifconfig return ;

wlan1 Link encap:Ethernet HWaddr 00:0C:43:76:87:22
inet addr:192.168.20.1 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::20c:43ff:fe76:8722%1221664508/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:251 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:76707 (74.9 KiB)

BUT I don’t see the “GARGAMEL” AP on my laptop.


#5

Hi,
I found the right sequence to activate the AP in a consol:

wifi ap setssid GARGAMEL
wifi ap setdriver 1
wifi ap setmaxclients 5
wifi ap setsecurityproto 1
wifi ap setpassphrase my_pass
wifi ap setdiscoverable 1
wifi ap setchannel 1
wifi ap start wlan1
ifconfig wlan1 192.168.20.1 netmask 255.255.255.0 up
/etc/init.d/dnsmasq start

with in the dnsmasq.wlan.conf file: dhcp-range=wlan1,192.168.20.10,192.168.20.100,24h

Now I want activate the AP when I turn ON the manghoRed.
Test n°1 : I add the command in the init.d/data-init file, but it does not work.

Test N°2 : I create an app (command called by “RunSystemCommand” in the C file). When I start the app by the command “app start my_app” , it does not work. I can see " RunSystemCommand() 36 | Error wifi ap setssid GARGAMEL Failed: (32512)" with logread. If I start the application from the directory “/legato/apps/…/read_only/bin”, It work !!

Would you have the solution to activate the AP ?

Laurent


#6

Hi,

Do not use “wifi” command line tool from your app.
Instead use Legato WiFi APIs:
https://docs.legato.io/latest/c_le_wifi_ap.html

Jay


#7

Hi,

So I tested with api.
But it does not work. I put my file in attachment. I want to use wlan1
llb.c (6.8 KB)

the log in logread:

Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | llb[3400]/llbComponent T=main | llb.c _llbComponent_COMPONENT_INIT() 242 | ======== WiFi AP Test ========
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | llb[3400]/llbComponent T=main | llb.c Testle_wifiApStart() 187 | Start Test WiFi access point
Sep 5 14:05:55 swi-mdm9x28 user.debug Legato: DBUG | llb[3400]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_wifiAp_ClientData’ overflowed. Expanded to 1 blocks.
Sep 5 14:05:55 swi-mdm9x28 user.debug Legato: DBUG | wifiService[984]/daemon T=main | le_wifiAp.c le_wifiAp_AddNewEventHandler() 89 | Add new event handler
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetSsid() 1178 | SSID length 8 | SSID: “GARGAMEL”
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetPassPhrase() 1286 | Set passphrase
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetSecurityProtocol() 1249 | Security protocol : 1
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetDiscoverable() 1367 | Set discoverability
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetChannel() 1393 | Set channel
Sep 5 14:05:55 swi-mdm9x28 user.err Legato: =ERR= | llb[3400]/llbComponent T=main | llb.c Testle_wifiApStart() 206 | Start ERROR
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetIpRange() 1497 | @AP=c0a81401, @APstart=c0a8140a, @APstop=c0a81414
Sep 5 14:05:55 swi-mdm9x28 user.err Legato: =ERR= | wifiService[984] | ifconfig: SIOCSIFADDR: No such device
Sep 5 14:05:55 swi-mdm9x28 user.err Legato: =ERR= | wifiService[984]/daemon T=main | pa_wifi_ap_ti.c pa_wifiAp_SetIpRange() 1527 | Unable to mount the network interface.
Sep 5 14:05:55 swi-mdm9x28 user.emerg Legato: EMR | llb[3400]/llbComponent T=main | llb.c Testle_wifiApStart() 209 | Assert Failed: 'LE_OK == le_wifiAp_SetIpRange(HOST_IP, IP_RANGE_START, IP_RANGE_END
Sep 5 14:05:55 swi-mdm9x28 user.debug Legato: DBUG | wifiService[984]/framework T=main | le_wifiAp_server.c CleanupClientData() 148 | Client 0x7f57dd8c is closed !!!
Sep 5 14:05:55 swi-mdm9x28 user.debug Legato: DBUG | wifiService[984]/framework T=main | le_wifiAp_server.c CleanupClientData() 174 | Found session ref 0x7f57dd8c; match found, so needs cleanup
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | supervisor[662]/supervisor T=main | proc.c proc_SigChildHandler() 2035 | Process ‘llb’ (PID: 3400) has exited with exit code 1.
Sep 5 14:05:55 swi-mdm9x28 user.warn Legato: -WRN- | _appStopClient[3407]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
Sep 5 14:05:55 swi-mdm9x28 user.warn Legato: -WRN- | supervisor[662]/supervisor T=main | app.c app_SigChildHandler() 3457 | Process ‘llb’ in app ‘llb’ faulted: Ignored.
Sep 5 14:05:55 swi-mdm9x28 user.info Legato: INFO | supervisor[662]/supervisor T=main | apps.c DeactivateAppContainer() 374 | Application ‘llb’ has stopped.


#8

It seems that your application is based on the “old” version of WiFi AP test application.
For mangOH Red WiFi chip (MT7697), you have applied some patches as explained in the wiki page.
After applying the patches, the WiFi AP test application is modified:

  • le_wifiAp_Start()
    is replaced by:
    le_wifiAp_StartInterface(TEST_INTERFACE_STR)

  • le_wifiAp_SetIpRange(HOST_IP, IP_RANGE_START, IP_RANGE_END))
    is replaced by:
    le_wifiAp_SetIpRange(HOST_IP, IP_RANGE_START, IP_RANGE_END, TEST_INTERFACE_STR))

Could you try to modify your own app (llb.c) with this new TEST_INTERFACE_STR parameter?