TRAVIS: WiFi Troubleshooting Adventures
I found that writing about my wifi troubleshooting issues on my TRAVIS blog was making my posts very long and cumbersome. So I decided to collect my findings here. That way it also makes it easier for me to look back on if the issues persist. At first I was using my phone to create a hotspot between the MKR 1000 and my computer. Now I am using a TP-link.
March 27th, 2018.
Having a low battery, but not 100% dead could also be the culprit. Today the TRAVIS Arduino worked fine. However, I tried connecting the RUBS Arduino (also using the MKR1000) because I am doing a collaborative piece with it. It connected for a minute, then disconnected. I tried charging the battery for a few hours, as well as all the typical troubleshooting steps, and it still would not connect. I did check [MRaverage] and it loaded properly, so that wasn't the reason either! I also tried uploading my TRAVIS Arduino code (with 4 sensors) to the RUBS Arduino, and it connected fine. Then when I uploaded the proper RUBS code back onto it (with 8 sensors), it would not connect. I think this is a RUBS code problem and not a hardware problem, but it got me thinking "what if [MRaverage] wasn't the only wireless issues I was having with TRAVIS?". I'm going to be extra vigilant on charging my battery for now on, and I'll keep an eye out for any other wireless problems that could not be related to [MRaverage].
Having a low battery, but not 100% dead could also be the culprit. Today the TRAVIS Arduino worked fine. However, I tried connecting the RUBS Arduino (also using the MKR1000) because I am doing a collaborative piece with it. It connected for a minute, then disconnected. I tried charging the battery for a few hours, as well as all the typical troubleshooting steps, and it still would not connect. I did check [MRaverage] and it loaded properly, so that wasn't the reason either! I also tried uploading my TRAVIS Arduino code (with 4 sensors) to the RUBS Arduino, and it connected fine. Then when I uploaded the proper RUBS code back onto it (with 8 sensors), it would not connect. I think this is a RUBS code problem and not a hardware problem, but it got me thinking "what if [MRaverage] wasn't the only wireless issues I was having with TRAVIS?". I'm going to be extra vigilant on charging my battery for now on, and I'll keep an eye out for any other wireless problems that could not be related to [MRaverage].
March 21st, 2018.
I ripped through every possible combination and ordering for setting up all my equipment and connecting the Arduino to Max. I could not find the reason for the connection issues for the life of me. Then randomly during rehearsal the arduino did not connect at all. But the light was blinking saying that it was connected. It completely baffled me, so I opened the original Arduino to Max patch (not the bpatcher). I discovered that an external object, [MRaverage], was randomly not loading properly, so it blocked the data! It was 100% within my file search path, so there is no reason why Max would have problems finding it. I have copied the object file and pasted it in more folders, as well as added the individual subfolders to the file preferences, so that my patches would for sure find at least one of the copies of [MRaverage].
I normally use the Arduino to Max patch as a bpatcher, and the majority of the times when the connection failed it was in a performance/presentation situation, so I did not have the time to open up the original patch and look at the code. I also always assumed it was some sort of wifi connection error, and I have never seen my patches have issues with finding [MRaverage] before. It's also an oddity that this happened on two separate computers with two different file search paths; one of which already had [MRaverage] downloaded and working long before I started borrowing it. Also, whether [MRaverahe] would load or not was completely random and inconsistent. And every other time I had opened the original patch to work on it, [MRaverage] had loaded properly, so it never occurred to me that something inside the patch could have been the problem. Especially since I've lived with extremely horrendous wifi for my entire childhood, so I always automatically think of wireless connection problems first. It's a fluke that takes a 1 in a million chance to catch. But at least I found it now!
Update: while [MRaverage] was definitely an issue, I now have an inkling of doubt that it was not the only reason. See above post.
I ripped through every possible combination and ordering for setting up all my equipment and connecting the Arduino to Max. I could not find the reason for the connection issues for the life of me. Then randomly during rehearsal the arduino did not connect at all. But the light was blinking saying that it was connected. It completely baffled me, so I opened the original Arduino to Max patch (not the bpatcher). I discovered that an external object, [MRaverage], was randomly not loading properly, so it blocked the data! It was 100% within my file search path, so there is no reason why Max would have problems finding it. I have copied the object file and pasted it in more folders, as well as added the individual subfolders to the file preferences, so that my patches would for sure find at least one of the copies of [MRaverage].
I normally use the Arduino to Max patch as a bpatcher, and the majority of the times when the connection failed it was in a performance/presentation situation, so I did not have the time to open up the original patch and look at the code. I also always assumed it was some sort of wifi connection error, and I have never seen my patches have issues with finding [MRaverage] before. It's also an oddity that this happened on two separate computers with two different file search paths; one of which already had [MRaverage] downloaded and working long before I started borrowing it. Also, whether [MRaverahe] would load or not was completely random and inconsistent. And every other time I had opened the original patch to work on it, [MRaverage] had loaded properly, so it never occurred to me that something inside the patch could have been the problem. Especially since I've lived with extremely horrendous wifi for my entire childhood, so I always automatically think of wireless connection problems first. It's a fluke that takes a 1 in a million chance to catch. But at least I found it now!
Update: while [MRaverage] was definitely an issue, I now have an inkling of doubt that it was not the only reason. See above post.
March 17th, 2018.
Update: all of my arduino connection solutions, and hypotheses written bellow have now been proven false. I've decided to leave this posted because it was a long road of trials and errors until I figured it out and I don't want to forget everything that has happened. Please see more up to date posts regarding the final solution to my arduino connection problems.
While I was setting up, I discovered something that may be the key to all of my Arduino/Wifi connection issues. Before it seemed random and it happened very rarely. There were many times where I tried to re-create scenarios/problems in order to test, but I could not narrow down the cause. Now I think I may have found it, and how to prevent it. I just want to make clear that I had enough time to setup at MURC in order to fix it, and I was able to fully demo TRAVIS at the event. When I had the projector plugged in before trying to connect the Arduino, it would not connect. I tried unplugging the projector, and it connected. Then I plugged back in the projector and it stayed connected. Therefore, if I ever use a projector with TRAVIS, I must connect the Arduino first. I still need to test this again, but I am 97% sure I am right about this.
I will summarize all of my experiences leading up to today.
I think it is worth mentioning that every time I had an issue it was at UBC, or UMich. There does not seem to be any problems anywhere else. Incidences 1-4 all happened within a span of 1-2 weeks after we had initially got the MKR1000 operational.
1) The first time it happened, I realized I had a duplicate Arduino to Max patch open in the background and it got confused.
2) There were a couple times during the "Fire and Ice" rehearsals where my computer was connected to the TRAVIS hotspot, but that the Arduino would not connect. For some reason this seemed to only happen when my composition partners walked into the room. I thought one of them was giving it bad joojoo. I was using both Thunderbolt 3 ports and networking computers with Elizabeth. When it stopped working, I used my 3 port USB adapter to connect the M-Audio interface, the Logitec controller, and the Arduino. The Arduino would then send the data through the micro-USB cable. However this did not make any sense. This is because I had copied and pasted part of my old Lilypad code into the MKR1000 code, so it will send data through the cable if plugged in, BUT the MKR1000 still has to do a handshake with the IP address in order to release any data at all. Yes, this is a flaw in the code and I have been looking into a way to fix this. But, that still begs the question for why the Arduino was able to send data wired at all if it could not send data wirelessly. I found that if it connected wirelessly, then dropped data, then connected through the wire; it still worked. I think maybe because it previously did the handshake.
At this point, it didn't happen enough for me to really be too concerned... yet.
3) February 14th, 2018: We demonstrated "Fire and Ice" in the Roy Barnett Hall. My laptop refused to connect to any internet connection at all. It is a brand new Macbook Pro running High Sierra. It could have been something to do with the Hall because internet connection has always been bad in there. A restart did not help. But when I completely shut down my computer, then turned it back on, it connected. After google searching, this seems to be a common problem with my particular brand of laptop. I have a suspicion it could have been because my laptop was in sleep mode before setting up. However, whenever I put my laptop to sleep in my apartment, then wake it up again, it does not have a problem.
During this demo, Dr. Bob brought out his laptop that I had previously borrowed during my poor Toshiba PC days. Once we transferred our patch to that computer, the Arduino connected to it and we could run everything. Immediately after this demo I was running to the airport because I was going to present TRAVIS at University of Michigan. Dr. Bob told me to bring both my laptop and his just in case.
4) February 16th, 2018: Presentation day at UMich and I decided to run TRAVIS on Dr. Bob's laptop from the get go because it appeared more reliable. The professors there were having a hard time setting up a 4-multichannel system for me. The long setup pushed the presentation to start late and the moment I saw that the Arduino was not connecting, I opted for Plan B with showing pre-recorded demo videos as there was no time left for troubleshooting. At that time, I could not see any reason for why the Arduino would not connect. The computer connected to my TRAVIS hotspot fine. I did plug in the interface and projector before opening Max MSP.
5) March 17th, 2018: I had not had a single connection problem with my computer or Arduino in the time between my Michigan presentation and today, so I began thinking my connection problems were behind me. As mentioned earlier, the computer was connected to my hotspot. I plugged in the interface and projector. Then I opened Max and the Arduino did not connect. I quit Max, unplugged the projector, opened Max again, connected the Arduino, then plugged the projector back in. Everything ran smoothly.
As I thought back to my UMich presentation, I remembered I had plugged the projector into Dr. Bob's computer first. This leads me to believe it is a problem with the ordering of plugging in projectors to Macbooks, or perhaps all laptops, before the Arduino. As this has happened with two different Macbook Pro models, I am positive that this cause is at least NOT a local problem with my particular laptop.
Steps for further testing:
1) Try to re-create the problem and solution on both my laptop, and Dr. Bob's borrowed laptop. This will determine if this is the cause once and for all.
2) See if I can find a PC, or a couple of PCs, to connect the Arduino to. Then repeat the testing process. This will determine if the problem is consistent across all computers, or if it only happens with Macs.
Update: all of my arduino connection solutions, and hypotheses written bellow have now been proven false. I've decided to leave this posted because it was a long road of trials and errors until I figured it out and I don't want to forget everything that has happened. Please see more up to date posts regarding the final solution to my arduino connection problems.
While I was setting up, I discovered something that may be the key to all of my Arduino/Wifi connection issues. Before it seemed random and it happened very rarely. There were many times where I tried to re-create scenarios/problems in order to test, but I could not narrow down the cause. Now I think I may have found it, and how to prevent it. I just want to make clear that I had enough time to setup at MURC in order to fix it, and I was able to fully demo TRAVIS at the event. When I had the projector plugged in before trying to connect the Arduino, it would not connect. I tried unplugging the projector, and it connected. Then I plugged back in the projector and it stayed connected. Therefore, if I ever use a projector with TRAVIS, I must connect the Arduino first. I still need to test this again, but I am 97% sure I am right about this.
I will summarize all of my experiences leading up to today.
I think it is worth mentioning that every time I had an issue it was at UBC, or UMich. There does not seem to be any problems anywhere else. Incidences 1-4 all happened within a span of 1-2 weeks after we had initially got the MKR1000 operational.
1) The first time it happened, I realized I had a duplicate Arduino to Max patch open in the background and it got confused.
2) There were a couple times during the "Fire and Ice" rehearsals where my computer was connected to the TRAVIS hotspot, but that the Arduino would not connect. For some reason this seemed to only happen when my composition partners walked into the room. I thought one of them was giving it bad joojoo. I was using both Thunderbolt 3 ports and networking computers with Elizabeth. When it stopped working, I used my 3 port USB adapter to connect the M-Audio interface, the Logitec controller, and the Arduino. The Arduino would then send the data through the micro-USB cable. However this did not make any sense. This is because I had copied and pasted part of my old Lilypad code into the MKR1000 code, so it will send data through the cable if plugged in, BUT the MKR1000 still has to do a handshake with the IP address in order to release any data at all. Yes, this is a flaw in the code and I have been looking into a way to fix this. But, that still begs the question for why the Arduino was able to send data wired at all if it could not send data wirelessly. I found that if it connected wirelessly, then dropped data, then connected through the wire; it still worked. I think maybe because it previously did the handshake.
At this point, it didn't happen enough for me to really be too concerned... yet.
3) February 14th, 2018: We demonstrated "Fire and Ice" in the Roy Barnett Hall. My laptop refused to connect to any internet connection at all. It is a brand new Macbook Pro running High Sierra. It could have been something to do with the Hall because internet connection has always been bad in there. A restart did not help. But when I completely shut down my computer, then turned it back on, it connected. After google searching, this seems to be a common problem with my particular brand of laptop. I have a suspicion it could have been because my laptop was in sleep mode before setting up. However, whenever I put my laptop to sleep in my apartment, then wake it up again, it does not have a problem.
During this demo, Dr. Bob brought out his laptop that I had previously borrowed during my poor Toshiba PC days. Once we transferred our patch to that computer, the Arduino connected to it and we could run everything. Immediately after this demo I was running to the airport because I was going to present TRAVIS at University of Michigan. Dr. Bob told me to bring both my laptop and his just in case.
4) February 16th, 2018: Presentation day at UMich and I decided to run TRAVIS on Dr. Bob's laptop from the get go because it appeared more reliable. The professors there were having a hard time setting up a 4-multichannel system for me. The long setup pushed the presentation to start late and the moment I saw that the Arduino was not connecting, I opted for Plan B with showing pre-recorded demo videos as there was no time left for troubleshooting. At that time, I could not see any reason for why the Arduino would not connect. The computer connected to my TRAVIS hotspot fine. I did plug in the interface and projector before opening Max MSP.
5) March 17th, 2018: I had not had a single connection problem with my computer or Arduino in the time between my Michigan presentation and today, so I began thinking my connection problems were behind me. As mentioned earlier, the computer was connected to my hotspot. I plugged in the interface and projector. Then I opened Max and the Arduino did not connect. I quit Max, unplugged the projector, opened Max again, connected the Arduino, then plugged the projector back in. Everything ran smoothly.
As I thought back to my UMich presentation, I remembered I had plugged the projector into Dr. Bob's computer first. This leads me to believe it is a problem with the ordering of plugging in projectors to Macbooks, or perhaps all laptops, before the Arduino. As this has happened with two different Macbook Pro models, I am positive that this cause is at least NOT a local problem with my particular laptop.
Steps for further testing:
1) Try to re-create the problem and solution on both my laptop, and Dr. Bob's borrowed laptop. This will determine if this is the cause once and for all.
2) See if I can find a PC, or a couple of PCs, to connect the Arduino to. Then repeat the testing process. This will determine if the problem is consistent across all computers, or if it only happens with Macs.