1 2 Previous Next 17 Replies Latest reply on Apr 10, 2015 5:17 PM by mpenna

    Service disabling wifi

    jblackston

      When I start up the Edison and log in the Wifi is up and fine and when I run my software all is good. When I try to cause my application to run as a service it seems like when I boot up the Edison and log in WiFi is off and does not work, it's like my application caused the WiFi to go down. When I disable the service and reboot the WiFi is back up and running. Any ideas as to why this would occur. My service is starts after network.target

       

      Also is there a way to find out what is the last service to be loaded?

        • 1. Re: Service disabling wifi
          Intel_Peter

          Hello jblackston,

           

          What service are you trying to run? And, what steps did you take before the Wi-Fi stopped working?

           

          Peter.

          • 2. Re: Service disabling wifi
            jblackston

            It's an application I wrote that creates a communication server to talk to clients via TCP/IP and broadcasts a UDP discovery message. At one point with my software using nsoftwares library IPInfo I would check the interfaces that have been connected and only until I saw the "wlan0" would my software continue. But once I noticed that the "wlan0" seemed to never be created or started when my service was active I tried removing that bit of code to see if that was the issue, and it was not.

            • 3. Re: Service disabling wifi
              Intel_Peter

              Hello jblackston,

               

              Could you attach all necessary files here? I'll try to replicate your issue and tell you what happens.

               

              Peter.

              • 4. Re: Service disabling wifi
                jblackston

                I can't send you the application file I'm using as it's a company product. Is there a log file that gets generated by the Edison on boot that I could possibly send to you that might help.

                • 5. Re: Service disabling wifi
                  jblackston

                  On thing I notice... With the my software running as a service the logfile I create shows that its checking for the 'wlan0' bridge it's never found so the software just keeps looking for it. If I log in an quickly do a ifconfig I'll see that the 'wlan0' interface is present but no IP address has been assigned and then after a big the interface goes away. Now of course if I disable my service and then restart the Edison the interface has no issues finding the IP address to the network. If I do not have my software checking to see if the interface is up and just goes on to doing what's needed to be done I get the same result so I don't think it has anything to do with checking to see if a specific interface is up... But I'm not sure what my software could be doing that would cause the interface to not grab an IP address.

                   

                  I can send you the binary of my program for you to try, privately.

                  • 6. Re: Service disabling wifi
                    mhahn

                    system logging:

                    journalctl - you can configure it to write to a file

                     

                    wpa_supplicant logging - also can be set to write to a file; also log level can be modified

                     

                    alternatively, if you use "connmand" for your networks you can also start it with debug logs e.g.

                    • 7. Re: Service disabling wifi
                      jblackston

                      How do I enable/disable debug logging for those services?

                      • 8. Re: Service disabling wifi
                        mhahn

                        e.g. temporarily modify the service files in /lib/systemd/system and "systemctl restart <servcice>"

                        • 9. Re: Service disabling wifi
                          CMata_Intel

                          Hi jblackston ;

                           

                          Were you able to disabling the services that you need?

                           

                          Regards;

                          CMata

                          • 10. Re: Service disabling wifi
                            jblackston

                            Yes I'm able to. Right now for my code I check to see if the service is up and if it's not I do a system command to force it up and then wait a timeout again. If it's not up I assume it failed to connect to network and issue the APMode system command. So far that seems to have solved the issue.

                            • 11. Re: Service disabling wifi
                              mpenna

                              Hi jblackston,

                               

                              Right now I'm facing the exact same problem. WiFi (wlan0) works fine if I run my service manually (logging in via the console and issuing a "systemctl start <service-name>"), but if I enable my service to autostart during boot (systemctl enable <service-name>), then WiFi just won't work. Would you mind detailing a bit more the steps you took to get this going? From your description, my service is way simpler than yours, like I'm not doing any "network is up" checking, but one of the first actions my service does is try to access a web service. I have already tried configuring my service to run "After" various targets, but it made no difference. I've also tried a dumb move, like putting a wait/sleep instruction at the beginning of my service script, forcing an actual delay before it goes on doing what it's supposed to do, but that didn't make no difference either.

                               

                              regards

                              • 12. Re: Service disabling wifi
                                mpenna

                                Could somebody here give a hand? Despite having being marked as answered, there's not enough information on the thread which one could use to fix the issue. I don't want to open a new thread, since the problem I'm having is exactly the same.

                                • 13. Re: Service disabling wifi
                                  CMata_Intel

                                  Hi mpenna

                                   

                                  Which of the suggestions above have you tried?

                                  You can also create your own service to connect your board to a specific WiFi network.

                                  Re: Start wpa_supplicant on boot

                                  Re: Startup scripts on Edison

                                  When you are not using your service is the WiFi working fine?

                                   

                                  Regards;

                                  CMata

                                  • 14. Re: Service disabling wifi
                                    mpenna

                                    Hi CMata,

                                     

                                    If I don't configure my service to autostart, WiFi then works fine: Edison connects without any issues to my WLAN upon booting up. I can then log either via a serial terminal (e.g. Putty) or via SSH and manually start my service. Whenever I do this, my service too works fine. The problem arises whenever I configure my service to autostart. In such case, WiFi simply stops working altogether. I tried configuring my service to start "after" different "targets", but it made no difference.

                                     

                                    Right now my service startup script looks like this:

                                     

                                    [Unit]

                                    Description=my-custom-service

                                    After=network.target

                                     

                                    [Service]

                                    User=root

                                    ExecStart=/home/root/mycustomservice/__main__.py

                                    WorkingDirectory=/home/root/mycustomservice

                                     

                                    [Install]

                                    WantedBy=multi-user.target

                                     

                                    Any ideas?

                                    1 2 Previous Next