I am working on updating some wifi-driver software. My end goal is to be able to trigger the wifi on/off and use a callback function to do something whenever a new device connects. Right now, the legato code supports 3 apps that work via the command line to perform “sample” functionality, but the only way to control it is through bash, so I can’t get a callback function into the mix or get notified when there is a connection. I would like to embed the functionality into some code for better control. Unfortunately, I can’t figure out where all of the source files are.
So, for example, one issue is compiling the open source wifi code here: GitHub - legatoproject/legato-WiFi: WiFi support for Legato . When I run “make wp85”, I get an error saying there are missing files[2]. I thought maybe this may just be reference code without a working makefile, so I pulled all of the wifi code out into my own little directory, but there are a ton of function calls that don’t seem to be declared anywhere. I downloaded the git repo here for release 17.10: GitHub - legatoproject/legato-af: Legato Application Framework and the function is nowhere to be found. For example, here is a link to a search i did through the whole legato project for a function declaration I am getting an error on with one result - the invocation of the function: https://github.com/search?q=org%3Alegatoproject+le_wifiClient_GetClientSessionRef&type=Code . This is one of a few hundred function calls that I can’t find the declaration for. Furthermore, “interface.h” file seems to be required for every file, is there any way that I can generate this? All of the .c files include the same “interface.h” file but there have to be 50 in the legato source tree.
Overall, I am lost on how I should go about this. Do you have any idea about how my task could be accomplished, or do you have any other ideas?
Thank you for your time!
[1]
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ cfgLegato
Modules: wp85, wp750x
SDK Path: /home/mangoh/legato/packages/legato.sdk.17.6.0.wp85-wp75-native-x86_64-201707120921
Framework Path: /home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855 - $LEGATO_ROOT
Toolchain Path: /home/mangoh/legato/packages/legato.toolchain.1.7.3.SWI9X15Y_07121000-wp85-wp750x-native-x86_64-201707120848 - $WP85_TOOLCHAIN_DIR $WP750X_TOOLCHAIN_DIR
Device Image Path: /home/mangoh/legato/packages/legato.device.image.7.12.10.00.wpX5-201707120854 - $LEGATO_DEVICE_IMAGE
Recovery tools Path: /home/mangoh/legato/packages/legato.recovery.4.0.6.1.linux-201704190909 - $LEGATO_RECOVERY
No toolchain found for target ‘ar7’.
Unable to find compatible cross-build toolchain for target ‘ar7’.
No toolchain found for target ‘ar86’.
Unable to find compatible cross-build toolchain for target ‘ar86’.
Toolchain specified for target ‘wp76xx’ is invalid.
Unable to find compatible cross-build toolchain for target ‘wp76xx’.
Toolchain specified for target ‘ar758x’ is invalid.
Unable to find compatible cross-build toolchain for target ‘ar758x’.
Toolchain specified for target ‘ar759x’ is invalid.
Unable to find compatible cross-build toolchain for target ‘ar759x’.
Toolchain specified for target ‘em75xx’ is invalid.
Unable to find compatible cross-build toolchain for target ‘em75xx’.
/home/mangoh/repos/legato-af-16.10.3
Hi,
Which wifi driver code you are trying to build?? In the description you have told that you are trying to build the https://github.com/legatoproject/legato-WiFi, It is not a wifi drivers code, It is wifi service and wifi sample applications code.
Please let me know if you have confused or if my understanding of your description is wrong.
Also you have told your end goal is to trigger the wifi on/off and use a callback function to do something whenever a new device connects, If my understanding is correct you want to use your module as wifi access point and start the wifi access point using the application and get notification using the callback fucntion in the application when a new client connects your module’s wifi access point?? Please let me know if my understanding is correct or not.
@muralinagraj, you are correct - I want to use my module as a wifi access point and start the wifi access point using the application and get notification using the callback function in the application when a new client connects.
OK, I can build the apps if I move to the large legato-af github repository, this is great news! But there is another problem -
I am working through modifying some of the built in apps, in the base big legato directory from here: GitHub - legatoproject/legato-af: Legato Application Framework , and if I install any of the apps WITHOUT modifying them, I get an error[1] about a protocol ID, which is not very descriptive. I assume this is because the legato development environment is 17.10 , while my legato version on the board is 16.10.
So, I downloaded the releases for both 16.10.1 and 16.10.3 and I get an error building both platforms, the same error here:
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ ./bin/legs
Using legato framework found under ‘/home/mangoh/repos/legato-af-16.10.3/.’
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ export PATH=/home/mangoh/repos/legato-af-16.10.3/./bin:/home/mangoh/repos/legato-af-16.10.3/./bin:/home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855/resources/legato/bin:/home/mangoh/bin:/home/mangoh/.local/bin:/home/mangoh/bin:/home/mangoh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mangoh/legato/packages/legato.framework.17.6.0.wp85-wp750x-201707120855/resources/legato/build/localhost/bin:/home/mangoh/repos/legato-af-16.10.3/./build/localhost/framework/bin:/home/mangoh/repos/legato-af-16.10.3/./build/localhost/framework/bin
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ source /home/mangoh/repos/legato-af-16.10.3/./framework/tools/scripts/configToolchainDirEnvVars
No toolchain found for target ‘ar7’.
Unable to find compatible cross-build toolchain for target ‘ar7’.
No toolchain found for target ‘ar86’.
Unable to find compatible cross-build toolchain for target ‘ar86’.
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ exec <> /dev/tty
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$ make wp85
make -f Makefile.hostTools
make[1]: Entering directory ‘/home/mangoh/repos/legato-af-16.10.3’
Using ninja installed at: /usr/bin/ninja
ln -sf …/build/tools/mk bin/mk
ln -sf mk bin/mkcomp
ln -sf mk bin/mkexe
ln -sf mk bin/mkapp
ln -sf mk bin/mksys
ln -sf …/framework/tools/scripts/findtoolchain …/framework/tools/scripts/instsys …/framework/tools/scripts/settime …/framework/tools/scripts/mkinfo …/framework/tools/scripts/instlegato …/framework/tools/scripts/stoplegato …/framework/tools/scripts/settz …/framework/tools/scripts/createsdk …/framework/tools/scripts/legato-qemu …/framework/tools/scripts/checkpa …/framework/tools/scripts/update-pack …/framework/tools/scripts/security-pack …/framework/tools/scripts/instapp …/framework/tools/scripts/mklegatoimg …/framework/tools/scripts/app …/framework/tools/scripts/av-pack …/framework/tools/scripts/releaselegato …/framework/tools/scripts/sbhelper …/framework/tools/scripts/systocwe …/framework/tools/scripts/configlegatoenv …/framework/tools/scripts/update …/framework/tools/scripts/configtargetssh …/framework/tools/scripts/legs …/framework/tools/scripts/gettargettype …/framework/tools/scripts/update-util …/framework/tools/scripts/configToolchainDirEnvVars …/framework/tools/scripts/simu …/framework/tools/scripts/fwupdate …/framework/tools/scripts/setname …/framework/tools/scripts/mkdoc …/framework/tools/scripts/startlegato …/framework/tools/scripts/shlib bin/
ln -sf …/framework/tools/ifgen/ifgen bin/
ninja -f /home/mangoh/repos/legato-af-16.10.3/build/tools/build.ninja
ninja: no work to do.
make[1]: Leaving directory ‘/home/mangoh/repos/legato-af-16.10.3’ ‘platformAdaptor’ directory is missing, which means these Legato sources have not been downloaded properly.
Please refer to GitHub - legatoproject/legato-af: Legato Application Framework
Makefile:174: recipe for target ‘platformAdaptor’ failed
make: *** [platformAdaptor] Error 1
mangoh@mangoh-virtualbox:~/repos/legato-af-16.10.3$
So, at this point I’m pretty lost. legato-17 will build, but when updated to the device, the app crashes. And for versions earlier than this, I can’t build. What is the next step? Thanks for your help!
Error[1]
Jan 19 16:25:25 swi-mdm9x15 user.err Legato: =ERR= | serviceDirectory[472]/serviceDirectory_exe T=main | serviceDirectory.c DispatchToServer() 713 | Client (uid 0 ‘root’, pid 1894) disagrees with server (uid 0 ‘root’, pid 534) on protocol ID of service 'wifiApTest.wifiApT
Jan 19 16:25:25 swi-mdm9x15 user.emerg Legato: EMR | UNKNOWN[1894]/framework T=main | LE_FILENAME ReceiveSessionOpenResponse() 684 | Unexpected server response: -6 (LE_FAULT).
Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | proc.c proc_SigChildHandler() 1942 | Process ‘wifiApTest’ (PID: 1894) has exited with exit code 1.
Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process ‘wifiApTest’. Assuming ‘ignore’.
Jan 19 16:25:26 swi-mdm9x15 user.warn Legato: -WRN- | _appStopClient[1895]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
Jan 19 16:25:26 swi-mdm9x15 user.warn Legato: -WRN- | supervisor[468]/supervisor T=main | app.c app_SigChildHandler() 3221 | Process ‘wifiApTest’ in app ‘wifiApTest’ faulted: Ignored.
Jan 19 16:25:26 swi-mdm9x15 user.info Legato: INFO | supervisor[468]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘wifiApTest’ has stopped.