Wednesday, April14, 2021
Privacy Policy
L-36.com

DIY Boat Monitoring WiFi




I have wanted to do something like this for several years but my marina WiFi always stopped me. To log in you have to go to a web page and enter a password. It is not enough to just sign onto the local hot spot, you have to agree to the terms, enter your password, and click ACCEPT. You also have to do this every time you sign on. I worked for several days with some decoding software trying to figure out how to do this from the little ESP. The only reason I kept at it was my friend in The Netherlands really wanted to do his Mobile network based one and needed help on the overall code. He kept encouraging me. I contacted my harbor master who was new. He gave a few suggestions that were not helpful. In the process of trying to solve the issue, I noticed there was another access point that was secure. That is what I wanted access to. I reformed my question to ask for permission to have an account on that access point. I think the question was now such that the IT person would have to answer it and low and behold that access point had been created for another boater in a similar situation. After agreeing never to tell anyone my user name or password I had network credentials and was able to send a test message to my home.

Ah, but nothing is really that simple. What I did was create a new Gmail account with a new user name. Then I set that account to accept insecure traffic so it can listen to the lowly ESP. Then I set up an auto forward to send the email to my normal email address. In use the process is completely transparent. You just do not want to switch your normal email account to accept insecure traffic and having the intermittent account solves that problem. There is an excellent tutorial that goes through the entire process HERE.

One of the issues is that the clock on the ESP32 is not very accurate so if you want and email at 6AM, before long it will start coming at 6PM. To avoid this, I needed to know what time it was. Since I have an Internet connection I could contact the Network Time Protocol (NTP) to read the time. I modified the email code to read the time and calculate how many seconds until it is time to send the email. I could add that to the current reading of the system clock and get a target system time for the next email. This keeps the messages coming between 6:00 and 6:30 every morning. There is another excellent tutorial HERE that I used as the basis of reading the time. I just had to add the code to calculate the next send time. That got a little messy as if the timing is off and the message is sent at 5:59 because the internal clock thinks it is already 6:00 I needed to make sure it would not send another message one minute later although that would not be a huge problem.
NEXT⇨


Please read website Cookie, Privacy, and Disclamers by clicking HERE.