Tuesday, August 10, 2021

 127: IOT — Things That Fail


Where shall I start? Most common or most irritating?


1. Irritating: I’ve had 2 Rpi micro SD cards fail. All the way, can’t retrieve data, can’t even be reformatted. Been running continuously for several years. Mostly but not totally backed up. Drat!


2. Common 1: Cheap (and not so cheap) relay boards. They just don’t make it in my farm-hoophouse world of wide temperature/humidity swings.


3. Common 2: Temperature/humidity sensors — same problem. I'm on my 5th type. Maybe ok.


4. USB power plugs: surprising — or not, because they are cheap.


5. Soil moisture sensors: unless you just replace them regularly.


6. Raspberry Pi wifi — 2 failed. Also one Pi itself.

Saturday, July 31, 2021

 126: Python: Stuck with it on the PI

Python: why I hate it. (and prefer PHP in many ways)


1. Beyond trivial programs the group-by-indent sucks. Give me {} any day.


2. No static local variables. I know there is a work-around but it’s lame. Scope can lead to error.


3. No auto convert between string and numeric. Constantly using int(s) and str(n). There could be a “strict” directive for the fussy. Also, watch out for accidentally calling a string “str”.


4. 1/5 = 0 BUT 1/5.0 = .2 ALSO 1.0/5 = .2


5. No case/switch 


6. Many Python errors are only caught when the code is executed. It is tiresome trying to test low-probability error conditions.


7. Too many ways to do (almost) the same thing. Too much to learn. Leads to “personalized” code.


8. No ++ or --, pre or post. Only v += 1


9. I prefer && and || to ‘and’ and ‘or’. ’Natural language’ my ass.


10. Object-Oriented: barf! O-O should be spelled ‘Oh-oh’. I was at Bell Labs when C++ happened. I considered it an empty bottle with a fancy label. I was wrong — it’s worse than that. C is far from perfect but the only good thing about C++ is that you can still write C. You can mostly ignore O-O in Python — but not mostly enough. And why is string-length() better than length(string) — esp. since there is str(n), etc.?


11. __main__ == natural language?

Sunday, March 7, 2021

 125: Useful Raspberry Pi Zero-W Developer Accessories


Each of the above is about $20. A Pi-Zero fits neatly under the plexiglass in the left-hand device. In the sales image it is stupidly paired with a headerless Pi (need male header). Duh. The GPIO pins are sort-of labeled. Adding the right-side GPIO interface provides good labels and secure screw connectors. Here's my current setup.