Barometer Logger – Day 4

Worked on air pressure plot and email notification.
It is important to visualize the value changes since I need to figure out what kind of changes could cause my sickness. For now I vaguely know that when the weather is getting worse, the headache starts. I am not sure whether the relative changes of the air pressure or an absolute low air pressure cause this.
I also implemented smoothing of the values by using exponential weighted average which I often use for simple low-pass filtering.

Exponential weighted average is obtained as below. Here, alpha is how much do you want into incorporate the new value to the average and is usually small value such as 0.1 or 0.01.

y[t] = y[t-1] * (1-alpha) + x[t] * alpha

Also, to know how far the current value is from the past average, I get the following:

z[t] = x[t] – y[t]

My current idea is if the above z is lower than a threshold, the server would send an email to me, notifying the air pressure is decreasing fast.

Barometer plot showing the pressure value trends at two sites.

The above screenshot shows how the plot display looks like. There are three series of air pressure – the blue one is from my office, the red one is from my home, the gray is the smoothed value of red series.
Our office is at the second floor and my home is on the 25th floor of an apartment. This difference of altitudes explains the offset of the two series.
It is also notable that the two series changes at the same way, same time, showing the sensor precision is good enough.

Eavesdropping my HTTP requests?

While working on this since last week, I noticed there are some unintended sensor log entries on the server. They are very strange because – one, the data format and the values from the sensor are old ones, and two, those entries were made even while I’m asleep. For several days, I really had no idea what is causing this. No one other than me could know the URL because no incoming and outgoing links. Also, the sensor is running fine, sending a request every 5 minutes regularly even when the bogus request had come. The request seems a legit one because it has a real sensor values (but the ones a couple of days ago). When I need to make a test HTTP request from my dev pc, I would use dummy values, so I suspected the strange requests were really coming from the sensor.

After bothering this for a few days, just today, by checking the IP address and the user-agent of the client of the bogus requests, I found those requests are from someone else on the same broadband service network, using or faking the user-agent which I don’t use. So I concluded this could be an automated web scanning trying to find potential vulnerability of the server. Of course, there is no damage on my side except that it could taint my log file. This attack is possible because the request from the sensor is using HTTP, not the secured one like TLS, so someone could be eavesdropping the network and mimicking the request.
Let’s not use HTTP for business!

Leave a Reply

Your email address will not be published. Required fields are marked *