Hello Toradex Team,
I am trying to set up the WiFi adhoc mode between my Ubuntu PC and Apalis iMX6 board. I have successfully done this, by making the Apalis imx6 as the main Accesspoint and then connecting my Ubuntu PC to it. I followed the following steps :
on iMX6 board:
ifconfig wifi_interface down iw wifi_interface set type ibss iwconfig wifi_interface essid MY_ADHOC ip link set wifi_interface up ifconfig wifi_interface 10.2.1.1
ifconfig wifi_interface down iw wifi_interface set type ibss ifconfig wifi_interface up iw wifi_interface ibss join MY_ADHOC 2432 ifconfig wifi_interface 10.2.1.2
Now this works completely fine. The problem is I want the iMX6 to do the above configuration automatically during after boot. So I wrote all the above commands in a file called
config_wlan and copied it to the the path
Later I wrote a service file in the path
/lib/systemd/system, and try to call the
config_wlan from ExecStart. Here is the service file : wlan.service
[Unit] Description=get the wifi up After=multi-user.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=sleep 60 && /usr/bin/config_wlan start wifi_interface iw ExecStop=/usr/bin/config_wlan stop wifi_interface iw [Install] WantedBy=multi-user.target
I enabled the service file using
systemctl enable wlan.service
Now after reboot, I expect the service to set up the adhoc mode at the iMX6 board, so that I can connect from my Ubuntu PC. But this does not happen. I also tried adding command
sleep 60 in the ExecStart but that did not help.
Can you guys point out to where I am going wrong with this one? Or is there any other method to get the adhoc mode up and running?