Friday, October 9, 2015

24: More Photons

I received 2 more Particle Photons this week. Seems like a bargain: $19 each plus $6 shipping, 12 day USPS delivery.

I had no trouble getting them setup using the iPhone App. I now have a total of 5 Particle devices: 1 Core and 4 Photons.

I succeeded in remote updating my live system without a hitch. Why not. Even when the Photon was 2 feet away the recompile/download was going through the cloud. So what's a hundred miles?

But this doesn't mean I have no complaints. Software development is a bear. Compiler error messages only mean that you have made a mistake. They rarely, if ever, point out where the mistake was. My advice: write your programs a bit at a time.

Luckily, source programs for "smart controllers" are generally short.

Wednesday, October 7, 2015

23: About My "Live" Photon System

I've had a blogspot "comment" (question) about how I implemented the Photon control system at my granddaughter's farm (see post 21). Well, it's kind of complicated.

The program on the Photon is written in C++. It was initially only 80 lines of code but has grown to over 200 lines. It will probably get longer still. It has 2 main parts: 1) In the "loop()" all of the sensors are recorded in a Particle.variable, and time readings from the "cloud" control the electric fence and make sure that the water is not on for too long; b) a Particle.function can be called to change relays or override timed events.

I wrote a PHP program for the Internet interface. It is fairly complicated and only works because my hosting service is Linux-based and permits execution of the "curl" command to communicate with the Photon. Many servers would not allow this.

I also have a Raspberry Pi running Linux. I use the "crontab" scheduling program to check the status of the Photon. It is this Pi that can send e-mails or text messages if something goes wrong (hoop house too hot or cold, power failure, etc.).

Of course, the Photon's location has to have reliable wifi/Internet service. I had to add a wifi amplifier for my "live" system.

Sunday, October 4, 2015

22: Name Change

I'm going to change the name of this blog to--

-- because it's mostly about my Particle Photons. Duh.